📄 datasql.cs
字号:
}
reader.Close();
connection.Close();
return false;
}
catch (Exception)
{
return false;
}
}
public string up_MODEL(string AIDCard, string rmodel, string pmodel, string dmodel, string tmodel)
{
try
{
SqlConnection connection = new SqlConnection(this.Sqlconnection);
SqlCommand command = new SqlCommand("up_MODEL", connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@AIDCard", AIDCard);
command.Parameters.Add("@rmodel", rmodel);
command.Parameters.Add("@pmodel", pmodel);
command.Parameters.Add("@dmodel", dmodel);
command.Parameters.Add("@tmodel", tmodel);
connection.Open();
command.ExecuteNonQuery();
connection.Close();
return "ok";
}
catch (Exception exception)
{
return exception.Message.ToString();
}
}
//public string update_Farmland(string adminID, string type, string ActualArea, string rFitArea, string pFitArea, string mFitArea, string dFitArea, string tFitArea, string VillageCount, string ModelNumber, string IndraughtCount, string HarvestTime, string EarlyTime, string OverTime, string Charge, string Years)
//{
public string update_Farmland(string adminID, string type, string ActualArea, string rFitArea, string pFitArea, string mFitArea, string dFitArea, string tFitArea, string VillageCount,string IndraughtCount, string HarvestTime, string EarlyTime, string OverTime, string Charge, string Years)
{
try
{
SqlConnection connection = new SqlConnection(this.Sqlconnection);
SqlCommand command = new SqlCommand("update_Farmland", connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@adminID", adminID);
command.Parameters.Add("@type", type);
command.Parameters.Add("@ActualArea", ActualArea);
command.Parameters.Add("@rFitArea", rFitArea);
command.Parameters.Add("@pFitArea", pFitArea);
command.Parameters.Add("@mFitArea", mFitArea);
command.Parameters.Add("@dFitArea", dFitArea);
command.Parameters.Add("@tFitArea", tFitArea);
command.Parameters.Add("@VillageCount", VillageCount);
//command.Parameters.Add("@ModelNumber", ModelNumber);
command.Parameters.Add("@IndraughtCount", IndraughtCount);
command.Parameters.Add("@HarvestTime", HarvestTime);
command.Parameters.Add("@EarlyTime", EarlyTime);
command.Parameters.Add("@OverTime", OverTime);
command.Parameters.Add("@Charge", Charge);
command.Parameters.Add("@Years", Years);
connection.Open();
command.ExecuteNonQuery();
connection.Close();
return "ok";
}
catch (Exception exception)
{
return exception.Message.ToString();
}
}
public string updaterOrgan(string table, string OrganID, string OrganName, string OCard, string Opassword, string Faren, string ATelephone, string Movephone, string Address, string reaperSum, string planeSum, string ditchSum, string transplantSum, string mass, string model, string bound, string member, string tele, string move, string remavk, string rFree, string pFree, string dFree, string tFree)
{
try
{
SqlConnection connection = new SqlConnection(this.Sqlconnection);
SqlCommand command = new SqlCommand(table, connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@OrganID", OrganID);
command.Parameters.Add("@OrganName", OrganName);
command.Parameters.Add("@OCard", OCard);
command.Parameters.Add("@Opassword", Opassword);
command.Parameters.Add("@Faren", Faren);
command.Parameters.Add("@ATelephone ", ATelephone);
command.Parameters.Add("@Movephone", Movephone);
command.Parameters.Add("@Address", Address);
command.Parameters.Add("@reaperSum", reaperSum);
command.Parameters.Add("@reaperFree", rFree);
command.Parameters.Add("@planeSum ", planeSum);
command.Parameters.Add("@planeFree ", pFree);
command.Parameters.Add("@ditchSum", ditchSum);
command.Parameters.Add("@ditchFree", dFree);
command.Parameters.Add("@transplantSum", transplantSum);
command.Parameters.Add("@transplantFree", tFree);
command.Parameters.Add("@mass", mass);
command.Parameters.Add("@model", model);
command.Parameters.Add("@bound", bound);
command.Parameters.Add("@member", member);
command.Parameters.Add("@tele", tele);
command.Parameters.Add("@move", move);
command.Parameters.Add("@remavk", remavk);
connection.Open();
command.ExecuteNonQuery();
connection.Close();
return "ok";
}
catch (Exception exception)
{
return exception.Message.ToString();
}
}
public string updateUser(string table, string UserID, string UName, string AIDCard, string APassword, string UTelephone, string Movephone, string Village, string Town, string County, string City, string Ulevel)
{
try
{
SqlConnection connection = new SqlConnection(this.Sqlconnection);
SqlCommand command = new SqlCommand(table, connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@UserID", UserID);
command.Parameters.Add("@UName", UName);
command.Parameters.Add("@AIDCard", AIDCard);
command.Parameters.Add("@APassword", APassword);
command.Parameters.Add("@UTelephone", UTelephone);
command.Parameters.Add("@Movephone", Movephone);
command.Parameters.Add("@Village", Village);
command.Parameters.Add("@Town", Town);
command.Parameters.Add("@County", County);
command.Parameters.Add("@City", City);
command.Parameters.Add("@Ulevel", Ulevel);
connection.Open();
command.ExecuteNonQuery();
connection.Close();
return "ok";
}
catch (Exception exception)
{
return exception.Message.ToString();
}
}
public string WdjnjzUser(string sql, TextBox Faren, TextBox t1, TextBox t2, TextBox t3, TextBox t4, TextBox t5, TextBox t6, TextBox t7, TextBox t8, TextBox t9, TextBox t10, TextBox t11, TextBox t12, TextBox t13, TextBox t14, TextBox t15, TextBox t16, TextBox t17, TextBox t18, TextBox ltele, TextBox lmove, TextBox t19)
{
try
{
SqlConnection connection = new SqlConnection(this.Sqlconnection);
SqlCommand command = new SqlCommand("select * from Organization where OrganID=@cards", connection);
command.Parameters.Add("@cards", sql);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
if (reader.Read())
{
Faren.Text = reader["Faren"].ToString();
t1.Text = reader["OrganName"].ToString();
t2.Text = reader["OCard"].ToString();
t3.Text = reader["Opassword"].ToString();
t4.Text = reader["ATelephone"].ToString();
t5.Text = reader["Movephone"].ToString();
t6.Text = reader["Address"].ToString();
t7.Text = reader["reaperSum"].ToString();
t8.Text = reader["reaperFree"].ToString();
t9.Text = reader["planeSum"].ToString();
t10.Text = reader["planeFree"].ToString();
t11.Text = reader["ditchSum"].ToString();
t12.Text = reader["ditchFree"].ToString();
t13.Text = reader["transplantSum"].ToString();
t14.Text = reader["transplantFree"].ToString();
t15.Text = reader["mass"].ToString();
t16.Text = reader["model"].ToString();
t17.Text = reader["bound"].ToString();
t18.Text = reader["member"].ToString();
ltele.Text = reader["tele"].ToString();
lmove.Text = reader["move"].ToString();
t19.Text = reader["remavk"].ToString();
}
reader.Close();
connection.Close();
return "ok";
}
catch (Exception exception)
{
return exception.Message.ToString();
}
}
public string WxznjUser(string sql, TextBox t1, TextBox t2, TextBox t3, TextBox t4, TextBox t5, TextBox t6, TextBox t7, TextBox t8, TextBox t9, TextBox t10, TextBox t11, TextBox t12, TextBox t13, TextBox t14, TextBox t15, TextBox t16, TextBox t17, TextBox t18)
{
try
{
SqlConnection connection = new SqlConnection(this.Sqlconnection);
SqlCommand command = new SqlCommand("select * from AMachine where OrganID=@cards", connection);
command.Parameters.Add("@cards", sql);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
if (reader.Read())
{
t1.Text = reader["AName"].ToString();
t2.Text = reader["AIDCard"].ToString();
t3.Text = reader["APassword"].ToString();
t4.Text = reader["ATelephone"].ToString();
t5.Text = reader["Movephone"].ToString();
t6.Text = reader["Address"].ToString();
t7.Text = reader["reaperSum"].ToString();
t8.Text = reader["reaperFree"].ToString();
t9.Text = reader["planeSum"].ToString();
t10.Text = reader["planeFree"].ToString();
t11.Text = reader["ditchSum"].ToString();
t12.Text = reader["ditchFree"].ToString();
t13.Text = reader["transplantSum"].ToString();
t14.Text = reader["transplantFree"].ToString();
t15.Text = reader["mass"].ToString();
t16.Text = reader["model"].ToString();
t17.Text = reader["bound"].ToString();
t18.Text = reader["remavk"].ToString();
}
reader.Close();
connection.Close();
return "ok";
}
catch (Exception exception)
{
return exception.Message.ToString();
}
}
public void WxzUser(string sql, TextBox t1, TextBox t2, TextBox t3, TextBox t4, TextBox t5, TextBox t6, TextBox t7, TextBox t8, TextBox t9, TextBox t10)
{
SqlConnection connection = new SqlConnection(this.Sqlconnection);
SqlCommand command = new SqlCommand("select * from Users where UserID=@cards", connection);
command.Parameters.Add("@cards", sql);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
if (reader.Read())
{
t1.Text = reader["UName"].ToString();
t2.Text = reader["UIDCard"].ToString();
t3.Text = reader["UPassword"].ToString();
t4.Text = reader["UTelephone"].ToString();
t5.Text = reader["Movephone"].ToString();
t6.Text = reader["City"].ToString();
t7.Text = reader["County"].ToString();
t8.Text = reader["Town"].ToString();
t9.Text = reader["Village"].ToString();
t10.Text = reader["Ulevel"].ToString();
}
reader.Close();
connection.Close();
}
#endregion
}
public class userLogin
{
private string password;
private string sqlconnection;
private string table;
private string user;
public string Password
{
get
{
return this.password;
}
set
{
this.password = value;
}
}
public string User
{
get
{
return this.user;
}
set
{
this.user = value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -