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

📄 datasql.cs

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

⌨️ 快捷键说明

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