示例#1
0
 private void ShowInfo(string BILLNO)
 {
     MyERP.BLL.ORDER_CG_MASTER   bll   = new MyERP.BLL.ORDER_CG_MASTER();
     MyERP.Model.ORDER_CG_MASTER model = bll.GetModel(BILLNO);
     this.txtMASTERID.Text        = model.MASTERID;
     this.lblBILLNO.Text          = model.BILLNO;
     this.txtMANUAL_BILLNO.Text   = model.MANUAL_BILLNO;
     this.txtCUSTOM_CODE.Text     = model.CUSTOM_CODE;
     this.txtCUSTOM_NAME.Text     = model.CUSTOM_NAME;
     this.txtFACTORY.Text         = model.FACTORY;
     this.txtBILL_TYPE.Text       = model.BILL_TYPE;
     this.txtBILL_DATE.Text       = model.BILL_DATE.ToString();
     this.txtBILL_STATUS.Text     = model.BILL_STATUS;
     this.txtSCYQ.Text            = model.SCYQ;
     this.txtBZTYPE.Text          = model.BZTYPE;
     this.txtSTOCK_CODE.Text      = model.STOCK_CODE;
     this.txtSTOCK_NAME.Text      = model.STOCK_NAME;
     this.txtDEPARTMENT_CODE.Text = model.DEPARTMENT_CODE;
     this.txtDEPARTMENT_NAME.Text = model.DEPARTMENT_NAME;
     this.txtCREATE_CODE.Text     = model.CREATE_CODE;
     this.txtCREATE_NAME.Text     = model.CREATE_NAME;
     this.txtCREATE_DATE.Text     = model.CREATE_DATE.ToString();
     this.txtREMARK.Text          = model.REMARK;
     this.txtREMARK1.Text         = model.REMARK1;
     this.txtREMARK2.Text         = model.REMARK2;
 }
示例#2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MyERP.Model.ORDER_CG_MASTER GetModel(string BILLNO)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 MASTERID,BILLNO,MANUAL_BILLNO,CUSTOM_CODE,CUSTOM_NAME,FACTORY,BILL_TYPE,BILL_DATE,BILL_STATUS,SCYQ,BZTYPE,STOCK_CODE,STOCK_NAME,DEPARTMENT_CODE,DEPARTMENT_NAME,CREATE_CODE,CREATE_NAME,CREATE_DATE,REMARK,REMARK1,REMARK2 from ORDER_CG_MASTER ");
            strSql.Append(" where BILLNO=@BILLNO ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@BILLNO", SqlDbType.VarChar, 50)
            };
            parameters[0].Value = BILLNO;

            MyERP.Model.ORDER_CG_MASTER model = new MyERP.Model.ORDER_CG_MASTER();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
