コード例 #1
0
 /// <summary>
 /// 修改账户信息
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolStripEdit_Click(object sender, EventArgs e)
 {
     try
     {
         this.toolStripAdd.Enabled = false;
         this.toolStripDel.Enabled = false;
         string rowIndex = this.dataGridView_user.SelectedRows[0].Cells[0].Value.ToString();//获取当前所选行索引值
         if (rowIndex != string.Empty)
         {
             this.groupPanel1.Enabled   = true;
             this.toolStripSave.Enabled = true;
             string sql = "select h_UserName,h_yUserPwd,h_Status from HY_user where h_ID='" + rowIndex + "'";
             HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
             DataTable dt = new DataTable();
             dt = hy_help.ExecuteQuery(sql);
             this.h_UserName.Text = dt.Rows[0][0].ToString();
             this.h_UserPwd.Text  = dt.Rows[0][1].ToString();
             int st = int.Parse(dt.Rows[0][2].ToString());
             if (st > 0)
             {
                 this.h_Status.Checked = true;
             }
         }
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #2
0
        private void dgv_User()
        {
            string sql = "select h_ID,h_UserName,h_yUserPwd,h_Status,h_Department  from HY_user";

            HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
            this.dataGridView_user.AutoGenerateColumns = false;// 关闭自动创建列
            this.dataGridView_user.DataSource          = hy_help.ExecuteQuery(sql);
        }
コード例 #3
0
        private void lbHYList()
        {
            string sql = "select d_Name from HY_Department";

            HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
            this.lbHY.DataSource    = hy_help.ExecuteQuery(sql);
            this.lbHY.DisplayMember = "d_Name";
        }
コード例 #4
0
        /// <summary>
        /// 返回部门DataTable信息列表
        /// </summary>
        /// <returns></returns>
        public DataTable ExecuteQuery(string sql)
        {
            //string sql = "select * from HY_Department";
            HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
            DataTable ds = new DataTable();

            ds = hy_help.ExecuteQuery(sql);
            return(ds);
        }
コード例 #5
0
        /// <summary>
        /// 返回DataTable信息列表
        /// </summary>
        /// <returns></returns>
        public DataTable ExecuteQuery(string sql)
        {
            //string sql = "select * from HY_BomInfo order by b_ID desc";
            HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
            DataTable ds = new DataTable();

            ds = hy_help.ExecuteQuery(sql);
            return(ds);
        }
コード例 #6
0
        /// <summary>
        /// 返回仓库列表
        /// </summary>
        /// <returns></returns>
        public DataTable ExecuteQuery()
        {
            string sql = "select * from HY_Warehouse";

            HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
            DataTable ds = new DataTable();

            ds = hy_help.ExecuteQuery(sql);
            return(ds);
        }
コード例 #7
0
 /// <summary>
 /// 增删改BOM明细
 /// </summary>
 /// <param name="sql">SQL</param>
 /// <returns></returns>
 public int f_HYBomDetailslist(string sql)
 {
     try
     {
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #8
0
 /// <summary>
 /// 返回SqlDataReaderBOM表信息
 /// </summary>
 /// <returns></returns>
 public SqlDataReader f_Bomlist(string sql)
 {
     try
     {
         HY_DbSqlHelp.DBsqlHelp hysqlhelp = new DBsqlHelp();
         sdr = hysqlhelp.reder(sql);
         return(sdr);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #9
0
 /// <summary>
 /// 采购单增删改
 /// </summary>
 /// <param name="sql">SQL语句</param>
 /// <returns></returns>
 public int com_ExecuteQuery(string sql)
 {
     try
     {
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #10
0
 /// <summary>
 /// 增删该物料价格
 /// </summary>
 /// <param name="sql">SQL</param>
 /// <returns></returns>
 public int f_SupplierPrice(string sql)
 {
     try
     {
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #11
0
 /// <summary>
 /// 新增供应商信息
 /// </summary>
 /// <param name="model">供应商信息实体层</param>
 /// <returns></returns>
 public int com_Supplier(HY_Model.HY_Supplier model)
 {
     try
     {
         string sql = "insert into HY_Supplier(s_gyName,s_jName,s_Area,s_cpName,s_Name,s_Tel) values('" + model.S_gyName + "','" + model.S_jName + "','" + model.S_Area + "','" + model.S_cpName + "','" + model.S_name + "','" + model.S_tel + "')";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #12
0
 /// <summary>
 /// 返回选择后SqlDataReaderBOM表信息
 /// </summary>
 /// <returns></returns>
 public SqlDataReader f_HY_RequisitionsTOProcurement(string d_SKID)
 {
     try
     {
         string sql = "select b_ID,b_SKID,b_CID,b_CustomerID,b_SPerson,b_SDate from HY_BomInfo where b_SKID='" + d_SKID + "'";
         HY_DbSqlHelp.DBsqlHelp hysqlhelp = new DBsqlHelp();
         sdr = hysqlhelp.reder(sql);
         return(sdr);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #13
0
 /// <summary>
 /// 新增采购单信息
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int com_HY_Procurement(HY_Model.HY_Purchaseorder model)
 {
     try
     {
         string sql = "insert into HY_ProcurementInfo(c_DID,c_CID,c_Department,c_Person,c_Name,c_NameID,c_Supplier,c_Origin,c_QDate,c_XDate,c_Specifications,c_Units,c_Amount,c_Uses,c_Notes,c_Hot) values('" + model.C_DID + "','" + model.C_CID + "','" + model.C_Department + "','" + model.C_Person + "','" + model.C_Name + "','" + model.C_NameID + "','" + model.C_Supplier + "','" + model.C_Origin + "','" + model.C_QDate + "','" + model.C_XDate + "','" + model.C_Specifications + "','" + model.C_Units + "','" + model.C_Amount + "','" + model.C_Uses + "','" + model.C_Notes + "','" + model.C_Hot + "')";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #14
0
 /// <summary>
 ///删除部门
 /// </summary>
 /// <param name="model">部门实体类D_ID</param>
 /// <returns></returns>
 public int del_Department(HY_Model.HY_Department model)
 {
     try
     {
         string sql = "delete from HY_Department where d_ID='" + model.D_ID + "'";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #15
0
 /// <summary>
 ///  增删改
 /// </summary>
 /// <param name="sql">SQL</param>
 /// <returns></returns>
 public int com_DepartmentZSG(string sql)
 {
     try
     {
         //string sql = "insert into HY_Department(d_Name) values('" + model.D_Name + "')";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #16
0
 /// <summary>
 /// 新增BOM物料明细
 /// </summary>
 /// <param name="model">BOM物料明细MODEL实体类</param>
 /// <returns></returns>
 public int com_HY_BomDetailslist(HY_Model.HY_BomDetails model)
 {
     try
     {
         string sql = "insert into HY_BomDetails(d_SKID,d_CID,d_PID,d_PName,d_Model,d_Specifications,d_Amount,d_Heat,d_Notes,d_SPerson,d_ModClass) values('" + model.D_SKID + "','" + model.D_CID + "','" + model.D_PID + "','" + model.D_PName + "','" + model.D_Model + "','" + model.D_Specifications + "','" + model.D_Amount + "','" + model.D_Heat + "','" + model.D_Notes + "','" + model.D_SPerson + "','" + model.ModClass + "')";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #17
0
 /// <summary>
 /// 新增仓库
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int com_Warehouse(HY_Model.HY_Warehouse model)
 {
     try
     {
         string sql = "insert into HY_Warehouse(c_ckName) values('" + model.C_ckName + "')";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #18
0
 /// <summary>
 /// 新增物料价格信息
 /// </summary>
 /// <param name="model">物料信息实体层</param>
 /// <returns></returns>
 public int com_SupplierPrice(HY_Model.HY_SupplierPrice model)
 {
     try
     {
         string sql = "insert into HY_SupplierPrice(p_DID,p_PID,p_gyName,p_Date,p_PName,p_Price,p_Weight,p_Vray,p_SM,p_rPerson) values('" + model.P_DID + "','" + model.P_PID + "','" + model.P_gyName + "','" + model.P_Date + "','" + model.P_PName + "','" + model.P_Price + "','" + model.P_Weight + "','" + model.P_Vray + "','" + model.P_SM + "','" + model.P_rPerson + "')";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #19
0
 /// <summary>
 /// 返回SqlDataReader表信息
 /// </summary>
 /// <returns></returns>
 public SqlDataReader f_CustomerInfolist(string sql)
 {
     try
     {
         //string sql = "select b_ID,b_SKID,b_CID from HY_BomInfo order by b_ID desc";
         HY_DbSqlHelp.DBsqlHelp hysqlhelp = new DBsqlHelp();
         sdr = hysqlhelp.reder(sql);
         return(sdr);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #20
0
 /// <summary>
 /// 系统信息基础设置
 /// </summary>
 /// <param name="model">Information实体类</param>
 /// <param name="I_ID">ID值</param>
 /// <returns></returns>
 public int com_Information(HY_Model.HY_Information model, int I_ID)
 {
     try
     {
         string sql = "update HY_Information set I_CompanyName='" + model.S_Company + "',I_Range='" + model.S_Range + "',I_Address='" + model.S_Address + "' where I_ID='" + I_ID + "'";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #21
0
 /// <summary>
 /// 返回采购单列表
 /// </summary>
 /// <returns></returns>
 public DataTable ExecuteQuery(string sql)
 {
     try
     {
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         DataTable ds = new DataTable();
         ds = hy_help.ExecuteQuery(sql);
         return(ds);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #22
0
 /// <summary>
 /// 返DataSet数据集
 /// </summary>
 /// <returns></returns>
 public DataSet ExecuteQueryDataSet(string sql)
 {
     try
     {
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         DataSet ds = new DataSet();
         ds = hy_help.DataSetSearch(sql);
         return(ds);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #23
0
 /// <summary>
 ///删除仓库
 /// </summary>
 /// <param name="model">仓库实体类c_ID</param>
 /// <returns></returns>
 public int del_Warehouse(HY_Model.HY_Warehouse model)
 {
     try
     {
         string sql = "delete from HY_Warehouse where c_ID='" + model.C_ID + "'";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #24
0
 /// <summary>
 /// 增删改客户信息
 /// </summary>
 /// <param name="sql">SQL</param>
 /// <returns></returns>
 public int com_HY_CustomerInfo(string sql)
 {
     try
     {
         //string sql = "insert into HY_BomInfo(b_SKID,b_CID,b_CustomerID,b_No,b_Material,b_BomSize,b_Notes,b_Height,b_Tonnage,b_Name,b_SPerson,b_SDate) values('" + model.B_SKID + "','" + model.B_CID + "','" + model.B_CustomerID + "','" + model.B_No + "','" + model.B_Material + "','" + model.B_BomSize + "','" + model.B_Notes + "','" + model.B_Height + "','" + model.B_Tonnage + "','" + model.B_Name + "','" + model.B_SPerson + "','" + model.B_SDate + "')";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #25
0
 /// <summary>
 /// 新增请购单信息
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int com_RequisitionInfo(HY_Model.HY_RequisitionInfo model)
 {
     try
     {
         string sql = "insert into HY_RequisitionInfo(r_DID,r_CID,r_NameID,r_Department,r_Person,r_Name,r_Supplier,r_Origin,r_QDate,r_XDate,r_Specifications,r_Units,r_Amount,r_Uses,r_Notes,r_Hot) values('" + model.R_DID + "','" + model.R_CID + "','" + model.R_NameID + "','" + model.R_Department + "','" + model.R_Person + "','" + model.R_Name + "','" + model.R_Supplier + "','" + model.R_Origin + "','" + model.R_QDate + "','" + model.R_XDate + "','" + model.R_Specifications + "','" + model.R_Units + "','" + model.R_Amount + "','" + model.R_Uses + "','" + model.R_Notes + "','" + model.R_Hot + "')";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #26
0
 /// <summary>
 /// 增删改排程生产计划
 /// </summary>
 /// <param name="model">排程生产计划MODEL实体类</param>
 /// <returns></returns>
 public int com_HY_ProductionPlanninglist(string sql)
 {
     try
     {
         //string sql = "insert into HY_ProductionPlanning(p_DID,p_KID,p_CID,p_Engineering,p_Design) values('"+model.P_DID+"','"+model.P_KID+"','"+model.P_CID+"','"+model.P_Engineering+"','"+model.P_Design+"')";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         return(res);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #27
0
 /// <summary>
 /// 返回供应商信息列表
 /// </summary>
 /// <returns></returns>
 public DataTable back_Supplier()
 {
     try
     {
         DataTable dt  = new DataTable();
         string    sql = "select s_ID,s_gyName,s_jName from HY_Supplier";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         dt = hy_help.ExecuteQuery(sql);
         return(dt);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #28
0
 /// <summary>
 /// 返回供应商物料价格信息列表
 /// </summary>
 /// <returns></returns>
 public DataTable back_SupplierPrice()
 {
     try
     {
         DataTable dt  = new DataTable();
         string    sql = "select * from HY_SupplierPrice order by p_ID desc";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         dt = hy_help.ExecuteQuery(sql);
         return(dt);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }
コード例 #29
0
 /// <summary>
 /// 删除用户操作
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolStripDel_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("确认删除此账户", "删除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         string rowIndex = this.dataGridView_user.SelectedRows[0].Cells[0].Value.ToString();
         string sql      = "delete from HY_user where h_ID='" + rowIndex + "'";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         int res = hy_help.insertEx(sql);
         if (res > 0)
         {
             MessageBox.Show("删除成功!");
             dgv_User();
         }
     }
 }
コード例 #30
0
 /// <summary>
 /// 返回DataTable人员信息列表
 /// </summary>
 /// <returns></returns>
 public DataTable back_hyUserLiset()
 {
     try
     {
         DataTable dt  = new DataTable();
         string    sql = "select  * from HY_user";
         HY_DbSqlHelp.DBsqlHelp hy_help = new DBsqlHelp();
         dt = hy_help.ExecuteQuery(sql);
         return(dt);
     }
     catch (Exception EX)
     {
         throw EX;
     }
 }