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

📄 医院管理系统dataset.designer.cs

📁 本人课程设计时开发的一个医院管理系统
💻 CS
📖 第 1 页 / 共 4 页
字号:
            this._connection = new System.Data.SqlClient.SqlConnection();
            this._connection.ConnectionString = global::WindowsApplication1.Properties.Settings.Default.医院管理系统ConnectionString;
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitCommandCollection() {
            this._commandCollection = new System.Data.SqlClient.SqlCommand[2];
            this._commandCollection[0] = new System.Data.SqlClient.SqlCommand();
            this._commandCollection[0].Connection = this.Connection;
            this._commandCollection[0].CommandText = "SELECT Medicine_Code, Medicine_Name, Price, Store_Amount FROM dbo.Medicine_Store";
            this._commandCollection[0].CommandType = System.Data.CommandType.Text;
            this._commandCollection[1] = new System.Data.SqlClient.SqlCommand();
            this._commandCollection[1].Connection = this.Connection;
            this._commandCollection[1].CommandText = "SELECT Medicine_Code, Medicine_Name, Price, Store_Amount\r\nFROM Medicine_Store\r\nWH" +
                "ERE (Medicine_Name = @Name)";
            this._commandCollection[1].CommandType = System.Data.CommandType.Text;
            this._commandCollection[1].Parameters.Add(new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.Char, 10, System.Data.ParameterDirection.Input, 0, 0, "Medicine_Name", System.Data.DataRowVersion.Current, false, null, "", "", ""));
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)]
        public virtual int Fill(医院管理系统DataSet.Medicine_StoreDataTable dataTable) {
            this.Adapter.SelectCommand = this.CommandCollection[0];
            if ((this.ClearBeforeFill == true)) {
                dataTable.Clear();
            }
            int returnValue = this.Adapter.Fill(dataTable);
            return returnValue;
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
        public virtual 医院管理系统DataSet.Medicine_StoreDataTable GetData() {
            this.Adapter.SelectCommand = this.CommandCollection[0];
            医院管理系统DataSet.Medicine_StoreDataTable dataTable = new 医院管理系统DataSet.Medicine_StoreDataTable();
            this.Adapter.Fill(dataTable);
            return dataTable;
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, false)]
        public virtual int 查询(医院管理系统DataSet.Medicine_StoreDataTable dataTable, string Name) {
            this.Adapter.SelectCommand = this.CommandCollection[1];
            if ((Name == null)) {
                throw new System.ArgumentNullException("Name");
            }
            else {
                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(Name));
            }
            if ((this.ClearBeforeFill == true)) {
                dataTable.Clear();
            }
            int returnValue = this.Adapter.Fill(dataTable);
            return returnValue;
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
        public virtual int Update(医院管理系统DataSet.Medicine_StoreDataTable dataTable) {
            return this.Adapter.Update(dataTable);
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
        public virtual int Update(医院管理系统DataSet dataSet) {
            return this.Adapter.Update(dataSet, "Medicine_Store");
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
        public virtual int Update(System.Data.DataRow dataRow) {
            return this.Adapter.Update(new System.Data.DataRow[] {
                        dataRow});
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
        public virtual int Update(System.Data.DataRow[] dataRows) {
            return this.Adapter.Update(dataRows);
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)]
        public virtual int Delete(string Original_Medicine_Code, string Original_Medicine_Name, double Original_Price, System.Nullable<int> Original_Store_Amount) {
            if ((Original_Medicine_Code == null)) {
                throw new System.ArgumentNullException("Original_Medicine_Code");
            }
            else {
                this.Adapter.DeleteCommand.Parameters[0].Value = ((string)(Original_Medicine_Code));
            }
            if ((Original_Medicine_Name == null)) {
                throw new System.ArgumentNullException("Original_Medicine_Name");
            }
            else {
                this.Adapter.DeleteCommand.Parameters[1].Value = ((string)(Original_Medicine_Name));
            }
            this.Adapter.DeleteCommand.Parameters[2].Value = ((double)(Original_Price));
            if ((Original_Store_Amount.HasValue == true)) {
                this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[4].Value = ((int)(Original_Store_Amount.Value));
            }
            else {
                this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[4].Value = System.DBNull.Value;
            }
            System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
            if (((this.Adapter.DeleteCommand.Connection.State & System.Data.ConnectionState.Open) 
                        != System.Data.ConnectionState.Open)) {
                this.Adapter.DeleteCommand.Connection.Open();
            }
            try {
                int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
                return returnValue;
            }
            finally {
                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
                    this.Adapter.DeleteCommand.Connection.Close();
                }
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
        public virtual int Insert(string Medicine_Code, string Medicine_Name, double Price, System.Nullable<int> Store_Amount) {
            if ((Medicine_Code == null)) {
                throw new System.ArgumentNullException("Medicine_Code");
            }
            else {
                this.Adapter.InsertCommand.Parameters[0].Value = ((string)(Medicine_Code));
            }
            if ((Medicine_Name == null)) {
                throw new System.ArgumentNullException("Medicine_Name");
            }
            else {
                this.Adapter.InsertCommand.Parameters[1].Value = ((string)(Medicine_Name));
            }
            this.Adapter.InsertCommand.Parameters[2].Value = ((double)(Price));
            if ((Store_Amount.HasValue == true)) {
                this.Adapter.InsertCommand.Parameters[3].Value = ((int)(Store_Amount.Value));
            }
            else {
                this.Adapter.InsertCommand.Parameters[3].Value = System.DBNull.Value;
            }
            System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
            if (((this.Adapter.InsertCommand.Connection.State & System.Data.ConnectionState.Open) 
                        != System.Data.ConnectionState.Open)) {
                this.Adapter.InsertCommand.Connection.Open();
            }
            try {
                int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
                return returnValue;
            }
            finally {
                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
                    this.Adapter.InsertCommand.Connection.Close();
                }
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
        public virtual int Update(string Medicine_Code, string Medicine_Name, double Price, System.Nullable<int> Store_Amount, string Original_Medicine_Code, string Original_Medicine_Name, double Original_Price, System.Nullable<int> Original_Store_Amount) {
            if ((Medicine_Code == null)) {
                throw new System.ArgumentNullException("Medicine_Code");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(Medicine_Code));
            }
            if ((Medicine_Name == null)) {
                throw new System.ArgumentNullException("Medicine_Name");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(Medicine_Name));
            }
            this.Adapter.UpdateCommand.Parameters[2].Value = ((double)(Price));
            if ((Store_Amount.HasValue == true)) {
                this.Adapter.UpdateCommand.Parameters[3].Value = ((int)(Store_Amount.Value));
            }
            else {
                this.Adapter.UpdateCommand.Parameters[3].Value = System.DBNull.Value;
            }
            if ((Original_Medicine_Code == null)) {
                throw new System.ArgumentNullException("Original_Medicine_Code");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(Original_Medicine_Code));
            }
            if ((Original_Medicine_Name == null)) {
                throw new System.ArgumentNullException("Original_Medicine_Name");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(Original_Medicine_Name));
            }
            this.Adapter.UpdateCommand.Parameters[6].Value = ((double)(Original_Price));
            if ((Original_Store_Amount.HasValue == true)) {
                this.Adapter.UpdateCommand.Parameters[7].Value = ((object)(0));
                this.Adapter.UpdateCommand.Parameters[8].Value = ((int)(Original_Store_Amount.Value));
            }
            else {
                this.Adapter.UpdateCommand.Parameters[7].Value = ((object)(1));
                this.Adapter.UpdateCommand.Parameters[8].Value = System.DBNull.Value;
            }
            System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
            if (((this.Adapter.UpdateCommand.Connection.State & System.Data.ConnectionState.Open) 
                        != System.Data.ConnectionState.Open)) {
                this.Adapter.UpdateCommand.Connection.Open();
            }
            try {
                int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
                return returnValue;
            }
            finally {
                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
                    this.Adapter.UpdateCommand.Connection.Close();
                }
            }
        }
    }
}

#pragma warning restore 1591

⌨️ 快捷键说明

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