示例#3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(MyERP.Model.ORDER_CG_MASTER model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into ORDER_CG_MASTER(");
            strSql.Append("MASTERID,BILLNO,MANUAL_BILLNO,CUSTOM_CODE,CUSTOM_NAME,FACTORY,BILL_TYPE,BILL_DATE,BILL_STATUS,SCYQ,BZTYPE,STOCK_CODE,STOCK_NAME,DEPARTMENT_CODE,DEPARTMENT_NAME,CREATE_CODE,CREATE_NAME,CREATE_DATE,REMARK,REMARK1,REMARK2)");
            strSql.Append(" values (");
            strSql.Append("@MASTERID,@BILLNO,@MANUAL_BILLNO,@CUSTOM_CODE,@CUSTOM_NAME,@FACTORY,@BILL_TYPE,@BILL_DATE,@BILL_STATUS,@SCYQ,@BZTYPE,@STOCK_CODE,@STOCK_NAME,@DEPARTMENT_CODE,@DEPARTMENT_NAME,@CREATE_CODE,@CREATE_NAME,@CREATE_DATE,@REMARK,@REMARK1,@REMARK2)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@MASTERID",        SqlDbType.VarChar,    50),
                new SqlParameter("@BILLNO",          SqlDbType.VarChar,    50),
                new SqlParameter("@MANUAL_BILLNO",   SqlDbType.VarChar,    50),
                new SqlParameter("@CUSTOM_CODE",     SqlDbType.VarChar,    50),
                new SqlParameter("@CUSTOM_NAME",     SqlDbType.VarChar,    50),
                new SqlParameter("@FACTORY",         SqlDbType.VarChar,    50),
                new SqlParameter("@BILL_TYPE",       SqlDbType.VarChar,    50),
                new SqlParameter("@BILL_DATE",       SqlDbType.DateTime),
                new SqlParameter("@BILL_STATUS",     SqlDbType.NVarChar,   10),
                new SqlParameter("@SCYQ",            SqlDbType.VarChar,   100),
                new SqlParameter("@BZTYPE",          SqlDbType.VarChar,   100),
                new SqlParameter("@STOCK_CODE",      SqlDbType.VarChar,    50),
                new SqlParameter("@STOCK_NAME",      SqlDbType.VarChar,    50),
                new SqlParameter("@DEPARTMENT_CODE", SqlDbType.VarChar,    50),
                new SqlParameter("@DEPARTMENT_NAME", SqlDbType.VarChar,    50),
                new SqlParameter("@CREATE_CODE",     SqlDbType.VarChar,    50),
                new SqlParameter("@CREATE_NAME",     SqlDbType.VarChar,    50),
                new SqlParameter("@CREATE_DATE",     SqlDbType.DateTime),
                new SqlParameter("@REMARK",          SqlDbType.VarChar,    50),
                new SqlParameter("@REMARK1",         SqlDbType.VarChar,    50),
                new SqlParameter("@REMARK2",         SqlDbType.VarChar, 50)
            };
            parameters[0].Value  = model.MASTERID;
            parameters[1].Value  = model.BILLNO;
            parameters[2].Value  = model.MANUAL_BILLNO;
            parameters[3].Value  = model.CUSTOM_CODE;
            parameters[4].Value  = model.CUSTOM_NAME;
            parameters[5].Value  = model.FACTORY;
            parameters[6].Value  = model.BILL_TYPE;
            parameters[7].Value  = model.BILL_DATE;
            parameters[8].Value  = model.BILL_STATUS;
            parameters[9].Value  = model.SCYQ;
            parameters[10].Value = model.BZTYPE;
            parameters[11].Value = model.STOCK_CODE;
            parameters[12].Value = model.STOCK_NAME;
            parameters[13].Value = model.DEPARTMENT_CODE;
            parameters[14].Value = model.DEPARTMENT_NAME;
            parameters[15].Value = model.CREATE_CODE;
            parameters[16].Value = model.CREATE_NAME;
            parameters[17].Value = model.CREATE_DATE;
            parameters[18].Value = model.REMARK;
            parameters[19].Value = model.REMARK1;
            parameters[20].Value = model.REMARK2;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#4
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public MyERP.Model.ORDER_CG_MASTER DataRowToModel(DataRow row)
 {
     MyERP.Model.ORDER_CG_MASTER model = new MyERP.Model.ORDER_CG_MASTER();
     if (row != null)
     {
         if (row["MASTERID"] != null)
         {
             model.MASTERID = row["MASTERID"].ToString();
         }
         if (row["BILLNO"] != null)
         {
             model.BILLNO = row["BILLNO"].ToString();
         }
         if (row["MANUAL_BILLNO"] != null)
         {
             model.MANUAL_BILLNO = row["MANUAL_BILLNO"].ToString();
         }
         if (row["CUSTOM_CODE"] != null)
         {
             model.CUSTOM_CODE = row["CUSTOM_CODE"].ToString();
         }
         if (row["CUSTOM_NAME"] != null)
         {
             model.CUSTOM_NAME = row["CUSTOM_NAME"].ToString();
         }
         if (row["FACTORY"] != null)
         {
             model.FACTORY = row["FACTORY"].ToString();
         }
         if (row["BILL_TYPE"] != null)
         {
             model.BILL_TYPE = row["BILL_TYPE"].ToString();
         }
         if (row["BILL_DATE"] != null && row["BILL_DATE"].ToString() != "")
         {
             model.BILL_DATE = DateTime.Parse(row["BILL_DATE"].ToString());
         }
         if (row["BILL_STATUS"] != null)
         {
             model.BILL_STATUS = row["BILL_STATUS"].ToString();
         }
         if (row["SCYQ"] != null)
         {
             model.SCYQ = row["SCYQ"].ToString();
         }
         if (row["BZTYPE"] != null)
         {
             model.BZTYPE = row["BZTYPE"].ToString();
         }
         if (row["STOCK_CODE"] != null)
         {
             model.STOCK_CODE = row["STOCK_CODE"].ToString();
         }
         if (row["STOCK_NAME"] != null)
         {
             model.STOCK_NAME = row["STOCK_NAME"].ToString();
         }
         if (row["DEPARTMENT_CODE"] != null)
         {
             model.DEPARTMENT_CODE = row["DEPARTMENT_CODE"].ToString();
         }
         if (row["DEPARTMENT_NAME"] != null)
         {
             model.DEPARTMENT_NAME = row["DEPARTMENT_NAME"].ToString();
         }
         if (row["CREATE_CODE"] != null)
         {
             model.CREATE_CODE = row["CREATE_CODE"].ToString();
         }
         if (row["CREATE_NAME"] != null)
         {
             model.CREATE_NAME = row["CREATE_NAME"].ToString();
         }
         if (row["CREATE_DATE"] != null && row["CREATE_DATE"].ToString() != "")
         {
             model.CREATE_DATE = DateTime.Parse(row["CREATE_DATE"].ToString());
         }
         if (row["REMARK"] != null)
         {
             model.REMARK = row["REMARK"].ToString();
         }
         if (row["REMARK1"] != null)
         {
             model.REMARK1 = row["REMARK1"].ToString();
         }
         if (row["REMARK2"] != null)
         {
             model.REMARK2 = row["REMARK2"].ToString();
         }
     }
     return(model);
 }
示例#5
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(MyERP.Model.ORDER_CG_MASTER model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ORDER_CG_MASTER set ");
            strSql.Append("MASTERID=@MASTERID,");
            strSql.Append("MANUAL_BILLNO=@MANUAL_BILLNO,");
            strSql.Append("CUSTOM_CODE=@CUSTOM_CODE,");
            strSql.Append("CUSTOM_NAME=@CUSTOM_NAME,");
            strSql.Append("FACTORY=@FACTORY,");
            strSql.Append("BILL_TYPE=@BILL_TYPE,");
            strSql.Append("BILL_DATE=@BILL_DATE,");
            strSql.Append("BILL_STATUS=@BILL_STATUS,");
            strSql.Append("SCYQ=@SCYQ,");
            strSql.Append("BZTYPE=@BZTYPE,");
            strSql.Append("STOCK_CODE=@STOCK_CODE,");
            strSql.Append("STOCK_NAME=@STOCK_NAME,");
            strSql.Append("DEPARTMENT_CODE=@DEPARTMENT_CODE,");
            strSql.Append("DEPARTMENT_NAME=@DEPARTMENT_NAME,");
            strSql.Append("CREATE_CODE=@CREATE_CODE,");
            strSql.Append("CREATE_NAME=@CREATE_NAME,");
            strSql.Append("CREATE_DATE=@CREATE_DATE,");
            strSql.Append("REMARK=@REMARK,");
            strSql.Append("REMARK1=@REMARK1,");
            strSql.Append("REMARK2=@REMARK2");
            strSql.Append(" where BILLNO=@BILLNO ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@MASTERID",        SqlDbType.VarChar,    50),
                new SqlParameter("@MANUAL_BILLNO",   SqlDbType.VarChar,    50),
                new SqlParameter("@CUSTOM_CODE",     SqlDbType.VarChar,    50),
                new SqlParameter("@CUSTOM_NAME",     SqlDbType.VarChar,    50),
                new SqlParameter("@FACTORY",         SqlDbType.VarChar,    50),
                new SqlParameter("@BILL_TYPE",       SqlDbType.VarChar,    50),
                new SqlParameter("@BILL_DATE",       SqlDbType.DateTime),
                new SqlParameter("@BILL_STATUS",     SqlDbType.NVarChar,   10),
                new SqlParameter("@SCYQ",            SqlDbType.VarChar,   100),
                new SqlParameter("@BZTYPE",          SqlDbType.VarChar,   100),
                new SqlParameter("@STOCK_CODE",      SqlDbType.VarChar,    50),
                new SqlParameter("@STOCK_NAME",      SqlDbType.VarChar,    50),
                new SqlParameter("@DEPARTMENT_CODE", SqlDbType.VarChar,    50),
                new SqlParameter("@DEPARTMENT_NAME", SqlDbType.VarChar,    50),
                new SqlParameter("@CREATE_CODE",     SqlDbType.VarChar,    50),
                new SqlParameter("@CREATE_NAME",     SqlDbType.VarChar,    50),
                new SqlParameter("@CREATE_DATE",     SqlDbType.DateTime),
                new SqlParameter("@REMARK",          SqlDbType.VarChar,    50),
                new SqlParameter("@REMARK1",         SqlDbType.VarChar,    50),
                new SqlParameter("@REMARK2",         SqlDbType.VarChar,    50),
                new SqlParameter("@BILLNO",          SqlDbType.VarChar, 50)
            };
            parameters[0].Value  = model.MASTERID;
            parameters[1].Value  = model.MANUAL_BILLNO;
            parameters[2].Value  = model.CUSTOM_CODE;
            parameters[3].Value  = model.CUSTOM_NAME;
            parameters[4].Value  = model.FACTORY;
            parameters[5].Value  = model.BILL_TYPE;
            parameters[6].Value  = model.BILL_DATE;
            parameters[7].Value  = model.BILL_STATUS;
            parameters[8].Value  = model.SCYQ;
            parameters[9].Value  = model.BZTYPE;
            parameters[10].Value = model.STOCK_CODE;
            parameters[11].Value = model.STOCK_NAME;
            parameters[12].Value = model.DEPARTMENT_CODE;
            parameters[13].Value = model.DEPARTMENT_NAME;
            parameters[14].Value = model.CREATE_CODE;
            parameters[15].Value = model.CREATE_NAME;
            parameters[16].Value = model.CREATE_DATE;
            parameters[17].Value = model.REMARK;
            parameters[18].Value = model.REMARK1;
            parameters[19].Value = model.REMARK2;
            parameters[20].Value = model.BILLNO;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#6
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtMASTERID.Text.Trim().Length == 0)
            {
                strErr += "MASTERID不能为空!\\n";
            }
            if (this.txtBILLNO.Text.Trim().Length == 0)
            {
                strErr += "BILLNO不能为空!\\n";
            }
            if (this.txtMANUAL_BILLNO.Text.Trim().Length == 0)
            {
                strErr += "MANUAL_BILLNO不能为空!\\n";
            }
            if (this.txtCUSTOM_CODE.Text.Trim().Length == 0)
            {
                strErr += "CUSTOM_CODE不能为空!\\n";
            }
            if (this.txtCUSTOM_NAME.Text.Trim().Length == 0)
            {
                strErr += "CUSTOM_NAME不能为空!\\n";
            }
            if (this.txtFACTORY.Text.Trim().Length == 0)
            {
                strErr += "FACTORY不能为空!\\n";
            }
            if (this.txtBILL_TYPE.Text.Trim().Length == 0)
            {
                strErr += "BILL_TYPE不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtBILL_DATE.Text))
            {
                strErr += "BILL_DATE格式错误!\\n";
            }
            if (this.txtBILL_STATUS.Text.Trim().Length == 0)
            {
                strErr += "BILL_STATUS不能为空!\\n";
            }
            if (this.txtSCYQ.Text.Trim().Length == 0)
            {
                strErr += "SCYQ不能为空!\\n";
            }
            if (this.txtBZTYPE.Text.Trim().Length == 0)
            {
                strErr += "BZTYPE不能为空!\\n";
            }
            if (this.txtSTOCK_CODE.Text.Trim().Length == 0)
            {
                strErr += "STOCK_CODE不能为空!\\n";
            }
            if (this.txtSTOCK_NAME.Text.Trim().Length == 0)
            {
                strErr += "STOCK_NAME不能为空!\\n";
            }
            if (this.txtDEPARTMENT_CODE.Text.Trim().Length == 0)
            {
                strErr += "DEPARTMENT_CODE不能为空!\\n";
            }
            if (this.txtDEPARTMENT_NAME.Text.Trim().Length == 0)
            {
                strErr += "DEPARTMENT_NAME不能为空!\\n";
            }
            if (this.txtCREATE_CODE.Text.Trim().Length == 0)
            {
                strErr += "CREATE_CODE不能为空!\\n";
            }
            if (this.txtCREATE_NAME.Text.Trim().Length == 0)
            {
                strErr += "CREATE_NAME不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtCREATE_DATE.Text))
            {
                strErr += "CREATE_DATE格式错误!\\n";
            }
            if (this.txtREMARK.Text.Trim().Length == 0)
            {
                strErr += "REMARK不能为空!\\n";
            }
            if (this.txtREMARK1.Text.Trim().Length == 0)
            {
                strErr += "REMARK1不能为空!\\n";
            }
            if (this.txtREMARK2.Text.Trim().Length == 0)
            {
                strErr += "REMARK2不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string   MASTERID        = this.txtMASTERID.Text;
            string   BILLNO          = this.txtBILLNO.Text;
            string   MANUAL_BILLNO   = this.txtMANUAL_BILLNO.Text;
            string   CUSTOM_CODE     = this.txtCUSTOM_CODE.Text;
            string   CUSTOM_NAME     = this.txtCUSTOM_NAME.Text;
            string   FACTORY         = this.txtFACTORY.Text;
            string   BILL_TYPE       = this.txtBILL_TYPE.Text;
            DateTime BILL_DATE       = DateTime.Parse(this.txtBILL_DATE.Text);
            string   BILL_STATUS     = this.txtBILL_STATUS.Text;
            string   SCYQ            = this.txtSCYQ.Text;
            string   BZTYPE          = this.txtBZTYPE.Text;
            string   STOCK_CODE      = this.txtSTOCK_CODE.Text;
            string   STOCK_NAME      = this.txtSTOCK_NAME.Text;
            string   DEPARTMENT_CODE = this.txtDEPARTMENT_CODE.Text;
            string   DEPARTMENT_NAME = this.txtDEPARTMENT_NAME.Text;
            string   CREATE_CODE     = this.txtCREATE_CODE.Text;
            string   CREATE_NAME     = this.txtCREATE_NAME.Text;
            DateTime CREATE_DATE     = DateTime.Parse(this.txtCREATE_DATE.Text);
            string   REMARK          = this.txtREMARK.Text;
            string   REMARK1         = this.txtREMARK1.Text;
            string   REMARK2         = this.txtREMARK2.Text;

            MyERP.Model.ORDER_CG_MASTER model = new MyERP.Model.ORDER_CG_MASTER();
            model.MASTERID        = MASTERID;
            model.BILLNO          = BILLNO;
            model.MANUAL_BILLNO   = MANUAL_BILLNO;
            model.CUSTOM_CODE     = CUSTOM_CODE;
            model.CUSTOM_NAME     = CUSTOM_NAME;
            model.FACTORY         = FACTORY;
            model.BILL_TYPE       = BILL_TYPE;
            model.BILL_DATE       = BILL_DATE;
            model.BILL_STATUS     = BILL_STATUS;
            model.SCYQ            = SCYQ;
            model.BZTYPE          = BZTYPE;
            model.STOCK_CODE      = STOCK_CODE;
            model.STOCK_NAME      = STOCK_NAME;
            model.DEPARTMENT_CODE = DEPARTMENT_CODE;
            model.DEPARTMENT_NAME = DEPARTMENT_NAME;
            model.CREATE_CODE     = CREATE_CODE;
            model.CREATE_NAME     = CREATE_NAME;
            model.CREATE_DATE     = CREATE_DATE;
            model.REMARK          = REMARK;
            model.REMARK1         = REMARK1;
            model.REMARK2         = REMARK2;

            MyERP.BLL.ORDER_CG_MASTER bll = new MyERP.BLL.ORDER_CG_MASTER();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }