⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datasql.cs

📁 介绍学习的管理系统说明什么的
💻 CS
📖 第 1 页 / 共 5 页
字号:
                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;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -