📄 updatescore.cs
字号:
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
[WebService(Namespace = "http://wroxunited.net/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class UpdateScore : System.Web.Services.WebService
{
public void Goal(int FixtureID, int PlayerID, int GoalTime)
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["WroxUnited"].ConnectionString);
conn.Open();
SqlCommand cmd = new SqlCommand("usp_Goal", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@FixtureID", SqlDbType.Int).Value = FixtureID;
cmd.Parameters.Add("@PlayerID", SqlDbType.Int).Value = PlayerID;
cmd.Parameters.Add("@GoalTime", SqlDbType.Int).Value = GoalTime;
cmd.ExecuteNonQuery();
}
[WebMethod()]
public void UpdateGoals(int FixtureID, bool GoalFor, int PlayerID, int GoalTime)
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["WroxUnited"].ConnectionString);
conn.Open();
SqlCommand cmd = new SqlCommand("usp_UpdateScore", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@FixtureID", SqlDbType.Int).Value = FixtureID;
cmd.Parameters.Add("@GoalFor", SqlDbType.Bit).Value = GoalFor;
cmd.ExecuteNonQuery();
if (GoalFor)
Goal(FixtureID, PlayerID, GoalTime);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -