예제 #1
0
        /// <summary>
        /// 根据规格书编号查询相关信息
        /// </summary>
        /// <param name="modelgt"></param>
        /// <param name="ghs"></param>
        private void SelectSpec(Maticsoft.Model.tsuhan_sg_gt modelgt, string ghs)
        {
            //Maticsoft.Model.tsuhan_spec spec1 = sp.GetModel(ghs);
            Maticsoft.Model.tsuhan_spec spec = specbll.GetModel(ghs);
            if (modelgt.规格书编号 == spec.规格书)
            {
                this.txtCPBM.Text  = spec.成品编码;
                this.txtCPXH.Text  = spec.产品型号;
                this.tbKHDM.Text   = spec.客户代码;
                this.tbLDKINK.Text = Convert.ToString(spec.Pkinkmin);
                this.tbPTKINK.Text = Convert.ToString(spec.Kimomin);


                this.tbCSTJ.Text     = spec.码型;
                this.tbCSPL.Text     = Convert.ToString(spec.速率);
                this.tbLMDtype.Text  = spec.PT方法;
                this.tbLMDvalue.Text = Convert.ToString(spec.Sen);

                this.tbICCmin.Text  = Convert.ToString(spec.Iccmin);
                this.tbICCmax.Text  = Convert.ToString(spec.Iccmax);
                this.tbIf.Text      = Convert.ToString(spec.LD方法);
                this.tbCCGLmin.Text = Convert.ToString(spec.Pomin);
                this.tbCCGLmax.Text = Convert.ToString(spec.Pomax);
                this.tbIMOmin.Text  = Convert.ToString(spec.Imomin);
                this.tbIMOmax.Text  = Convert.ToString(spec.Imomax);
                this.tbITHmin.Text  = Convert.ToString(spec.Ithmin);
                this.tbITHmax.Text  = Convert.ToString(spec.Ithmax);
                this.tbVFmin.Text   = Convert.ToString(spec.Vfmin);
                this.tbVFmax.Text   = Convert.ToString(spec.Vfmax);
                this.tbPTSL.Text    = Convert.ToString(spec.速率);
                this.tbVBRmin.Text  = Convert.ToString(spec.Vbrmin);
                this.tbVBRmax.Text  = Convert.ToString(spec.Vbrmax);
            }
        }
예제 #2
0
        /// <summary>
        /// 查询单条记录
        /// </summary>
        /// <param name="备货单号"></param>
        /// <returns></returns>
        public tsuhan_sg_gt GetModel(string 备货单号)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 id,备货单号,交货日期,下单日期,表格编号,合同编号,规格书编号,产品名称,备货单数量,随工卡数量,产品图号,产品类型,成品编码,BK_A,BK_B,BK_C,LD_LDjj,GX_hjfs,OH_hqPomin,OH_hqPomax,OH_hqBFB,OH_hhPomin,OH_hhPomax,OH_hhBFB,DM_dmzl,PT_rqgl,PT_gdlmin,PT_gdlmax,GDW_xhcs,LD_CSPomin,LD_CSPomax,LD_CSBFB,LD_LDKINK,LD_PDKINK,PT_CStj,PT_CSpl,PT_LMd,PT_LMd2,PT_ICCmin,PT_ICCmax,BZ_QJbq,GD_if,GD_ccglMin,GD_ccglMax,GD_imoMin,GD_imoMax,GD_ithMin,GD_ithMax,GD_vfMin,GD_vfMax,GD_ptsl,GD_vbrMin,GD_vbrMax,JX_wdMin,JX_wdMax,JX_zz,JX_pthigh,JX_ptwwj,JX_ldgj,JX_ptgj,fh产品名称,Description,物料代码,型号属性,Specification,客户型号,LD芯片型号,PT芯片型号,Quantity1,Quantity2,数量,计划编制,技术审核,生产审核,录入员,录入时间,客户代码,生产日期 from tsuhan_sg_gt");
            strSql.Append(" where 备货单号=@备货单号 ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@备货单号", SqlDbType.NVarChar, 30)
            };
            parameters[0].Value = 备货单号;

            Maticsoft.Model.tsuhan_sg_gt model = new Maticsoft.Model.tsuhan_sg_gt();
            DataSet ds = dbhelper.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>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCHANGE_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("确定要修改吗???","提示",MessageBoxButtons.YesNo);
            if (dr == DialogResult.Yes)
            {
                if (tbsgdxh1.Text.Trim() != "")
                {

                    Maticsoft.Model.tsuhan_sg_gt mogt = new Maticsoft.Model.tsuhan_sg_gt();
                    var bhd = this.tbBHDH.Text;
                    var gt = gtbll.GetModel(bhd);
                    mogt.id = gt.id;
                    mogt.合同编号 = this.tbHTBH.Text;
                    mogt.备货单号 = this.tbBHDH.Text;
                    if (this.tbBHDSL.Text=="")
                    {
                        this.tbBHDSL.Text = "0";
                    }
                    mogt.备货单数量 = Convert.ToInt32(this.tbBHDSL.Text);
                    mogt.表格编号 = this.tbBGBH1.Text + "-" + this.tbBGBH2.Text;
                    mogt.产品名称 = this.cbCPMC.Text;
                    mogt.产品类型 = this.txtCPXH.Text;
                    mogt.成品编码 = this.txtCPBM.Text;
                    mogt.产品图号 = this.cbCPTH.Text;
                    mogt.客户代码 = this.tbKHDM.Text;
                    mogt.规格书编号 = this.cbGGSBH.Text;
                    mogt.计划编制 = this.tbJHBZ.Text;
                    mogt.技术审核 = this.tbJSSH.Text;
                    mogt.生产审核 = this.tbSCSH.Text;
                    mogt.交货日期 = Convert.ToDateTime(this.dTPjh.Text);
                    mogt.下单日期 = Convert.ToDateTime(this.dTPxd.Text);
                    mogt.录入时间 = Convert.ToDateTime(this.tsslLRTIMEtxt.Text);
                    mogt.录入员 = this.tsslLRYtxt.Text;
                    mogt.BK_A = this.tbAM.Text;
                    mogt.BK_B = this.tbBM.Text;
                    #region
                    if (this.tbCM2.Text == "")
                    {
                        this.tbCM2.Text = "0000";
                    }
                    mogt.BK_C = this.tbCM1.Text + "-" + this.tbCM2.Text;
                    if (this.tbSGKSL.Text == "")
                    {
                        mogt.随工卡数量 = null;
                    }
                    else
                    {
                        mogt.随工卡数量 = Convert.ToInt32(this.tbSGKSL.Text);
                    }

                    if (this.tbJJ.Text == "")
                    {
                        mogt.LD_LDjj = null;
                    }
                    else
                    {
                        mogt.LD_LDjj = Convert.ToDecimal(this.tbJJ.Text);
                    }
                    if (this.tbHQGLmin.Text == "")
                    {
                        mogt.GDW_xhcs = null;
                    }
                    else
                    {
                        mogt.GDW_xhcs = Convert.ToInt32(this.tbXHCS.Text);
                    }
                    if (this.tbHQGLmin.Text == "")
                    {
                        mogt.OH_hqPomin = null;
                    }
                    else
                    {
                        mogt.OH_hqPomin = Convert.ToDecimal(this.tbHQGLmin.Text);
                    }
                    if (this.tbHQGLmax.Text == "")
                    {
                        mogt.OH_hqPomax = null;
                    }
                    else
                    {
                        mogt.OH_hqPomax = Convert.ToDecimal(this.tbHQGLmax.Text);
                    }

                    if (this.tbHHGLmin.Text == "")
                    {
                        mogt.OH_hhPomin = null;
                    }
                    else
                    {
                        mogt.OH_hhPomin = Convert.ToDecimal(this.tbHHGLmin.Text);
                    }

                    if (this.tbHHGLmax.Text == "")
                    {
                        mogt.OH_hhPomax = null;
                    }
                    else
                    {
                        mogt.OH_hhPomax = Convert.ToDecimal(this.tbHHGLmax.Text);
                    }

                    if (this.tbRXGL.Text == "")
                    {
                        mogt.PT_rqgl = null;
                    }
                    else
                    {
                        mogt.PT_rqgl = Convert.ToInt32(this.tbRXGL.Text);
                    }

                    if (this.tbGDLmin.Text == "")
                    {
                        mogt.PT_gdlmin = null;
                    }
                    else
                    {
                        mogt.PT_gdlmin =this.tbGDLmin.Text;
                    }

                    if (this.tbGDLmax.Text == "")
                    {
                        mogt.PT_gdlmax = null;
                    }
                    else
                    {
                        mogt.PT_gdlmax = this.tbGDLmax.Text;
                    }

                    if (this.tbHQPo.Text == "")
                    {
                        mogt.OH_hqBFB = null;
                    }
                    else if (Convert.ToInt32(this.tbHQPo.Text.Trim()) > 100)
                    {
                        MessageBox.Show("输入的" + lblHQ.Text + "不能大于100", "提示");
                        return;
                    }
                    else if (Convert.ToInt32(this.tbHQPo.Text.Trim()) < 0)
                    {
                        MessageBox.Show("输入的" + lblHQ.Text + "不能小于0", "提示");
                        return;
                    }
                    else
                    {
                        mogt.OH_hqBFB = Convert.ToInt32(this.tbHQPo.Text);
                    }

                    if (this.tbHHPo.Text == "")
                    {
                        mogt.OH_hhBFB = null;
                    }
                    else if (Convert.ToInt32(this.tbHHPo.Text.Trim()) > 100)
                    {
                        MessageBox.Show("输入的" + lblHH.Text + "不能大于100", "提示");
                        return;
                    }
                    else if (Convert.ToInt32(this.tbHHPo.Text.Trim()) < 0)
                    {
                        MessageBox.Show("输入的" + lblHH.Text + "不能小于0", "提示");
                        return;
                    }
                    else
                    {
                        mogt.OH_hhBFB = Convert.ToInt32(this.tbHHPo.Text);
                    }

                    if (this.tbCSPo.Text == "")
                    {
                        mogt.LD_CSBFB = null;
                    }
                    else if (Convert.ToInt32(this.tbCSPo.Text.Trim()) > 100)
                    {
                        MessageBox.Show("输入的" + lblCS.Text + "不能大于100", "提示");
                        return;
                    }
                    else if (Convert.ToInt32(this.tbCSPo.Text.Trim()) < 0)
                    {
                        MessageBox.Show("输入的" + lblCS.Text + "不能小于0", "提示");
                        return;
                    }
                    else
                    {
                        mogt.LD_CSBFB = Convert.ToInt32(this.tbCSPo.Text);
                    }

                    if (this.tbCSWDmin.Text == "")
                    {
                        mogt.JX_wdMin = null;
                    }
                    else
                    {
                        mogt.JX_wdMin = Convert.ToInt32(this.tbCSWDmin.Text);
                    }
                    if (this.tbCSWDmax.Text == "")
                    {
                        mogt.JX_wdMax = null;
                    }
                    else
                    {
                        mogt.JX_wdMax = Convert.ToInt32(this.tbCSWDmax.Text);
                    }
                    #endregion
                    mogt.GX_hjfs = this.tbHJFS.Text;
                    mogt.DM_dmzl = this.tbDMZL.Text;

                    mogt.JX_ptwwj = this.tbPTWWJ.Text;
                    mogt.JX_zz = this.tbZZFX.Text;
                    mogt.JX_pthigh = this.tbPTGD.Text;
                    mogt.JX_ptgj = this.tbPTtype.Text;
                    mogt.JX_ldgj = this.tbLDtype.Text;
                    mogt.BZ_QJbq = this.cbQJBQ.Text;
                    if (this.tbLDKINK.Text == "")
                    {
                        this.tbLDKINK.Text = "0";
                    }
                    if (this.tbPTKINK.Text == "")
                    {
                        this.tbPTKINK.Text = "0";
                    }
                    if (this.tbICCmin.Text == "")
                    {
                        this.tbICCmin.Text = "0";
                    }
                    if (this.tbICCmax.Text == "")
                    {
                        this.tbICCmax.Text = "0";
                    }
                    if (this.tbIMOmin.Text == "")
                    {
                        this.tbIMOmin.Text = "0";
                    }
                    if (this.tbIMOmax.Text == "")
                    {
                        this.tbIMOmax.Text = "0";
                    }
                    if (this.tbCCGLmin.Text == "")
                    {
                        this.tbCCGLmin.Text = "0";
                    }
                    if (this.tbCCGLmax.Text == "")
                    {
                        this.tbCCGLmax.Text = "0";
                    }
                    if (this.tbITHmin.Text == "")
                    {
                        this.tbITHmin.Text = "0";
                    }
                    if (this.tbITHmax.Text == "")
                    {
                        this.tbITHmax.Text = "0";
                    }
                    if (this.tbVFmin.Text == "")
                    {
                        this.tbVFmin.Text = "0";
                    }
                    if (this.tbVFmax.Text == "")
                    {
                        this.tbVFmax.Text = "0";
                    }
                    if (this.tbVBRmin.Text == "")
                    {
                        this.tbVBRmin.Text = "0";
                    }
                    if (this.tbVBRmax.Text == "")
                    {
                        this.tbVBRmax.Text = "0";
                    }
                    if (this.tbCSmin.Text == "")
                    {
                        this.tbCSmin.Text = "0";
                    }
                    if (this.tbCSmax.Text == "")
                    {
                        this.tbCSmax.Text = "0";
                    }
                    mogt.LD_CSPomin = Convert.ToDecimal(this.tbCSmin.Text);
                    mogt.LD_CSPomax = Convert.ToDecimal(this.tbCSmax.Text);
                    mogt.LD_LDKINK = Convert.ToInt32(this.tbLDKINK.Text);
                    mogt.LD_PDKINK = Convert.ToInt32(this.tbPTKINK.Text);
                    mogt.GD_if = this.tbIf.Text;
                    mogt.PT_ICCmin = Convert.ToInt32(this.tbICCmin.Text);
                    mogt.PT_ICCmax = Convert.ToInt32(this.tbICCmax.Text);
                    mogt.GD_imoMin = Convert.ToInt32(this.tbIMOmin.Text);
                    mogt.GD_imoMax = Convert.ToInt32(this.tbIMOmax.Text);
                    mogt.GD_ccglMin = Convert.ToDecimal(this.tbCCGLmin.Text);
                    mogt.GD_ccglMax = Convert.ToDecimal(this.tbCCGLmax.Text);
                    mogt.GD_ithMin = Convert.ToInt32(this.tbITHmin.Text);
                    mogt.GD_ithMax = Convert.ToInt32(this.tbITHmax.Text);
                    mogt.GD_vfMin = Convert.ToDecimal(this.tbVFmin.Text);
                    mogt.GD_vfMax = Convert.ToDecimal(this.tbVFmax.Text);
                    mogt.GD_ptsl = this.tbPTSL.Text;
                    mogt.GD_vbrMin = Convert.ToInt32(this.tbVBRmin.Text);
                    mogt.GD_vbrMax = Convert.ToInt32(this.tbVBRmax.Text);
                    mogt.fh产品名称 = this.rtbCPMC.Text;
                    mogt.Description = this.tbDESCEIP.Text;
                    mogt.物料代码 = this.cbWLDM.Text;
                    mogt.型号属性 = this.cbXHSX.Text;
                    mogt.Specification = this.cbSPEC.Text;
                    mogt.客户型号 = this.cbKHXH.Text;
                    mogt.LD芯片型号 = this.cbLDCHIPXH.Text;
                    mogt.PT芯片型号 = this.cbPTCHIPXH.Text;
                    mogt.生产日期 = Convert.ToDateTime(this.textBox1.Text);
                    mogt.Quantity1 = this.tbQUA_PO.Text;
                    mogt.Quantity2 = this.tbQUA_SEN.Text;
                    mogt.数量 = this.tbSL.Text;

                    bool result = false;

                    try
                    {
                        result = gtbll.Update(mogt);

                    }
                    catch (Exception ex)
                    {

                        MessageBox.Show(ex.Message);
                        return;
                    }
                    if (result == true)
                    {
                        MessageBox.Show("修改成功", "提示");
                    }
                    else
                    {
                        MessageBox.Show("修改失败", "提示");
                    }

                }
            }
            else if (dr==DialogResult.No)
            {
                return;
            }
        }
예제 #4
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public tsuhan_sg_gt DataRowToModel(DataRow row)
 {
     Maticsoft.Model.tsuhan_sg_gt model = new Maticsoft.Model.tsuhan_sg_gt();
     if (row != null)
     {
         if (row["id"] != null && row["id"].ToString() != "")
         {
             model.id = int.Parse(row["id"].ToString());
         }
         if (row["备货单号"] != null)
         {
             model.备货单号 = row["备货单号"].ToString();
         }
         if (row["交货日期"] != null && row["交货日期"].ToString() != "")
         {
             model.交货日期 = DateTime.Parse(row["交货日期"].ToString());
         }
         if (row["下单日期"] != null && row["下单日期"].ToString() != "")
         {
             model.单日期 = DateTime.Parse(row["下单日期"].ToString());
         }
         if (row["表格编号"] != null)
         {
             model.表格编号 = row["表格编号"].ToString();
         }
         if (row["合同编号"] != null)
         {
             model.合同编号 = row["合同编号"].ToString();
         }
         if (row["规格书编号"] != null)
         {
             model.规格书编号 = row["规格书编号"].ToString();
         }
         if (row["产品名称"] != null)
         {
             model.产品名称 = row["产品名称"].ToString();
         }
         if (row["备货单数量"] != null && row["备货单数量"].ToString() != "")
         {
             model.备货单数量 = int.Parse(row["备货单数量"].ToString());
         }
         if (row["随工卡数量"] != null && row["随工卡数量"].ToString() != "")
         {
             model.随工卡数量 = int.Parse(row["随工卡数量"].ToString());
         }
         if (row["产品图号"] != null)
         {
             model.产品图号 = row["产品图号"].ToString();
         }
         if (row["产品类型"] != null)
         {
             model.产品类型 = row["产品类型"].ToString();
         }
         if (row["成品编码"] != null)
         {
             model.成品编码 = row["成品编码"].ToString();
         }
         if (row["BK_A"] != null)
         {
             model.BK_A = row["BK_A"].ToString();
         }
         if (row["BK_B"] != null)
         {
             model.BK_B = row["BK_B"].ToString();
         }
         if (row["BK_C"] != null)
         {
             model.BK_C = row["BK_C"].ToString();
         }
         if (row["LD_LDjj"] != null && row["LD_LDjj"].ToString() != "")
         {
             model.LD_LDjj = decimal.Parse(row["LD_LDjj"].ToString());
         }
         if (row["GX_hjfs"] != null)
         {
             model.GX_hjfs = row["GX_hjfs"].ToString();
         }
         if (row["OH_hqPomin"] != null && row["OH_hqPomin"].ToString() != "")
         {
             model.OH_hqPomin = decimal.Parse(row["OH_hqPomin"].ToString());
         }
         if (row["OH_hqPomax"] != null && row["OH_hqPomax"].ToString() != "")
         {
             model.OH_hqPomax = decimal.Parse(row["OH_hqPomax"].ToString());
         }
         if (row["OH_hqBFB"] != null && row["OH_hqBFB"].ToString() != "")
         {
             model.OH_hqBFB = int.Parse(row["OH_hqBFB"].ToString());
         }
         if (row["OH_hhPomin"] != null && row["OH_hhPomin"].ToString() != "")
         {
             model.OH_hhPomin = decimal.Parse(row["OH_hhPomin"].ToString());
         }
         if (row["OH_hhPomax"] != null && row["OH_hhPomax"].ToString() != "")
         {
             model.OH_hhPomax = decimal.Parse(row["OH_hhPomax"].ToString());
         }
         if (row["OH_hhBFB"] != null && row["OH_hhBFB"].ToString() != "")
         {
             model.OH_hhBFB = int.Parse(row["OH_hhBFB"].ToString());
         }
         if (row["DM_dmzl"] != null)
         {
             model.DM_dmzl = row["DM_dmzl"].ToString();
         }
         if (row["PT_rqgl"] != null && row["PT_rqgl"].ToString() != "")
         {
             model.PT_rqgl = int.Parse(row["PT_rqgl"].ToString());
         }
         if (row["PT_gdlmin"] != null)
         {
             model.PT_gdlmin = row["PT_gdlmin"].ToString();
         }
         if (row["PT_gdlmax"] != null)
         {
             model.PT_gdlmax = row["PT_gdlmax"].ToString();
         }
         if (row["GDW_xhcs"] != null && row["GDW_xhcs"].ToString() != "")
         {
             model.GDW_xhcs = int.Parse(row["GDW_xhcs"].ToString());
         }
         if (row["LD_CSPomin"] != null && row["LD_CSPomin"].ToString() != "")
         {
             model.LD_CSPomin = decimal.Parse(row["LD_CSPomin"].ToString());
         }
         if (row["LD_CSPomax"] != null && row["LD_CSPomax"].ToString() != "")
         {
             model.LD_CSPomax = decimal.Parse(row["LD_CSPomax"].ToString());
         }
         if (row["LD_CSBFB"] != null && row["LD_CSBFB"].ToString() != "")
         {
             model.LD_CSBFB = int.Parse(row["LD_CSBFB"].ToString());
         }
         if (row["LD_LDKINK"] != null && row["LD_LDKINK"].ToString() != "")
         {
             model.LD_LDKINK = int.Parse(row["LD_LDKINK"].ToString());
         }
         if (row["LD_PDKINK"] != null && row["LD_PDKINK"].ToString() != "")
         {
             model.LD_PDKINK = int.Parse(row["LD_PDKINK"].ToString());
         }
         if (row["PT_CStj"] != null)
         {
             model.PT_CStj = row["PT_CStj"].ToString();
         }
         if (row["PT_CSpl"] != null && row["PT_CSpl"].ToString() != "")
         {
             model.PT_CSpl = decimal.Parse(row["PT_CSpl"].ToString());
         }
         if (row["PT_LMd"] != null)
         {
             model.PT_LMd = row["PT_LMd"].ToString();
         }
         if (row["PT_LMd2"] != null)
         {
             model.PT_LMd2 = row["PT_LMd2"].ToString();
         }
         if (row["PT_ICCmin"] != null && row["PT_ICCmin"].ToString() != "")
         {
             model.PT_ICCmin = int.Parse(row["PT_ICCmin"].ToString());
         }
         if (row["PT_ICCmax"] != null && row["PT_ICCmax"].ToString() != "")
         {
             model.PT_ICCmax = int.Parse(row["PT_ICCmax"].ToString());
         }
         if (row["BZ_QJbq"] != null)
         {
             model.BZ_QJbq = row["BZ_QJbq"].ToString();
         }
         if (row["GD_if"] != null)
         {
             model.GD_if = row["GD_if"].ToString();
         }
         if (row["GD_ccglMin"] != null && row["GD_ccglMin"].ToString() != "")
         {
             model.GD_ccglMin = decimal.Parse(row["GD_ccglMin"].ToString());
         }
         if (row["GD_ccglMax"] != null && row["GD_ccglMax"].ToString() != "")
         {
             model.GD_ccglMax = decimal.Parse(row["GD_ccglMax"].ToString());
         }
         if (row["GD_imoMin"] != null && row["GD_imoMin"].ToString() != "")
         {
             model.GD_imoMin = int.Parse(row["GD_imoMin"].ToString());
         }
         if (row["GD_imoMax"] != null && row["GD_imoMax"].ToString() != "")
         {
             model.GD_imoMax = int.Parse(row["GD_imoMax"].ToString());
         }
         if (row["GD_ithMin"] != null && row["GD_ithMin"].ToString() != "")
         {
             model.GD_ithMin = int.Parse(row["GD_ithMin"].ToString());
         }
         if (row["GD_ithMax"] != null && row["GD_ithMax"].ToString() != "")
         {
             model.GD_ithMax = int.Parse(row["GD_ithMax"].ToString());
         }
         if (row["GD_vfMin"] != null && row["GD_vfMin"].ToString() != "")
         {
             model.GD_vfMin = decimal.Parse(row["GD_vfMin"].ToString());
         }
         if (row["GD_vfMax"] != null && row["GD_vfMax"].ToString() != "")
         {
             model.GD_vfMax = decimal.Parse(row["GD_vfMax"].ToString());
         }
         if (row["GD_ptsl"] != null)
         {
             model.GD_ptsl = row["GD_ptsl"].ToString();
         }
         if (row["GD_vbrMin"] != null && row["GD_vbrMin"].ToString() != "")
         {
             model.GD_vbrMin = int.Parse(row["GD_vbrMin"].ToString());
         }
         if (row["GD_vbrMax"] != null && row["GD_vbrMax"].ToString() != "")
         {
             model.GD_vbrMax = int.Parse(row["GD_vbrMax"].ToString());
         }
         if (row["JX_wdMin"] != null && row["JX_wdMin"].ToString() != "")
         {
             model.JX_wdMin = int.Parse(row["JX_wdMin"].ToString());
         }
         if (row["JX_wdMax"] != null && row["JX_wdMax"].ToString() != "")
         {
             model.JX_wdMax = int.Parse(row["JX_wdMax"].ToString());
         }
         if (row["JX_zz"] != null)
         {
             model.JX_zz = row["JX_zz"].ToString();
         }
         if (row["JX_pthigh"] != null)
         {
             model.JX_pthigh = row["JX_pthigh"].ToString();
         }
         if (row["JX_ptwwj"] != null)
         {
             model.JX_ptwwj = row["JX_ptwwj"].ToString();
         }
         if (row["JX_ldgj"] != null)
         {
             model.JX_ldgj = row["JX_ldgj"].ToString();
         }
         if (row["JX_ptgj"] != null)
         {
             model.JX_ptgj = row["JX_ptgj"].ToString();
         }
         if (row["fh产品名称"] != null)
         {
             model.fh产品名称 = row["fh产品名称"].ToString();
         }
         if (row["Description"] != null)
         {
             model.Description = row["Description"].ToString();
         }
         if (row["物料代码"] != null)
         {
             model.物料代码 = row["物料代码"].ToString();
         }
         if (row["型号属性"] != null)
         {
             model.型号属性 = row["型号属性"].ToString();
         }
         if (row["Specification"] != null)
         {
             model.Specification = row["Specification"].ToString();
         }
         if (row["客户型号"] != null)
         {
             model.客户型号 = row["客户型号"].ToString();
         }
         if (row["LD芯片型号"] != null)
         {
             model.LD芯片型号 = row["LD芯片型号"].ToString();
         }
         if (row["PT芯片型号"] != null)
         {
             model.PT芯片型号 = row["PT芯片型号"].ToString();
         }
         if (row["Quantity1"] != null)
         {
             model.Quantity1 = row["Quantity1"].ToString();
         }
         if (row["Quantity2"] != null)
         {
             model.Quantity2 = row["Quantity2"].ToString();
         }
         if (row["数量"] != null)
         {
             model.数量 = row["数量"].ToString();
         }
         if (row["计划编制"] != null)
         {
             model.计划编制 = row["计划编制"].ToString();
         }
         if (row["技术审核"] != null)
         {
             model.技术审核 = row["技术审核"].ToString();
         }
         if (row["生产审核"] != null)
         {
             model.生产审核 = row["生产审核"].ToString();
         }
         if (row["录入员"] != null)
         {
             model.录入员 = row["录入员"].ToString();
         }
         if (row["录入时间"] != null && row["录入时间"].ToString() != "")
         {
             model.录入时间 = DateTime.Parse(row["录入时间"].ToString());
         }
         if (row["客户代码"] != null)
         {
             model.客户代码 = row["客户代码"].ToString();
         }
         if (row["生产日期"] != null && row["生产日期"].ToString() != "")
         {
             model.生产日期 = DateTime.Parse(row["生产日期"].ToString());
         }
     }
     return(model);
 }
예제 #5
0
        /// <summary>
        /// 修改tsuhan_sg_gt表信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Update(Maticsoft.Model.tsuhan_sg_gt model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update tsuhan_sg_gt set ");
            strSql.Append("交货日期=@交货日期,");
            strSql.Append("下单日期=@下单日期,");
            strSql.Append("表格编号=@表格编号,");
            strSql.Append("合同编号=@合同编号,");
            strSql.Append("规格书编号=@规格书编号,");
            strSql.Append("产品名称=@产品名称,");
            strSql.Append("备货单数量=@备货单数量,");
            strSql.Append("随工卡数量=@随工卡数量,");
            strSql.Append("产品图号=@产品图号,");
            strSql.Append("产品类型=@产品类型,");
            strSql.Append("成品编码=@成品编码,");
            strSql.Append("BK_A=@BK_A,");
            strSql.Append("BK_B=@BK_B,");
            strSql.Append("BK_C=@BK_C,");
            strSql.Append("LD_LDjj=@LD_LDjj,");
            strSql.Append("GX_hjfs=@GX_hjfs,");
            strSql.Append("OH_hqPomin=@OH_hqPomin,");
            strSql.Append("OH_hqPomax=@OH_hqPomax,");
            strSql.Append("OH_hqBFB=@OH_hqBFB,");
            strSql.Append("OH_hhPomin=@OH_hhPomin,");
            strSql.Append("OH_hhPomax=@OH_hhPomax,");
            strSql.Append("OH_hhBFB=@OH_hhBFB,");
            strSql.Append("DM_dmzl=@DM_dmzl,");
            strSql.Append("PT_rqgl=@PT_rqgl,");
            strSql.Append("PT_gdlmin=@PT_gdlmin,");
            strSql.Append("PT_gdlmax=@PT_gdlmax,");
            strSql.Append("GDW_xhcs=@GDW_xhcs,");
            strSql.Append("LD_CSPomin=@LD_CSPomin,");
            strSql.Append("LD_CSPomax=@LD_CSPomax,");
            strSql.Append("LD_CSBFB=@LD_CSBFB,");
            strSql.Append("LD_LDKINK=@LD_LDKINK,");
            strSql.Append("LD_PDKINK=@LD_PDKINK,");
            strSql.Append("PT_CStj=@PT_CStj,");
            strSql.Append("PT_CSpl=@PT_CSpl,");
            strSql.Append("PT_LMd=@PT_LMd,");
            strSql.Append("PT_LMd2=@PT_LMd2,");
            strSql.Append("PT_ICCmin=@PT_ICCmin,");
            strSql.Append("PT_ICCmax=@PT_ICCmax,");
            strSql.Append("BZ_QJbq=@BZ_QJbq,");
            strSql.Append("GD_if=@GD_if,");
            strSql.Append("GD_ccglMin=@GD_ccglMin,");
            strSql.Append("GD_ccglMax=@GD_ccglMax,");
            strSql.Append("GD_imoMin=@GD_imoMin,");
            strSql.Append("GD_imoMax=@GD_imoMax,");
            strSql.Append("GD_ithMin=@GD_ithMin,");
            strSql.Append("GD_ithMax=@GD_ithMax,");
            strSql.Append("GD_vfMin=@GD_vfMin,");
            strSql.Append("GD_vfMax=@GD_vfMax,");
            strSql.Append("GD_ptsl=@GD_ptsl,");
            strSql.Append("GD_vbrMin=@GD_vbrMin,");
            strSql.Append("GD_vbrMax=@GD_vbrMax,");
            strSql.Append("JX_wdMin=@JX_wdMin,");
            strSql.Append("JX_wdMax=@JX_wdMax,");
            strSql.Append("JX_zz=@JX_zz,");
            strSql.Append("JX_pthigh=@JX_pthigh,");
            strSql.Append("JX_ptwwj=@JX_ptwwj,");
            strSql.Append("JX_ldgj=@JX_ldgj,");
            strSql.Append("JX_ptgj=@JX_ptgj,");
            strSql.Append("fh产品名称=@fh产品名称,");
            strSql.Append("Description=@Description,");
            strSql.Append("物料代码=@物料代码,");
            strSql.Append("型号属性=@型号属性,");
            strSql.Append("Specification=@Specification,");
            strSql.Append("客户型号=@客户型号,");
            strSql.Append("LD芯片型号=@LD芯片型号,");
            strSql.Append("PT芯片型号=@PT芯片型号,");
            strSql.Append("Quantity1=@Quantity1,");
            strSql.Append("Quantity2=@Quantity2,");
            strSql.Append("数量=@数量,");
            strSql.Append("计划编制=@计划编制,");
            strSql.Append("技术审核=@技术审核,");
            strSql.Append("生产审核=@生产审核,");
            strSql.Append("录入员=@录入员,");
            strSql.Append("录入时间=@录入时间,");
            strSql.Append("客户代码=@客户代码,");
            strSql.Append("生产日期=@生产日期");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@交货日期",          SqlDbType.DateTime),
                new SqlParameter("@下单日期",          SqlDbType.DateTime),
                new SqlParameter("@表格编号",          SqlDbType.NVarChar,  20),
                new SqlParameter("@合同编号",          SqlDbType.NVarChar,  40),
                new SqlParameter("@规格书编号",         SqlDbType.NVarChar,  40),
                new SqlParameter("@产品名称",          SqlDbType.NVarChar,  50),
                new SqlParameter("@备货单数量",         SqlDbType.Int,        4),
                new SqlParameter("@随工卡数量",         SqlDbType.Int,        4),
                new SqlParameter("@产品图号",          SqlDbType.NVarChar,  20),
                new SqlParameter("@产品类型",          SqlDbType.NVarChar,  10),
                new SqlParameter("@成品编码",          SqlDbType.NVarChar,  40),
                new SqlParameter("@BK_A",          SqlDbType.NVarChar,  40),
                new SqlParameter("@BK_B",          SqlDbType.NVarChar,  40),
                new SqlParameter("@BK_C",          SqlDbType.NVarChar,  40),
                new SqlParameter("@LD_LDjj",       SqlDbType.Float,      8),
                new SqlParameter("@GX_hjfs",       SqlDbType.NVarChar,  15),
                new SqlParameter("@OH_hqPomin",    SqlDbType.Float,      8),
                new SqlParameter("@OH_hqPomax",    SqlDbType.Float,      8),
                new SqlParameter("@OH_hqBFB",      SqlDbType.Int,        4),
                new SqlParameter("@OH_hhPomin",    SqlDbType.Float,      8),
                new SqlParameter("@OH_hhPomax",    SqlDbType.Float,      8),
                new SqlParameter("@OH_hhBFB",      SqlDbType.Int,        4),
                new SqlParameter("@DM_dmzl",       SqlDbType.NVarChar,  40),
                new SqlParameter("@PT_rqgl",       SqlDbType.Int,        4),
                new SqlParameter("@PT_gdlmin",     SqlDbType.NVarChar,  20),
                new SqlParameter("@PT_gdlmax",     SqlDbType.NVarChar,  20),
                new SqlParameter("@GDW_xhcs",      SqlDbType.Int,        4),
                new SqlParameter("@LD_CSPomin",    SqlDbType.Float,      8),
                new SqlParameter("@LD_CSPomax",    SqlDbType.Float,      8),
                new SqlParameter("@LD_CSBFB",      SqlDbType.Int,        4),
                new SqlParameter("@LD_LDKINK",     SqlDbType.Int,        4),
                new SqlParameter("@LD_PDKINK",     SqlDbType.Int,        4),
                new SqlParameter("@PT_CStj",       SqlDbType.NVarChar,  20),
                new SqlParameter("@PT_CSpl",       SqlDbType.Float,      8),
                new SqlParameter("@PT_LMd",        SqlDbType.NVarChar,  10),
                new SqlParameter("@PT_LMd2",       SqlDbType.NVarChar,  10),
                new SqlParameter("@PT_ICCmin",     SqlDbType.Int,        4),
                new SqlParameter("@PT_ICCmax",     SqlDbType.Int,        4),
                new SqlParameter("@BZ_QJbq",       SqlDbType.NVarChar,  20),
                new SqlParameter("@GD_if",         SqlDbType.NVarChar,  10),
                new SqlParameter("@GD_ccglMin",    SqlDbType.Float,      8),
                new SqlParameter("@GD_ccglMax",    SqlDbType.Float,      8),
                new SqlParameter("@GD_imoMin",     SqlDbType.Int,        4),
                new SqlParameter("@GD_imoMax",     SqlDbType.Int,        4),
                new SqlParameter("@GD_ithMin",     SqlDbType.Int,        4),
                new SqlParameter("@GD_ithMax",     SqlDbType.Int,        4),
                new SqlParameter("@GD_vfMin",      SqlDbType.Float,      8),
                new SqlParameter("@GD_vfMax",      SqlDbType.Float,      8),
                new SqlParameter("@GD_ptsl",       SqlDbType.NVarChar,  10),
                new SqlParameter("@GD_vbrMin",     SqlDbType.Int,        4),
                new SqlParameter("@GD_vbrMax",     SqlDbType.Int,        4),
                new SqlParameter("@JX_wdMin",      SqlDbType.Int,        4),
                new SqlParameter("@JX_wdMax",      SqlDbType.Int,        4),
                new SqlParameter("@JX_zz",         SqlDbType.NVarChar,  10),
                new SqlParameter("@JX_pthigh",     SqlDbType.NVarChar,  20),
                new SqlParameter("@JX_ptwwj",      SqlDbType.NVarChar,  20),
                new SqlParameter("@JX_ldgj",       SqlDbType.NVarChar,   2),
                new SqlParameter("@JX_ptgj",       SqlDbType.NVarChar,   2),
                new SqlParameter("@fh产品名称",        SqlDbType.NVarChar,  50),
                new SqlParameter("@Description",   SqlDbType.NVarChar,  50),
                new SqlParameter("@物料代码",          SqlDbType.NVarChar,  30),
                new SqlParameter("@型号属性",          SqlDbType.NVarChar,  30),
                new SqlParameter("@Specification", SqlDbType.NVarChar,  30),
                new SqlParameter("@客户型号",          SqlDbType.NVarChar,  50),
                new SqlParameter("@LD芯片型号",        SqlDbType.NVarChar,  20),
                new SqlParameter("@PT芯片型号",        SqlDbType.NVarChar,  20),
                new SqlParameter("@Quantity1",     SqlDbType.NVarChar,  50),
                new SqlParameter("@Quantity2",     SqlDbType.NVarChar,  50),
                new SqlParameter("@数量",            SqlDbType.NVarChar,  10),
                new SqlParameter("@计划编制",          SqlDbType.NVarChar,  10),
                new SqlParameter("@技术审核",          SqlDbType.NVarChar,  10),
                new SqlParameter("@生产审核",          SqlDbType.NVarChar,  10),
                new SqlParameter("@录入员",           SqlDbType.NVarChar,  10),
                new SqlParameter("@录入时间",          SqlDbType.DateTime),
                new SqlParameter("@客户代码",          SqlDbType.NVarChar,  10),
                new SqlParameter("@生产日期",          SqlDbType.DateTime),
                new SqlParameter("@id",            SqlDbType.Int,        4),
                new SqlParameter("@备货单号",          SqlDbType.NVarChar, 30)
            };
            parameters[0].Value  = model.交货日期;
            parameters[1].Value  = model.单日期;
            parameters[2].Value  = model.表格编号;
            parameters[3].Value  = model.合同编号;
            parameters[4].Value  = model.规格书编号;
            parameters[5].Value  = model.产品名称;
            parameters[6].Value  = model.备货单数量;
            parameters[7].Value  = model.随工卡数量;
            parameters[8].Value  = model.产品图号;
            parameters[9].Value  = model.产品类型;
            parameters[10].Value = model.成品编码;
            parameters[11].Value = model.BK_A;
            parameters[12].Value = model.BK_B;
            parameters[13].Value = model.BK_C;
            parameters[14].Value = model.LD_LDjj;
            parameters[15].Value = model.GX_hjfs;
            parameters[16].Value = model.OH_hqPomin;
            parameters[17].Value = model.OH_hqPomax;
            parameters[18].Value = model.OH_hqBFB;
            parameters[19].Value = model.OH_hhPomin;
            parameters[20].Value = model.OH_hhPomax;
            parameters[21].Value = model.OH_hhBFB;
            parameters[22].Value = model.DM_dmzl;
            parameters[23].Value = model.PT_rqgl;
            parameters[24].Value = model.PT_gdlmin;
            parameters[25].Value = model.PT_gdlmax;
            parameters[26].Value = model.GDW_xhcs;
            parameters[27].Value = model.LD_CSPomin;
            parameters[28].Value = model.LD_CSPomax;
            parameters[29].Value = model.LD_CSBFB;
            parameters[30].Value = model.LD_LDKINK;
            parameters[31].Value = model.LD_PDKINK;
            parameters[32].Value = model.PT_CStj;
            parameters[33].Value = model.PT_CSpl;
            parameters[34].Value = model.PT_LMd;
            parameters[35].Value = model.PT_LMd2;
            parameters[36].Value = model.PT_ICCmin;
            parameters[37].Value = model.PT_ICCmax;
            parameters[38].Value = model.BZ_QJbq;
            parameters[39].Value = model.GD_if;
            parameters[40].Value = model.GD_ccglMin;
            parameters[41].Value = model.GD_ccglMax;
            parameters[42].Value = model.GD_imoMin;
            parameters[43].Value = model.GD_imoMax;
            parameters[44].Value = model.GD_ithMin;
            parameters[45].Value = model.GD_ithMax;
            parameters[46].Value = model.GD_vfMin;
            parameters[47].Value = model.GD_vfMax;
            parameters[48].Value = model.GD_ptsl;
            parameters[49].Value = model.GD_vbrMin;
            parameters[50].Value = model.GD_vbrMax;
            parameters[51].Value = model.JX_wdMin;
            parameters[52].Value = model.JX_wdMax;
            parameters[53].Value = model.JX_zz;
            parameters[54].Value = model.JX_pthigh;
            parameters[55].Value = model.JX_ptwwj;
            parameters[56].Value = model.JX_ldgj;
            parameters[57].Value = model.JX_ptgj;
            parameters[58].Value = model.fh产品名称;
            parameters[59].Value = model.Description;
            parameters[60].Value = model.物料代码;
            parameters[61].Value = model.型号属性;
            parameters[62].Value = model.Specification;
            parameters[63].Value = model.客户型号;
            parameters[64].Value = model.LD芯片型号;
            parameters[65].Value = model.PT芯片型号;
            parameters[66].Value = model.Quantity1;
            parameters[67].Value = model.Quantity2;
            parameters[68].Value = model.数量;
            parameters[69].Value = model.计划编制;
            parameters[70].Value = model.技术审核;
            parameters[71].Value = model.生产审核;
            parameters[72].Value = model.录入员;
            parameters[73].Value = model.录入时间;
            parameters[74].Value = model.客户代码;
            parameters[75].Value = model.生产日期;
            parameters[76].Value = model.id;
            parameters[77].Value = model.备货单号;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #6
0
 /// <summary>
 /// 修改tsuhan_sg_gt表信息
 /// </summary>
 /// <param name="mogt"></param>
 /// <returns></returns>
 public bool Update(tsuhan_sg_gt mogt)
 {
     return gtdal.Update(mogt);
 }
예제 #7
0
 /// <summary>
 /// 新增tsuhan_sg_gt表信息
 /// </summary>
 /// <param name="mogt"></param>
 /// <returns></returns>
 public bool Add(tsuhan_sg_gt mogt)
 {
     return gtdal.Add(mogt);
 }
예제 #8
0
        //private void tbsgdxh1_MouseLeave(object sender, EventArgs e)
        //{

        //    SelectDan();
        //}

        /// <summary>
        /// 根据备货单号查询
        /// </summary>
        private void SelectDan()
        {
            if (tbsgdxh1.Text == string.Empty || tbsgdxh1.Text == "00000")
            {
                MessageBox.Show("请填写备货单号", "警告");
                this.btnOK.Enabled = false;
                return;
            }
            else
            {
                var  tbs = this.tbsgdxh1.Text.Trim();
                bool result;
                //根据备货单号查询信息
                result = gtbll.Exists(tbs);
                if (result != true)
                {
                    MessageBox.Show("此单号还没有录入数据", "提示");
                    var gt = yhbll.GetModel(gh);
                    this.tsslLRYtxt.Text    = gt.姓名;
                    this.tsslLRTIMEtxt.Text = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
                    this.tbFHBHDH.Text      = this.tbsgdxh1.Text;
                    this.tbHTH.Text         = this.tbHTBH.Text;
                    btnUPDATA.Enabled       = true;
                    btnCHANGE.BackColor     = Color.SlateBlue;
                    btnCHANGE.Enabled       = false;
                    btnCHANGE.BackColor     = Color.Gray;
                    btnOK.Enabled           = true;
                    btnOK.BackColor         = Color.SlateBlue;
                    this.tbBHDH.Text        = this.tbsgdxh1.Text;
                    SelectSpec2();
                    return;
                }
                else
                {
                    btnUPDATA.Enabled   = false;
                    btnUPDATA.BackColor = Color.Gray;
                    btnCHANGE.Enabled   = true;
                    btnCHANGE.BackColor = Color.SlateBlue;
                    btnOK.Enabled       = false;
                    btnOK.BackColor     = Color.Gray;
                    Maticsoft.Model.tsuhan_sg_gt modelgt = gtbll.GetModel(tbs);
                    this.tbHTBH.Text = modelgt.合同编号;

                    var ghs = this.cbGGSBH.Text = modelgt.规格书编号;
                    SelectSpec(modelgt, ghs);
                    #region tsuhan_sg_gt

                    this.cbQJBQ.Text = modelgt.BZ_QJbq;
                    this.dTPjh.Text  = Convert.ToString(modelgt.交货日期);
                    this.dTPxd.Text  = Convert.ToString(modelgt.单日期);
                    string   tb     = modelgt.表格编号;
                    string[] tbbgbh = tb.Split(new char[1] {
                        '-'
                    });
                    this.tbBGBH1.Text = tbbgbh[0];
                    this.tbBGBH2.Text = tbbgbh[1];
                    this.cbCPMC.Text  = modelgt.产品名称;
                    this.tbBHDH.Text  = modelgt.备货单号;
                    this.tbBHDSL.Text = Convert.ToString(modelgt.备货单数量);
                    this.cbCPTH.Text  = modelgt.产品图号;
                    this.txtCPXH.Text = modelgt.产品类型;
                    this.txtCPBM.Text = modelgt.成品编码;
                    this.tbKHDM.Text  = modelgt.客户代码;
                    this.tbSGKSL.Text = Convert.ToString(modelgt.随工卡数量);
                    this.tbAM.Text    = modelgt.BK_A;
                    this.tbBM.Text    = modelgt.BK_B;

                    string   tbcm = modelgt.BK_C;
                    string[] tbCM = tbcm.Split(new char[1] {
                        '-'
                    });
                    this.tbCM1.Text     = tbCM[0];
                    this.tbCM2.Text     = tbCM[1];
                    this.tbJJ.Text      = Convert.ToString(modelgt.LD_LDjj);
                    this.tbHJFS.Text    = modelgt.GX_hjfs;
                    this.tbDMZL.Text    = modelgt.DM_dmzl;
                    this.tbXHCS.Text    = Convert.ToString(modelgt.GDW_xhcs);
                    this.tbHQGLmin.Text = Convert.ToString(modelgt.OH_hqPomin);
                    this.tbHQGLmax.Text = Convert.ToString(modelgt.OH_hqPomax);
                    this.tbHHGLmin.Text = Convert.ToString(modelgt.OH_hhPomin);
                    this.tbHHGLmax.Text = Convert.ToString(modelgt.OH_hhPomax);
                    this.tbRXGL.Text    = Convert.ToString(modelgt.PT_rqgl);;
                    this.tbGDLmin.Text  = Convert.ToString(modelgt.PT_gdlmin);
                    this.tbGDLmax.Text  = Convert.ToString(modelgt.PT_gdlmax);

                    this.tbCSWDmin.Text  = Convert.ToString(modelgt.JX_wdMin);
                    this.tbCSWDmax.Text  = Convert.ToString(modelgt.JX_wdMax);
                    this.tbZZFX.Text     = modelgt.JX_zz;
                    this.tbPTGD.Text     = modelgt.JX_pthigh;
                    this.tbPTWWJ.Text    = modelgt.JX_ptwwj;
                    this.tbLDtype.Text   = modelgt.JX_ldgj;
                    this.tbPTtype.Text   = modelgt.JX_ptgj;
                    this.tbHQPo.Text     = Convert.ToString(modelgt.OH_hqBFB);
                    this.tbHHPo.Text     = Convert.ToString(modelgt.OH_hhBFB);
                    this.tbCSPo.Text     = Convert.ToString(modelgt.LD_CSBFB);
                    this.tbCSmin.Text    = Convert.ToString(modelgt.LD_CSPomin);
                    this.tbCSmax.Text    = Convert.ToString(modelgt.LD_CSPomax);
                    this.rtbCPMC.Text    = modelgt.fh产品名称;
                    this.tbDESCEIP.Text  = modelgt.Description;
                    this.cbWLDM.Text     = modelgt.物料代码;
                    this.cbXHSX.Text     = modelgt.型号属性;
                    this.cbSPEC.Text     = modelgt.Specification;
                    this.cbKHXH.Text     = modelgt.客户型号;
                    this.cbLDCHIPXH.Text = modelgt.LD芯片型号;
                    this.cbPTCHIPXH.Text = modelgt.PT芯片型号;
                    this.textBox1.Text   = Convert.ToString(modelgt.生产日期);
                    this.tbQUA_PO.Text   = modelgt.Quantity1;
                    this.tbQUA_SEN.Text  = modelgt.Quantity2;
                    this.tbSL.Text       = modelgt.数量;
                    this.tbFHBHDH.Text   = modelgt.备货单号;
                    this.tbHTH.Text      = modelgt.合同编号;

                    this.tbJHBZ.Text        = modelgt.计划编制;
                    this.tbJSSH.Text        = modelgt.技术审核;
                    this.tbSCSH.Text        = modelgt.生产审核;
                    this.tsslLRTIMEtxt.Text = Convert.ToString(modelgt.录入时间);
                    this.tsslLRYtxt.Text    = modelgt.录入员;
                    #endregion



                    //审核人
                    //修改按钮不可用
                }
            }
        }
예제 #9
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCHANGE_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("确定要修改吗???", "提示", MessageBoxButtons.YesNo);

            if (dr == DialogResult.Yes)
            {
                if (tbsgdxh1.Text.Trim() != "")
                {
                    Maticsoft.Model.tsuhan_sg_gt mogt = new Maticsoft.Model.tsuhan_sg_gt();
                    var bhd = this.tbBHDH.Text;
                    var gt  = gtbll.GetModel(bhd);
                    mogt.id   = gt.id;
                    mogt.合同编号 = this.tbHTBH.Text;
                    mogt.备货单号 = this.tbBHDH.Text;
                    if (this.tbBHDSL.Text == "")
                    {
                        this.tbBHDSL.Text = "0";
                    }
                    mogt.备货单数量 = Convert.ToInt32(this.tbBHDSL.Text);
                    mogt.表格编号  = this.tbBGBH1.Text + "-" + this.tbBGBH2.Text;
                    mogt.产品名称  = this.cbCPMC.Text;
                    mogt.产品类型  = this.txtCPXH.Text;
                    mogt.成品编码  = this.txtCPBM.Text;
                    mogt.产品图号  = this.cbCPTH.Text;
                    mogt.客户代码  = this.tbKHDM.Text;
                    mogt.规格书编号 = this.cbGGSBH.Text;
                    mogt.计划编制  = this.tbJHBZ.Text;
                    mogt.技术审核  = this.tbJSSH.Text;
                    mogt.生产审核  = this.tbSCSH.Text;
                    mogt.交货日期  = Convert.ToDateTime(this.dTPjh.Text);
                    mogt.单日期   = Convert.ToDateTime(this.dTPxd.Text);
                    mogt.录入时间  = Convert.ToDateTime(this.tsslLRTIMEtxt.Text);
                    mogt.录入员   = this.tsslLRYtxt.Text;
                    mogt.BK_A  = this.tbAM.Text;
                    mogt.BK_B  = this.tbBM.Text;
                    #region
                    if (this.tbCM2.Text == "")
                    {
                        this.tbCM2.Text = "0000";
                    }
                    mogt.BK_C = this.tbCM1.Text + "-" + this.tbCM2.Text;
                    if (this.tbSGKSL.Text == "")
                    {
                        mogt.随工卡数量 = null;
                    }
                    else
                    {
                        mogt.随工卡数量 = Convert.ToInt32(this.tbSGKSL.Text);
                    }

                    if (this.tbJJ.Text == "")
                    {
                        mogt.LD_LDjj = null;
                    }
                    else
                    {
                        mogt.LD_LDjj = Convert.ToDecimal(this.tbJJ.Text);
                    }
                    if (this.tbHQGLmin.Text == "")
                    {
                        mogt.GDW_xhcs = null;
                    }
                    else
                    {
                        mogt.GDW_xhcs = Convert.ToInt32(this.tbXHCS.Text);
                    }
                    if (this.tbHQGLmin.Text == "")
                    {
                        mogt.OH_hqPomin = null;
                    }
                    else
                    {
                        mogt.OH_hqPomin = Convert.ToDecimal(this.tbHQGLmin.Text);
                    }
                    if (this.tbHQGLmax.Text == "")
                    {
                        mogt.OH_hqPomax = null;
                    }
                    else
                    {
                        mogt.OH_hqPomax = Convert.ToDecimal(this.tbHQGLmax.Text);
                    }

                    if (this.tbHHGLmin.Text == "")
                    {
                        mogt.OH_hhPomin = null;
                    }
                    else
                    {
                        mogt.OH_hhPomin = Convert.ToDecimal(this.tbHHGLmin.Text);
                    }

                    if (this.tbHHGLmax.Text == "")
                    {
                        mogt.OH_hhPomax = null;
                    }
                    else
                    {
                        mogt.OH_hhPomax = Convert.ToDecimal(this.tbHHGLmax.Text);
                    }

                    if (this.tbRXGL.Text == "")
                    {
                        mogt.PT_rqgl = null;
                    }
                    else
                    {
                        mogt.PT_rqgl = Convert.ToInt32(this.tbRXGL.Text);
                    }

                    if (this.tbGDLmin.Text == "")
                    {
                        mogt.PT_gdlmin = null;
                    }
                    else
                    {
                        mogt.PT_gdlmin = this.tbGDLmin.Text;
                    }

                    if (this.tbGDLmax.Text == "")
                    {
                        mogt.PT_gdlmax = null;
                    }
                    else
                    {
                        mogt.PT_gdlmax = this.tbGDLmax.Text;
                    }


                    if (this.tbHQPo.Text == "")
                    {
                        mogt.OH_hqBFB = null;
                    }
                    else if (Convert.ToInt32(this.tbHQPo.Text.Trim()) > 100)
                    {
                        MessageBox.Show("输入的" + lblHQ.Text + "不能大于100", "提示");
                        return;
                    }
                    else if (Convert.ToInt32(this.tbHQPo.Text.Trim()) < 0)
                    {
                        MessageBox.Show("输入的" + lblHQ.Text + "不能小于0", "提示");
                        return;
                    }
                    else
                    {
                        mogt.OH_hqBFB = Convert.ToInt32(this.tbHQPo.Text);
                    }

                    if (this.tbHHPo.Text == "")
                    {
                        mogt.OH_hhBFB = null;
                    }
                    else if (Convert.ToInt32(this.tbHHPo.Text.Trim()) > 100)
                    {
                        MessageBox.Show("输入的" + lblHH.Text + "不能大于100", "提示");
                        return;
                    }
                    else if (Convert.ToInt32(this.tbHHPo.Text.Trim()) < 0)
                    {
                        MessageBox.Show("输入的" + lblHH.Text + "不能小于0", "提示");
                        return;
                    }
                    else
                    {
                        mogt.OH_hhBFB = Convert.ToInt32(this.tbHHPo.Text);
                    }


                    if (this.tbCSPo.Text == "")
                    {
                        mogt.LD_CSBFB = null;
                    }
                    else if (Convert.ToInt32(this.tbCSPo.Text.Trim()) > 100)
                    {
                        MessageBox.Show("输入的" + lblCS.Text + "不能大于100", "提示");
                        return;
                    }
                    else if (Convert.ToInt32(this.tbCSPo.Text.Trim()) < 0)
                    {
                        MessageBox.Show("输入的" + lblCS.Text + "不能小于0", "提示");
                        return;
                    }
                    else
                    {
                        mogt.LD_CSBFB = Convert.ToInt32(this.tbCSPo.Text);
                    }

                    if (this.tbCSWDmin.Text == "")
                    {
                        mogt.JX_wdMin = null;
                    }
                    else
                    {
                        mogt.JX_wdMin = Convert.ToInt32(this.tbCSWDmin.Text);
                    }
                    if (this.tbCSWDmax.Text == "")
                    {
                        mogt.JX_wdMax = null;
                    }
                    else
                    {
                        mogt.JX_wdMax = Convert.ToInt32(this.tbCSWDmax.Text);
                    }
                    #endregion
                    mogt.GX_hjfs = this.tbHJFS.Text;
                    mogt.DM_dmzl = this.tbDMZL.Text;

                    mogt.JX_ptwwj  = this.tbPTWWJ.Text;
                    mogt.JX_zz     = this.tbZZFX.Text;
                    mogt.JX_pthigh = this.tbPTGD.Text;
                    mogt.JX_ptgj   = this.tbPTtype.Text;
                    mogt.JX_ldgj   = this.tbLDtype.Text;
                    mogt.BZ_QJbq   = this.cbQJBQ.Text;
                    if (this.tbLDKINK.Text == "")
                    {
                        this.tbLDKINK.Text = "0";
                    }
                    if (this.tbPTKINK.Text == "")
                    {
                        this.tbPTKINK.Text = "0";
                    }
                    if (this.tbICCmin.Text == "")
                    {
                        this.tbICCmin.Text = "0";
                    }
                    if (this.tbICCmax.Text == "")
                    {
                        this.tbICCmax.Text = "0";
                    }
                    if (this.tbIMOmin.Text == "")
                    {
                        this.tbIMOmin.Text = "0";
                    }
                    if (this.tbIMOmax.Text == "")
                    {
                        this.tbIMOmax.Text = "0";
                    }
                    if (this.tbCCGLmin.Text == "")
                    {
                        this.tbCCGLmin.Text = "0";
                    }
                    if (this.tbCCGLmax.Text == "")
                    {
                        this.tbCCGLmax.Text = "0";
                    }
                    if (this.tbITHmin.Text == "")
                    {
                        this.tbITHmin.Text = "0";
                    }
                    if (this.tbITHmax.Text == "")
                    {
                        this.tbITHmax.Text = "0";
                    }
                    if (this.tbVFmin.Text == "")
                    {
                        this.tbVFmin.Text = "0";
                    }
                    if (this.tbVFmax.Text == "")
                    {
                        this.tbVFmax.Text = "0";
                    }
                    if (this.tbVBRmin.Text == "")
                    {
                        this.tbVBRmin.Text = "0";
                    }
                    if (this.tbVBRmax.Text == "")
                    {
                        this.tbVBRmax.Text = "0";
                    }
                    if (this.tbCSmin.Text == "")
                    {
                        this.tbCSmin.Text = "0";
                    }
                    if (this.tbCSmax.Text == "")
                    {
                        this.tbCSmax.Text = "0";
                    }
                    mogt.LD_CSPomin    = Convert.ToDecimal(this.tbCSmin.Text);
                    mogt.LD_CSPomax    = Convert.ToDecimal(this.tbCSmax.Text);
                    mogt.LD_LDKINK     = Convert.ToInt32(this.tbLDKINK.Text);
                    mogt.LD_PDKINK     = Convert.ToInt32(this.tbPTKINK.Text);
                    mogt.GD_if         = this.tbIf.Text;
                    mogt.PT_ICCmin     = Convert.ToInt32(this.tbICCmin.Text);
                    mogt.PT_ICCmax     = Convert.ToInt32(this.tbICCmax.Text);
                    mogt.GD_imoMin     = Convert.ToInt32(this.tbIMOmin.Text);
                    mogt.GD_imoMax     = Convert.ToInt32(this.tbIMOmax.Text);
                    mogt.GD_ccglMin    = Convert.ToDecimal(this.tbCCGLmin.Text);
                    mogt.GD_ccglMax    = Convert.ToDecimal(this.tbCCGLmax.Text);
                    mogt.GD_ithMin     = Convert.ToInt32(this.tbITHmin.Text);
                    mogt.GD_ithMax     = Convert.ToInt32(this.tbITHmax.Text);
                    mogt.GD_vfMin      = Convert.ToDecimal(this.tbVFmin.Text);
                    mogt.GD_vfMax      = Convert.ToDecimal(this.tbVFmax.Text);
                    mogt.GD_ptsl       = this.tbPTSL.Text;
                    mogt.GD_vbrMin     = Convert.ToInt32(this.tbVBRmin.Text);
                    mogt.GD_vbrMax     = Convert.ToInt32(this.tbVBRmax.Text);
                    mogt.fh产品名称        = this.rtbCPMC.Text;
                    mogt.Description   = this.tbDESCEIP.Text;
                    mogt.物料代码          = this.cbWLDM.Text;
                    mogt.型号属性          = this.cbXHSX.Text;
                    mogt.Specification = this.cbSPEC.Text;
                    mogt.客户型号          = this.cbKHXH.Text;
                    mogt.LD芯片型号        = this.cbLDCHIPXH.Text;
                    mogt.PT芯片型号        = this.cbPTCHIPXH.Text;
                    mogt.生产日期          = Convert.ToDateTime(this.textBox1.Text);
                    mogt.Quantity1     = this.tbQUA_PO.Text;
                    mogt.Quantity2     = this.tbQUA_SEN.Text;
                    mogt.数量            = this.tbSL.Text;

                    bool result = false;

                    try
                    {
                        result = gtbll.Update(mogt);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                        return;
                    }
                    if (result == true)
                    {
                        MessageBox.Show("修改成功", "提示");
                    }
                    else
                    {
                        MessageBox.Show("修改失败", "提示");
                    }
                }
            }
            else if (dr == DialogResult.No)
            {
                return;
            }
        }