www.pudn.com > WEBrsgl6.20.rar > DataSql.cs


using System; 
using System.Collections.Generic; 
using System.Text; 
using System.Data.SqlClient; 
using System.Web.UI.WebControls; 
using System.Web.UI.HtmlControls; 
using System.Data; 
 
namespace DataSql 
{ 
    public class SqlData 
    { 
        private int count; 
        private int pagecount; 
        private int Pageindex; 
        private string select; 
        private string Sqlconnection; 
 
        public SqlData(string sql) 
        { 
            this.Sqlconnection = sql; 
        } 
 
        #region Property 
        public int Count 
        { 
            get 
            { 
                return this.count; 
            } 
            set 
            { 
                this.count = value; 
            } 
        } 
 
        public int CurrentPageindex 
        { 
            get 
            { 
                return this.Pageindex; 
            } 
            set 
            { 
                this.Pageindex = value; 
            } 
        } 
 
        public int PageCounts 
        { 
            get 
            { 
                return this.pagecount; 
            } 
            set 
            { 
                this.pagecount = value; 
            } 
        } 
 
        public string Select 
        { 
            get 
            { 
                return this.select; 
            } 
            set 
            { 
                this.select = value; 
            } 
        } 
        #endregion 
 
        #region Method 
        public string add_admini(string AName, string AIDCard, string APassword, string ATelephone, string Amovephone, string adminiType, string City, string Town, string address, string type) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("add_admini", connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@AName", AName); 
                command.Parameters.Add("@AIDCard", AIDCard); 
                command.Parameters.Add("@APassword", APassword); 
                command.Parameters.Add("@ATelephone", ATelephone); 
                command.Parameters.Add("@Amovephone", Amovephone); 
                command.Parameters.Add("@adminiType", adminiType); 
                command.Parameters.Add("@City", City); 
                command.Parameters.Add("@Town", Town); 
                command.Parameters.Add("@address", address); 
                command.Parameters.Add("@type", type); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string add_City(string City) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("add_City", connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@City", City); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string add_Farmland(string FID, string City, string Town, string Village, string ActualArea, string rFitArea, string pFitArea, string dFitArea, string tFitArea, string type, string VillageCount, string MfitArea, string IndraughtCount, string HarvestTime, string EarlyTime, string OverTime, string Charge, string adminID, string year) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("add_Farmland", connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@FID", FID); 
                command.Parameters.Add("@City", City); 
                command.Parameters.Add("@Town", Town); 
                command.Parameters.Add("@Village", Village); 
                command.Parameters.Add("@ActualArea", ActualArea); 
                command.Parameters.Add("@rFitArea", rFitArea); 
                command.Parameters.Add("@pFitArea", pFitArea); 
                command.Parameters.Add("@dFitArea", dFitArea); 
                command.Parameters.Add("@tFitArea", tFitArea); 
                command.Parameters.Add("@type", type); 
                command.Parameters.Add("@VillageCount", VillageCount); 
                command.Parameters.Add("@ModelNumber", MfitArea); 
                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("@adminID", adminID); 
                command.Parameters.Add("@Years", year); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string add_MODEL(string AIDCard, string rmodel, string pmodel, string dmodel, string tmodel) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("add_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 add_QueXian(string ntdj, string zhuantai, string addUser, string addCity, string shenhe, string mima, string tongzhi, string ntxg, string addamini, string forms, string selectUser, string njqk, string rizi, string ntxi, string jqsyl, string ntqktj) 
        { 
            SqlConnection connection = new SqlConnection(this.Sqlconnection); 
            SqlCommand command = new SqlCommand("add_QueXian", connection); 
            command.CommandType = CommandType.StoredProcedure; 
            command.Parameters.Add("@ntdj", ntdj); 
            command.Parameters.Add("@zhuantai", zhuantai); 
            command.Parameters.Add("@addUser", addUser); 
            command.Parameters.Add("@addCity", addCity); 
            command.Parameters.Add("@shenhe", shenhe); 
            command.Parameters.Add("@mima", mima); 
            command.Parameters.Add("@tongzhi", tongzhi); 
            command.Parameters.Add("@ntxg", ntxg); 
            command.Parameters.Add("@addamini", addamini); 
            command.Parameters.Add("@forms", forms); 
            command.Parameters.Add("@selectUser", selectUser); 
            command.Parameters.Add("@njqk", njqk); 
            command.Parameters.Add("@rizi", rizi); 
            command.Parameters.Add("@ntxi", ntxi); 
            command.Parameters.Add("@jqsyl", jqsyl); 
            command.Parameters.Add("@ntqktj", ntqktj); 
            connection.Open(); 
            command.ExecuteNonQuery(); 
            command = new SqlCommand("select max(type) from QueXian", connection); 
            string str = command.ExecuteScalar().ToString(); 
            connection.Close(); 
            return str; 
        } 
 
        public string add_Record(string Name, string Card, string Course, string result, string Times) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("add_Record", connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@Name", Name); 
                command.Parameters.Add("@Card", Card); 
                command.Parameters.Add("@Course", Course); 
                command.Parameters.Add("@result", result); 
                command.Parameters.Add("@Times", Times); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string add_Town(string City, string Town) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("add_Town", connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@City", City); 
                command.Parameters.Add("@Town", Town); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string addJiaoyi(string sq, string OrganID, string OrganType, string adminID, string adminTele, string address, string word, string area, string price, string time) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(sq, connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@OrganID", OrganID); 
                command.Parameters.Add("@OrganType", OrganType); 
                command.Parameters.Add("@adminID", adminID); 
                command.Parameters.Add("@adminTele", adminTele); 
                command.Parameters.Add("@address", address); 
                command.Parameters.Add("@word", word); 
                command.Parameters.Add("@area", area); 
                command.Parameters.Add("@price", price); 
                command.Parameters.Add("@times", time); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string addUser(string Sql, string del, string UName, string UIDCard, string UPassword, string UTelephone, string Movephone, string City, string County, string Town, string Village, string Ulevel) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(Sql, connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@UName", UName); 
                command.Parameters.Add("@AIDCard", UIDCard); 
                command.Parameters.Add("@APassword", UPassword); 
                command.Parameters.Add("@UTelephone", UTelephone); 
                command.Parameters.Add("@Movephone", Movephone); 
                command.Parameters.Add("@City", City); 
                command.Parameters.Add("@County", County); 
                command.Parameters.Add("@Town", Town); 
                command.Parameters.Add("@Village", Village); 
                command.Parameters.Add("@Ulevel", Ulevel); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                new SqlCommand("delete Users where UserID=" + del, connection).ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string addWxznjUse(string Sql, string del, string OrganName, string OCard, string Opassword, string Faren, string ATelephone, string Movephone, string Address, string reaperSum, string reaperFree, string planeSum, string planeFree, string ditchSum, string ditchFree, string transplantSum, string transplantFree, string mass, string model, string bound, string member, string tele, string move, string remavk) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(Sql, connection); 
                command.CommandType = CommandType.StoredProcedure; 
                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", reaperFree); 
                command.Parameters.Add("@planeSum", planeSum); 
                command.Parameters.Add("@planeFree", planeFree); 
                command.Parameters.Add("@ditchSum", ditchSum); 
                command.Parameters.Add("@ditchFree", ditchFree); 
                command.Parameters.Add("@transplantSum", transplantSum); 
                command.Parameters.Add("@transplantFree", transplantFree); 
                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(); 
                new SqlCommand("delete Organization where OrganID=" + del, connection).ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string addWxznjUser(string Sql, string del, string AName, string AIDCard, string APassword, string ATelephone, string Movephone, string Address, string reaperSum, string reaperFree, string planeSum, string planeFree, string ditchSum, string ditchFree, string transplantSum, string transplantFree, string mass, string model, string bound, string remavk) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(Sql, connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@AName", AName); 
                command.Parameters.Add("@AIDCard", AIDCard); 
                command.Parameters.Add("@APassword", APassword); 
                command.Parameters.Add("@ATelephone", ATelephone); 
                command.Parameters.Add("@Movephone", Movephone); 
                command.Parameters.Add("@Address", Address); 
                command.Parameters.Add("@reaperSum", reaperSum); 
                command.Parameters.Add("@reaperFree", reaperFree); 
                command.Parameters.Add("@planeSum", planeSum); 
                command.Parameters.Add("@planeFree", planeFree); 
                command.Parameters.Add("@ditchSum", ditchSum); 
                command.Parameters.Add("@ditchFree", ditchFree); 
                command.Parameters.Add("@transplantSum", transplantSum); 
                command.Parameters.Add("@transplantFree", transplantFree); 
                command.Parameters.Add("@mass", mass); 
                command.Parameters.Add("@model", model); 
                command.Parameters.Add("@bound", bound); 
                command.Parameters.Add("@remavk", remavk); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                new SqlCommand("delete AMachine where OrganID=" + del, connection).ExecuteNonQuery(); 
                connection.Close(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string del_City(string City) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("del_City", connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@City", City); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string del_Town(string Town) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("del_Town", connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@Town", Town); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string delUser(string table, string ziduan, string tiaojie) 
        { 
            try 
            { 
                string cmdText = "delete  " + table + "  where " + ziduan + "=@nei"; 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(cmdText, connection); 
                command.Parameters.Add("@nei", tiaojie); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string Exec(string Sql, Label View, Label View2) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(Sql, connection); 
                connection.Open(); 
                SqlDataReader reader = command.ExecuteReader(); 
                if (reader.Read()) 
                { 
                    View.Text = reader["AName"].ToString(); 
                    View2.Text = reader["ATelephone"].ToString() + ",手机:" + reader["Amovephone"].ToString(); 
                } 
                reader.Close(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string ExecuteNonQuery(string Sql) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(Sql, connection); 
                connection.Open(); 
                int num = command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string ExecuteNonQuery(string Sql, DataList View) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand selectCommand = new SqlCommand(Sql, connection); 
                SqlDataAdapter adapter = new SqlDataAdapter(selectCommand); 
                DataSet dataSet = new DataSet(); 
                adapter.Fill(dataSet); 
                View.DataSource = dataSet; 
                View.DataBind(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string ExecuteNonQuery(string Sql, GridView View) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand selectCommand = new SqlCommand(Sql, connection); 
                SqlDataAdapter adapter = new SqlDataAdapter(selectCommand); 
                DataSet dataSet = new DataSet(); 
                adapter.Fill(dataSet); 
                View.DataSource = dataSet; 
                View.DataBind(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string ExecuteNonQuery(string Sql, Label View) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(Sql, connection); 
                connection.Open(); 
                SqlDataReader reader = command.ExecuteReader(); 
                if (reader.Read()) 
                { 
                    View.Text = reader.GetValue(1).ToString(); 
                } 
                reader.Close(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string ExecuteNonQuery(string Sql, Label View, Label View2) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(Sql, connection); 
                connection.Open(); 
                SqlDataReader reader = command.ExecuteReader(); 
                if (reader.Read()) 
                { 
                    View.Text = reader["AName"].ToString(); 
                    View2.Text = reader["AIDCard"].ToString(); 
                } 
                reader.Close(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string JiaoXi(string sql, TextBox tele, Label address) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(sql, connection); 
                connection.Open(); 
                SqlDataReader reader = command.ExecuteReader(); 
                if (reader.Read()) 
                { 
                    tele.Text = reader["Amovephone"].ToString() + "/" + reader["Amovephone"].ToString(); 
                    address.Text = reader["City"].ToString() + reader["Town"].ToString() + reader["village"].ToString(); 
                } 
                reader.Close(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string kQingKuang(string workType, string village, string daozhong, string Years, Label Type, Label ActuarArea, Label area, Label Mcount, Label jqsyl) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("select_kQingKuang", connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@workType", workType); 
                command.Parameters.Add("@ActualArea", ""); 
                command.Parameters.Add("@village", village); 
                command.Parameters.Add("@daozhong", daozhong); 
                command.Parameters.Add("@Years", Years); 
                connection.Open(); 
                SqlDataReader reader = command.ExecuteReader(); 
                if (reader.Read()) 
                { 
                    Type.Text = reader["workType"].ToString(); 
                    ActuarArea.Text = reader["ActualArea"].ToString(); 
                    area.Text = reader["area"].ToString(); 
                    Mcount.Text = reader["Mcount"].ToString(); 
                    jqsyl.Text = reader["jqsyl"].ToString(); 
                } 
                reader.Close(); 
                connection.Close(); 
                if (jqsyl.Text == "") 
                { 
                    jqsyl.Text = "0.0"; 
                } 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public bool Login(string table, string user, string pas, Label type, Label id, Label City, Label Town, Label adminiType) 
        { 
            SqlConnection connection = new SqlConnection(this.Sqlconnection); 
            SqlCommand command = new SqlCommand(table, connection); 
            command.CommandType = CommandType.StoredProcedure; 
            command.Parameters.Add("@AIDCard", user); 
            command.Parameters.Add("@APassword", pas); 
            connection.Open(); 
            SqlDataReader reader = command.ExecuteReader(); 
            if (reader.Read()) 
            { 
                id.Text = reader["AID"].ToString(); 
                City.Text = reader["City"].ToString(); 
                Town.Text = reader["Town"].ToString(); 
                adminiType.Text = reader["adminiType"].ToString(); 
                type.Text = reader["type"].ToString(); 
                reader.Close(); 
                connection.Close(); 
                return true; 
            } 
            reader.Close(); 
            connection.Close(); 
            return false; 
        } 
 
        public bool Lonin(string table, string user, string pas) 
        { 
            SqlConnection connection = new SqlConnection(this.Sqlconnection); 
            SqlCommand command = new SqlCommand(table, connection); 
            command.CommandType = CommandType.StoredProcedure; 
            command.Parameters.Add("@UIDCard", user); 
            command.Parameters.Add("@UPassword", pas); 
            connection.Open(); 
            return command.ExecuteReader().Read(); 
        } 
 
        public string Max_ZhuangTai() 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("select max(zid)from ZhuangTai", connection); 
                connection.Open(); 
                return command.ExecuteScalar().ToString(); 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string nongtianworkQingKuang(string adminID, string workType, string daozhong, string Years, Label v, Label Type, Label ActuarArea, Label area, Label Mcount, Label jqsyl) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("select_nongtianworkQingKuang", connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@adminID", adminID); 
                command.Parameters.Add("@workType", workType); 
                command.Parameters.Add("@ActualArea", ""); 
                command.Parameters.Add("@village", ""); 
                command.Parameters.Add("@daozhong", daozhong); 
                command.Parameters.Add("@Years", Years); 
                connection.Open(); 
                SqlDataReader reader = command.ExecuteReader(); 
                if (reader.Read()) 
                { 
                    v.Text = reader["village"].ToString(); 
                    Type.Text = reader["workType"].ToString(); 
                    ActuarArea.Text = reader["ActualArea"].ToString(); 
                    area.Text = reader["area"].ToString(); 
                    Mcount.Text = reader["Mcount"].ToString(); 
                    jqsyl.Text = reader["jqsyl"].ToString(); 
                } 
                reader.Close(); 
                connection.Close(); 
                if (jqsyl.Text == "") 
                { 
                    jqsyl.Text = "0.0"; 
                } 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public void PagedData(DataList Dt, int i) 
        { 
            try 
            { 
                PagedDataSource source = new PagedDataSource(); 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand selectCommand = new SqlCommand(this.Select, connection); 
                SqlDataAdapter adapter = new SqlDataAdapter(selectCommand); 
                DataSet dataSet = new DataSet(); 
                adapter.Fill(dataSet); 
                source.DataSource = dataSet.Tables[0].DefaultView; 
                source.AllowPaging = true; 
                this.Count = source.Count; 
                source.PageSize = i; 
                source.CurrentPageIndex = this.CurrentPageindex - 1; 
                this.PageCounts = source.PageCount; 
                Dt.DataSource = source; 
                Dt.DataBind(); 
            } 
            catch 
            { 
            } 
        } 
 
        public string QingKuangCity(string workType, string City, string daozhong, string Years, Label Type, Label ActuarArea, Label area, Label Mcount, Label jqsyl) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("select_QingKuangCity", connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@workType", workType); 
                command.Parameters.Add("@ActualArea", ""); 
                command.Parameters.Add("@City", City); 
                command.Parameters.Add("@daozhong", daozhong); 
                command.Parameters.Add("@Years", Years); 
                connection.Open(); 
                SqlDataReader reader = command.ExecuteReader(); 
                if (reader.Read()) 
                { 
                    Type.Text = reader["workType"].ToString(); 
                    ActuarArea.Text = reader["ActualArea"].ToString(); 
                    area.Text = reader["area"].ToString(); 
                    Mcount.Text = reader["Mcount"].ToString(); 
                    jqsyl.Text = reader["jqsyl"].ToString(); 
                } 
                reader.Close(); 
                connection.Close(); 
                if (jqsyl.Text == "") 
                { 
                    jqsyl.Text = "0.0"; 
                } 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string QingKuangTown(string workType, string City, string Town, string daozhong, string Years, Label Type, Label ActuarArea, Label area, Label Mcount, Label jqsyl) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("select_QingKuangTown", connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@workType", workType); 
                command.Parameters.Add("@ActualArea", ""); 
                command.Parameters.Add("@City", City); 
                command.Parameters.Add("@Town", Town); 
                command.Parameters.Add("@daozhong", daozhong); 
                command.Parameters.Add("@Years", Years); 
                connection.Open(); 
                SqlDataReader reader = command.ExecuteReader(); 
                if (reader.Read()) 
                { 
                    Type.Text = reader["workType"].ToString(); 
                    ActuarArea.Text = reader["ActualArea"].ToString(); 
                    area.Text = reader["area"].ToString(); 
                    Mcount.Text = reader["Mcount"].ToString(); 
                    jqsyl.Text = reader["jqsyl"].ToString(); 
                } 
                reader.Close(); 
                connection.Close(); 
                if (jqsyl.Text == "") 
                { 
                    jqsyl.Text = "0.0"; 
                } 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public void QueXie(string name, HtmlTableCell t1, HtmlTableCell t2) 
        { 
            SqlConnection connection = new SqlConnection(this.Sqlconnection); 
            SqlCommand command = new SqlCommand("select * from QueXian where type=@cards", connection); 
            command.Parameters.Add("@cards", name); 
            connection.Open(); 
            SqlDataReader reader = command.ExecuteReader(); 
            if (reader.Read()) 
            { 
                t1.Visible = Convert.ToBoolean(reader["njxi"].ToString()); 
                t2.Visible = Convert.ToBoolean(reader["addnj"].ToString()); 
            } 
            reader.Close(); 
            connection.Close(); 
        } 
 
        public void QueXie(string name, HtmlTableCell t1, HtmlTableCell t2, HtmlTableCell t3) 
        { 
            SqlConnection connection = new SqlConnection(this.Sqlconnection); 
            SqlCommand command = new SqlCommand("select * from QueXian where type=@cards", connection); 
            command.Parameters.Add("@cards", name); 
            connection.Open(); 
            SqlDataReader reader = command.ExecuteReader(); 
            if (reader.Read()) 
            { 
                t1.Visible = Convert.ToBoolean(reader["ntdj"].ToString()); 
                t2.Visible = Convert.ToBoolean(reader["ntxi"].ToString()); 
                t3.Visible = Convert.ToBoolean(reader["zhuantai"].ToString()); 
            } 
            reader.Close(); 
            connection.Close(); 
        } 
 
        public void QueXie(string name, HtmlTableCell t1, HtmlTableCell t2, HtmlTableCell t3, HtmlTableCell t4, HtmlTableCell t5, HtmlTableCell t6, HtmlTableCell t7, HtmlTableCell t8, HtmlTableCell t9, HtmlTableCell t10, HtmlTableCell t11, HtmlTableCell t12, HtmlTableCell t13, HtmlTableCell t14, HtmlTableCell t15, HtmlTableCell t16) 
        { 
            SqlConnection connection = new SqlConnection(this.Sqlconnection); 
            SqlCommand command = new SqlCommand("select * from QueXian where type=@cards", connection); 
            command.Parameters.Add("@cards", name); 
            connection.Open(); 
            SqlDataReader reader = command.ExecuteReader(); 
            if (reader.Read()) 
            { 
                t1.Visible = Convert.ToBoolean(reader["ntdj"].ToString()); 
                t2.Visible = Convert.ToBoolean(reader["zhuantai"].ToString()); 
                t3.Visible = Convert.ToBoolean(reader["addUser"].ToString()); 
                t4.Visible = Convert.ToBoolean(reader["addCity"].ToString()); 
                t5.Visible = Convert.ToBoolean(reader["shenhe"].ToString()); 
                t6.Visible = Convert.ToBoolean(reader["mima"].ToString()); 
                t7.Visible = Convert.ToBoolean(reader["tongzhi"].ToString()); 
                t8.Visible = Convert.ToBoolean(reader["ntxg"].ToString()); 
                t9.Visible = Convert.ToBoolean(reader["addamini"].ToString()); 
                t10.Visible = Convert.ToBoolean(reader["forms"].ToString()); 
                t11.Visible = Convert.ToBoolean(reader["selectUser"].ToString()); 
                t12.Visible = Convert.ToBoolean(reader["njqk"].ToString()); 
                t13.Visible = Convert.ToBoolean(reader["rizi"].ToString()); 
                t14.Visible = Convert.ToBoolean(reader["ntxi"].ToString()); 
                t15.Visible = Convert.ToBoolean(reader["jqsyl"].ToString()); 
                t16.Visible = Convert.ToBoolean(reader["ntqktj"].ToString()); 
            } 
            reader.Close(); 
            connection.Close(); 
        } 
 
        public string select_admini(string sql, Label name, Label type, Label LabelCity, Label LabelTown, Label village) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(sql, connection); 
                connection.Open(); 
                SqlDataReader reader = command.ExecuteReader(); 
                if (reader.Read()) 
                { 
                    name.Text = reader["AName"].ToString(); 
                    type.Text = reader["adminiType"].ToString(); 
                    LabelCity.Text = reader["City"].ToString(); 
                    LabelTown.Text = reader["Town"].ToString(); 
                    village.Text = reader["address"].ToString(); 
                } 
                reader.Close(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string SelectUser(string table, string ziduan, string tiaojie, DataList View) 
        { 
            try 
            { 
                string cmdText = "select * from  " + table + "  where " + ziduan + "=@nei"; 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand selectCommand = new SqlCommand(cmdText, connection); 
                selectCommand.Parameters.Add("@nei", tiaojie); 
                SqlDataAdapter adapter = new SqlDataAdapter(selectCommand); 
                DataSet dataSet = new DataSet(); 
                adapter.Fill(dataSet); 
                View.DataSource = dataSet; 
                View.DataBind(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string sp_add(string City, string Town, string village, string villageName, string Type, string OrganID, string OrganType, string adminID, string workType, string Mcount, string area, string price, string Times, string Years) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("insert_ZhuangTai", connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@City", City); 
                command.Parameters.Add("@Town", Town); 
                command.Parameters.Add("@village", village); 
                command.Parameters.Add("@villageName", villageName); 
                command.Parameters.Add("@Type", Type); 
                command.Parameters.Add("@OrganID", OrganID); 
                command.Parameters.Add("@OrganType", OrganType); 
                command.Parameters.Add("@adminID", adminID); 
                command.Parameters.Add("@workType", workType); 
                command.Parameters.Add("@Mcount", Mcount); 
                command.Parameters.Add("@area", area); 
                command.Parameters.Add("@price", price); 
                command.Parameters.Add("@Times", Times); 
                command.Parameters.Add("@Years", Years); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                command = new SqlCommand("select max(zid)from ZhuangTai", connection); 
                string str = command.ExecuteScalar().ToString(); 
                connection.Close(); 
                return str; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string sp_Proc(string proc, string AIDCard, string reaperFree, string transplantFree, string ditchFree, string planeFree, string plantpFree) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(proc, connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@AIDCard", AIDCard); 
                command.Parameters.Add("@reaperFree", reaperFree); 
                command.Parameters.Add("@ditchFree", ditchFree); 
                command.Parameters.Add("@planeFree", planeFree); 
                command.Parameters.Add("@plantpFree", plantpFree); 
                command.Parameters.Add("@transplantFree", transplantFree); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string sp_update(string zID) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand("update_ZhuangTai", connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@zID", zID); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string Storedprocedure(string Sql) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(Sql, connection); 
                command.CommandType = CommandType.StoredProcedure; 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string Storedprocedure(string Sql, string UName, string UIDCard, string UPassword, string UTelephone, string Movephone, string City, string County, string Town, string Village, string Ulevel) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(Sql, connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@UName", UName); 
                command.Parameters.Add("@AIDCard", UIDCard); 
                command.Parameters.Add("@APassword", UPassword); 
                command.Parameters.Add("@UTelephone", UTelephone); 
                command.Parameters.Add("@Movephone", Movephone); 
                command.Parameters.Add("@City", City); 
                command.Parameters.Add("@County", County); 
                command.Parameters.Add("@Town", Town); 
                command.Parameters.Add("@Village", Village); 
                command.Parameters.Add("@Ulevel", Ulevel); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string Storedprocedure(string Sql, string AName, string AIDCard, string APassword, string ATelephone, string Movephone, string Address, string reaperSum, string reaperFree, string planeSum, string planeFree, string ditchSum, string ditchFree, string transplantSum, string transplantFree, string mass, string model, string bound, string remavk) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(Sql, connection); 
                command.CommandType = CommandType.StoredProcedure; 
                command.Parameters.Add("@AName", AName); 
                command.Parameters.Add("@AIDCard", AIDCard); 
                command.Parameters.Add("@APassword", APassword); 
                command.Parameters.Add("@ATelephone", ATelephone); 
                command.Parameters.Add("@Movephone", Movephone); 
                command.Parameters.Add("@Address", Address); 
                command.Parameters.Add("@reaperSum", reaperSum); 
                command.Parameters.Add("@reaperFree", reaperFree); 
                command.Parameters.Add("@planeSum", planeSum); 
                command.Parameters.Add("@planeFree", planeFree); 
                command.Parameters.Add("@ditchSum", ditchSum); 
                command.Parameters.Add("@ditchFree", ditchFree); 
                command.Parameters.Add("@transplantSum", transplantSum); 
                command.Parameters.Add("@transplantFree", transplantFree); 
                command.Parameters.Add("@mass", mass); 
                command.Parameters.Add("@model", model); 
                command.Parameters.Add("@bound", bound); 
                command.Parameters.Add("@remavk", remavk); 
                connection.Open(); 
                command.ExecuteNonQuery(); 
                connection.Close(); 
                return "ok"; 
            } 
            catch (Exception exception) 
            { 
                return exception.Message.ToString(); 
            } 
        } 
 
        public string Storedprocedure(string Sql, string OrganName, string OCard, string Opassword, string Faren, string ATelephone, string Movephone, string Address, string reaperSum, string reaperFree, string planeSum, string planeFree, string ditchSum, string ditchFree, string transplantSum, string transplantFree, string mass, string model, string bound, string member, string tele, string move, string remavk) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(Sql, connection); 
                command.CommandType = CommandType.StoredProcedure; 
                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", reaperFree); 
                command.Parameters.Add("@planeSum", planeSum); 
                command.Parameters.Add("@planeFree", planeFree); 
                command.Parameters.Add("@ditchSum", ditchSum); 
                command.Parameters.Add("@ditchFree", ditchFree); 
                command.Parameters.Add("@transplantSum", transplantSum); 
                command.Parameters.Add("@transplantFree", transplantFree); 
                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 bool Textboot(string Sql, TextBox tr, TextBox tt, TextBox td, TextBox tf,TextBox tm) 
        { 
            try 
            { 
                SqlConnection connection = new SqlConnection(this.Sqlconnection); 
                SqlCommand command = new SqlCommand(Sql, connection); 
                connection.Open(); 
                SqlDataReader reader = command.ExecuteReader(); 
                if (reader.Read()) 
                { 
                    tr.Text = reader["reaperFree"].ToString(); 
                    tt.Text = reader["transplantFree"].ToString(); 
                    td.Text = reader["ditchFree"].ToString(); 
                    tf.Text = reader["planeFree"].ToString(); 
                    tm.Text = reader["plantpFree"].ToString(); 
                    reader.Close(); 
                    connection.Close(); 
                    return true; 
                } 
                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; 
            } 
        } 
    } 
}