Esempio n. 1
0
        //合同变更
        protected void btnConBg_Click(object sender, EventArgs e)
        {
            try
            {
                #region //新增变更合同
                List <Mod_TMO_ORDER> orderList = new List <Mod_TMO_ORDER>();

                #region //添加合同基本信息

                int NO = Convert.ToInt32(ltlcon_bgNo.Text) + 1;

                Mod_TMO_CON modCon = tmo_con.GetModel(txtConNO.Text);
                modCon.C_CON_NO        = modCon.C_CON_NO + "-" + NO.ToString();
                modCon.C_CON_NAME      = modCon.C_CON_NAME;
                modCon.N_STATUS        = -1;                                           //客户待提交
                modCon.D_CONSING_DT    = DateTime.Now;                                 //合同签署日期
                modCon.D_CONEFFE_DT    = Convert.ToDateTime(DateTime.Now);             //计划生效日期
                modCon.D_CONINVALID_DT = Convert.ToDateTime(DateTime.Now).AddDays(60); //计划失效日期
                modCon.C_CON_NO_OLD    = txtConNO.Text;                                //原始合同号
                modCon.N_CHANGENUM     = NO;                                           //变更次数
                #endregion

                #region                                                 //添加合同明细
                Bll_RandomNumber randomnumber = new Bll_RandomNumber(); //流水号
                DataTable        dtOrder      = tmo_order.GetConOrderList(txtConNO.Text, "", "", "", "", "").Tables[0];

                for (int i = 0; i < dtOrder.Rows.Count; i++)
                {
                    Mod_TMO_ORDER modOrder = tmo_order.GetModel(dtOrder.Rows[i]["C_ID"].ToString()); //订单表
                    string        order_no = randomnumber.CreateOrderNo(modCon.C_CON_NO);            //订单号
                    modOrder.C_ORDER_NO      = order_no;
                    modOrder.C_CON_NO        = modCon.C_CON_NO;                                      //合同号
                    modOrder.C_CON_NAME      = modCon.C_CON_NAME;                                    //合同名称
                    modOrder.C_CUST_NO       = modCon.C_CUST_NO;                                     //客户编码
                    modOrder.C_CUST_NAME     = modCon.C_CUSTNAME;                                    //客户名称
                    modOrder.C_RECEIPTCORPID = modCon.C_CRECEIPTCUSTOMERID;                          //收货单位
                    modOrder.N_STATUS        = -1;                                                   //客户待提交
                    modOrder.C_SFPJ          = "N";                                                  //是否评价
                    modOrder.N_EXEC_STATUS   = -2;                                                   //未提报
                    modOrder.N_WGT           = modOrder.N_WGT;                                       //原合同数量
                    modOrder.C_ORDER_NO_OLD  = dtOrder.Rows[i]["C_ORDER_NO"].ToString();             //原合同号
                    orderList.Add(modOrder);
                }
                #endregion

                #endregion

                if (tmo_con.InsertConOrder(modCon, orderList))
                {
                    string url = "ConEdit_BG.aspx?ID=" + modCon.C_CON_NO + "&YID=" + txtConNO.Text;
                    Response.Redirect(url);
                }
            }
            catch (Exception ex)
            {
                WebMsg.MessageBox(ex.Message);
            }
        }
Esempio n. 2
0
        private void GetZZS()
        {
            var logger = Logger.CreateLogger(this.GetType());

            try
            {
                DataTable dt = tmd_dispatchdetails.GetGPZZS();
                for (int j = 0; j < dt.Rows.Count; j++)
                {
                    string sendcode = dt.Rows[j]["C_DISPATCH_ID"].ToString();

                    #region//钢坯质证书

                    Bll_RandomNumber randomnumber = new Bll_RandomNumber();

                    DataTable gpdt = tmd_dispatchdetails.GetZJBList(sendcode).Tables[0];
                    for (int i = 0; i < gpdt.Rows.Count; i++)
                    {
                        if (gpdt.Rows[i]["N_STATUS"].ToString() == "6")//钢坯
                        {
                            bool res = trc_roll_prodcut.ExistsZZS(sendcode, gpdt.Rows[i]["C_BATCH_NO"].ToString(), gpdt.Rows[i]["C_STOVE"].ToString());
                            //检查是否重复批次
                            if (!res)
                            {
                                DataTable dtroll = trc_roll_prodcut.GetZZS("", "", sendcode, "", "", gpdt.Rows[i]["C_BATCH_NO"].ToString(), "", "", "N", gpdt.Rows[i]["N_STATUS"].ToString(), gpdt.Rows[i]["C_STOVE"].ToString(), "").Tables[0];
                                if (dtroll.Rows.Count > 0)
                                {
                                    DataTable dtCustStd = trc_roll_prodcut.GetCustStd_JH(dtroll.Rows[0]["C_STD_CODE"].ToString(), dtroll.Rows[0]["C_STL_GRD"].ToString(), dtroll.Rows[0]["C_ZYX1"].ToString(), dtroll.Rows[0]["C_ZYX2"].ToString()).Tables[0];

                                    DataTable dtJSXYH = trc_roll_prodcut.GetCustStd_JH(dtroll.Rows[0]["C_STD_CODE"].ToString(), dtroll.Rows[0]["C_STL_GRD"].ToString(), dtroll.Rows[0]["C_TECH_PROT"].ToString(), dtroll.Rows[0]["C_ZYX1"].ToString(), dtroll.Rows[0]["C_ZYX2"].ToString()).Tables[0];

                                    #region //添加参数
                                    Mod_TQC_ZZS_INFO mod = new Mod_TQC_ZZS_INFO();
                                    mod.C_FYDH     = sendcode;
                                    mod.C_BATCH_NO = dtroll.Rows[0]["C_BATCH_NO"].ToString();
                                    mod.C_STOVE    = dtroll.Rows[0]["C_STOVE"].ToString();
                                    mod.C_SPEC     = dtroll.Rows[0]["C_SPEC"].ToString();
                                    mod.C_STL_GRD  = dtroll.Rows[0]["C_STL_GRD"].ToString();
                                    mod.C_STD_CODE = dtroll.Rows[0]["C_STD_CODE"].ToString();
                                    mod.D_CKSJ     = Convert.ToDateTime(dtroll.Rows[0]["D_CKSJ"].ToString());
                                    mod.N_JZ       = Convert.ToDecimal(dtroll.Rows[0]["N_WGT"].ToString());
                                    mod.N_NUM      = Convert.ToDecimal(dtroll.Rows[0]["QUA"].ToString());
                                    mod.C_CH       = dtroll.Rows[0]["C_CH"].ToString();

                                    mod.C_ZSH = randomnumber.GetZSH(); //证书号

                                    mod.C_QZR = "01";                  //签证人


                                    #region //生成二维码

                                    string msg = $@"http://60.6.254.51:808/Common/qualCert.aspx?fyd={mod.C_FYDH}&zsh={mod.C_ZSH}";

                                    Bitmap bt = GenByZXingNet(msg);            //调用生成二维码方法

                                    mod.C_IMG = $@"D:/QRCode/{mod.C_ZSH}.jpg"; //生成二维码图片命名

                                    string upPath = $@"~/QRCode/{mod.C_ZSH}.jpg";

                                    bt.Save(Server.MapPath(upPath));//保存二维码图片


                                    #endregion

                                    Mod_TS_CUSTFILE mod_TS_CUSTFILE = ts_custfile.GetCustModel(dtroll.Rows[0]["C_CGC"].ToString());

                                    mod.C_CUST_NO   = mod_TS_CUSTFILE.C_NO;
                                    mod.C_CON_NO    = dtroll.Rows[0]["C_CON_NO"].ToString();
                                    mod.C_CUST_NAME = dtroll.Rows[0]["C_CUST_NAME"].ToString();
                                    mod.C_SH_NAME   = mod_TS_CUSTFILE.C_NAME;
                                    mod.C_MAT_NAME  = dtroll.Rows[0]["C_MAT_DESC"].ToString();
                                    mod.C_STD_JH    = dtCustStd.Rows[0]["C_STD_JH"].ToString();
                                    mod.C_ZLDJ      = dtroll.Rows[0]["C_JUDGE_LEV_ZH"].ToString();
                                    mod.C_JH_STATE  = dtroll.Rows[0]["C_JH_STATE"].ToString();
                                    mod.C_JSXYH     = dtJSXYH.Rows[0]["C_JSXYH"].ToString();
                                    mod.C_XKZH      = dtroll.Rows[0]["C_XKZH"].ToString();
                                    mod.C_BY1       = gpdt.Rows[i]["N_STATUS"].ToString();

                                    #endregion

                                    trc_roll_prodcut.InsertZZS(mod);
                                }
                            }
                        }
                    }

                    #endregion
                }
            }
            catch (Exception ex)
            {
                logger.Info("生成钢坯质证失败" + ex.Message);
            }
        }
Esempio n. 3
0
        //保存订单
        protected void btnsave_Click(object sender, EventArgs e)
        {
            try
            {
                bool result = true;

                List <string[]> list_log = new List <string[]>();

                List <Mod_TMO_ORDER> orderList = new List <Mod_TMO_ORDER>();

                for (int i = 0; i < rptList_Add.Items.Count; i++)
                {
                    HtmlInputCheckBox chkMat_Code    = (HtmlInputCheckBox)rptList_Add.Items[i].FindControl("chkMat_Code"); //物料ID
                    Literal           ltlStdCode     = (Literal)rptList_Add.Items[i].FindControl("ltlStdCode");            //执行标准
                    Literal           ltlC_IS_BXG    = (Literal)rptList_Add.Items[i].FindControl("ltlC_IS_BXG");           //是否不锈钢
                    Literal           ltlZYX1        = (Literal)rptList_Add.Items[i].FindControl("ltlZYX1");               //自由项1
                    Literal           ltlZYX2        = (Literal)rptList_Add.Items[i].FindControl("ltlZYX2");               //自由项2
                    DropDownList      dropArea       = (DropDownList)rptList_Add.Items[i].FindControl("dropArea");         //区域
                    TextBox           txtPack_Code   = (TextBox)rptList_Add.Items[i].FindControl("txtPack_Code");          //包装
                    TextBox           txtCustName    = (TextBox)rptList_Add.Items[i].FindControl("txtCustName");           //客户
                    TextBox           txtBXGCustName = (TextBox)rptList_Add.Items[i].FindControl("txtBXGCustName");        //不锈钢客户
                    TextBox           txtWgt         = (TextBox)rptList_Add.Items[i].FindControl("txtWgt");                //排产量
                    TextBox           txtRemark      = (TextBox)rptList_Add.Items[i].FindControl("txtRemark");             //备注


                    if (string.IsNullOrEmpty(txtPack_Code.Text) || tqb_pack.Exists(txtPack_Code.Text) == false)
                    {
                        result = false;
                        ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "", "_closemsg('包装不能为空或与实际包装不符');", true);
                        break;
                    }

                    if (dropArea.SelectedItem.Text != "不锈钢公司")
                    {
                        if (string.IsNullOrEmpty(txtCustName.Text))
                        {
                            result = false;
                            ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "", "_closemsg('请补全客户信息');", true);
                            break;
                        }
                    }
                    if (result)
                    {
                        #region //插入预测订单
                        Bll_RandomNumber  randomnumber = new Bll_RandomNumber();
                        Mod_TB_MATRL_MAIN modMat       = tb_matrl_main.GetModel(chkMat_Code.Value);

                        Mod_TMO_ORDER modOrder = new Mod_TMO_ORDER();                     //订单表
                        string        orderNo  = "YC" + DateTime.Now.ToString("yyyMMdd");
                        modOrder.C_ORDER_NO    = randomnumber.CreateNeedOrderNo(orderNo); //订单号
                        modOrder.C_CON_NO      = "YC";                                    //合同号
                        modOrder.C_AREA        = dropArea.SelectedItem.Text;              //区域
                        modOrder.C_INVBASDOCID = modMat.C_PK_INVBASDOC;                   //存货档案主键
                        modOrder.C_INVENTORYID = modMat.C_PK_INVMANDOC;                   //存货管理档案主键
                        modOrder.C_MAT_CODE    = modMat.C_MAT_CODE;                       //物料编码
                        modOrder.C_MAT_NAME    = modMat.C_MAT_NAME;                       //物料名称
                        modOrder.C_SPEC        = modMat.C_SPEC;                           //规格
                        modOrder.C_STL_GRD     = modMat.C_STL_GRD;                        //钢种
                        modOrder.C_FUNITID     = modMat.C_FJLDW;                          //辅单位
                        modOrder.C_UNITID      = modMat.C_PK_MEASDOC;                     //主计量单位
                        modOrder.C_YWY         = ltlempname.Text;                         //业务员
                        modOrder.C_SFPJ        = "N";
                        modOrder.N_FLAG        = 1;                                       //预测订单
                        modOrder.N_EXEC_STATUS = -1;                                      //提报订单
                        modOrder.N_TYPE        = Convert.ToDecimal(modMat.C_MAT_TYPE);    //订单类型

                        modOrder.C_FREE1     = ltlZYX1.Text;                              //自由项1
                        modOrder.C_FREE2     = ltlZYX2.Text;                              //自由项2
                        modOrder.C_STD_CODE  = ltlStdCode.Text;                           //执行标准
                        modOrder.C_BY4       = ltlC_IS_BXG.Text;                          //是否不锈钢
                        modOrder.N_WGT       = Convert.ToDecimal(txtWgt.Text);
                        modOrder.C_LEV       = "普通";                                      //钢种等级
                        modOrder.C_ORDER_LEV = "三级";                                      //订单等级
                        modOrder.N_STATUS    = 2;                                         //生效
                        modOrder.C_EMP_ID    = ltlempid.Text;
                        modOrder.C_EMP_NAME  = ltlempname.Text;
                        modOrder.C_PACK      = txtPack_Code.Text;

                        if (modOrder.C_AREA == "不锈钢公司")
                        {
                            modOrder.C_CUST_NAME = txtBXGCustName.Text;//客户信息
                        }
                        else
                        {
                            modOrder.C_CUST_NAME = txtCustName.Text;//客户信息

                            Bll_TS_CUSTFILE ts_custfile = new Bll_TS_CUSTFILE();
                            string where = $@" C_NAME='{txtCustName.Text}'";
                            DataTable dt = ts_custfile.GetList(where).Tables[0];
                            if (dt.Rows.Count > 0)
                            {
                                modOrder.C_CUST_NO = dt.Rows[0]["C_NO"].ToString();//客户编码
                            }
                        }
                        modOrder.C_REMARK4 = txtRemark.Text;  //备注
                        modOrder.C_PCTBEMP = ltlempname.Text; //提报人


                        orderList.Add(modOrder);

                        string[] arr_log = { "提报订单", "预测订单页面", ltlempid.Text, GetClientIP(), "", orderNo };
                        list_log.Add(arr_log);
                        #endregion
                    }
                }
                if (result)
                {
                    if (tmo_con.InsertNeedOrder(orderList))
                    {
                        //日志
                        tmo_order.InsertOrderPlanLog(list_log);

                        ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "", "_closemsg('保存成功');", true);

                        rptList_Add.DataSource = null;
                        rptList_Add.DataBind();

                        SetData();
                    }
                }
            }
            catch (Exception ex)
            {
                WebMsg.MessageBox(ex.Message);
            }
        }
Esempio n. 4
0
        public AjaxResult ConChange([FromBody] dynamic Json)
        {
            #region                    //参数
            string conNO = Json.conNO; //合同号
            #endregion

            #region //数据操作
            AjaxResult result = new AjaxResult();

            try
            {
                if (!string.IsNullOrEmpty(conNO))
                {
                    #region //新增变更合同
                    List <Mod_TMO_ORDER> orderList = new List <Mod_TMO_ORDER>();

                    #region //添加合同基本信息



                    Mod_TMO_CON modCon = tmo_con.GetModel(conNO);
                    int         NO     = Convert.ToInt32(modCon.N_CHANGENUM.ToString()) + 1;
                    modCon.C_CON_NO        = modCon.C_CON_NO + "-" + NO.ToString();
                    modCon.C_CON_NAME      = modCon.C_CON_NAME;
                    modCon.N_STATUS        = -1;                                           //客户待提交
                    modCon.D_CONSING_DT    = DateTime.Now;                                 //合同签署日期
                    modCon.D_CONEFFE_DT    = Convert.ToDateTime(DateTime.Now);             //计划生效日期
                    modCon.D_CONINVALID_DT = Convert.ToDateTime(DateTime.Now).AddDays(60); //计划失效日期
                    modCon.C_CON_NO_OLD    = conNO;                                        //原始合同号
                    modCon.N_CHANGENUM     = NO;                                           //变更次数
                    #endregion

                    #region                                                 //添加合同明细
                    Bll_RandomNumber randomnumber = new Bll_RandomNumber(); //流水号
                    DataTable        dtOrder      = tmo_order.GetConOrderList(conNO, "", "", "", "", "").Tables[0];

                    for (int i = 0; i < dtOrder.Rows.Count; i++)
                    {
                        Mod_TMO_ORDER modOrder = tmo_order.GetModel(dtOrder.Rows[i]["C_ID"].ToString()); //订单表
                        string        order_no = randomnumber.CreateOrderNo(modCon.C_CON_NO);            //订单号
                        modOrder.C_ORDER_NO     = order_no;
                        modOrder.C_CON_NO       = modCon.C_CON_NO;                                       //合同号
                        modOrder.C_CON_NAME     = modCon.C_CON_NAME;                                     //合同名称
                        modOrder.N_STATUS       = -1;                                                    //客户待提交
                        modOrder.C_SFPJ         = "N";                                                   //是否评价
                        modOrder.N_EXEC_STATUS  = -2;                                                    //未提报
                        modOrder.N_WGT          = modOrder.N_WGT;                                        //原合同数量
                        modOrder.C_ORDER_NO_OLD = dtOrder.Rows[i]["C_ORDER_NO"].ToString();              //原合同号
                        orderList.Add(modOrder);
                    }
                    #endregion

                    #endregion

                    if (tmo_con.InsertConOrder(modCon, orderList))
                    {
                        result.Code   = DoResult.Success;
                        result.Result = "变更成功";
                    }
                }
                else
                {
                    result.Code   = DoResult.Success;
                    result.Result = "合同为空,无法操作";
                }
            }
            catch (Exception ex)
            {
                result.Code   = DoResult.Success;
                result.Result = ex.Message;
            }
            #endregion

            return(result);
        }
Esempio n. 5
0
        //生成远程质证书
        protected void btnExport_Click(object sender, EventArgs e)
        {
            try
            {
                bool   result = true;
                string ww     = cbxww.Checked == true ? "Y" : "N";

                List <Mod_TQC_ZZS_INFO> list = new List <Mod_TQC_ZZS_INFO>();

                for (int i = 0; i < rptList.Items.Count; i++)
                {
                    HtmlInputCheckBox cbxID = (HtmlInputCheckBox)rptList.Items[i].FindControl("cbxID");
                    if (cbxID.Checked)
                    {
                        Bll_RandomNumber randomnumber = new Bll_RandomNumber();

                        #region //控件
                        Literal ltlC_FYDH         = (Literal)rptList.Items[i].FindControl("ltlC_FYDH");
                        Literal ltlC_BATCH_NO     = (Literal)rptList.Items[i].FindControl("ltlC_BATCH_NO");
                        Literal ltlC_JUDGE_LEV_ZH = (Literal)rptList.Items[i].FindControl("ltlC_JUDGE_LEV_ZH");
                        Literal ltlC_TYPE         = (Literal)rptList.Items[i].FindControl("ltlC_TYPE");//8线材/6钢坯
                        Literal ltlC_STOVE        = (Literal)rptList.Items[i].FindControl("ltlC_STOVE");
                        #endregion

                        string[] dj = { "A", "AA", "AAA", "CK", "A1", "合格品", "B1", "B2", "C1", "C2" };
                        if (dj.Contains(ltlC_JUDGE_LEV_ZH.Text))
                        {
                            bool res = ltlC_TYPE.Text == "8" ? trc_roll_prodcut.ExistsZZS(ltlC_FYDH.Text, ltlC_BATCH_NO.Text) : trc_roll_prodcut.ExistsZZS(ltlC_FYDH.Text, ltlC_BATCH_NO.Text, ltlC_STOVE.Text);
                            //检查是否重复批次
                            if (!res)
                            {
                                DataTable dt = trc_roll_prodcut.GetZZS("", "", ltlC_FYDH.Text, "", "", ltlC_BATCH_NO.Text, "", "", ww, ltlC_TYPE.Text, ltlC_STOVE.Text, "").Tables[0];
                                if (dt.Rows.Count > 0)
                                {
                                    DataTable dtCustStd = trc_roll_prodcut.GetCustStd_JH(dt.Rows[0]["C_STD_CODE"].ToString(), dt.Rows[0]["C_STL_GRD"].ToString(), dt.Rows[0]["C_ZYX1"].ToString(), dt.Rows[0]["C_ZYX2"].ToString()).Tables[0];

                                    DataTable dtJSXYH = trc_roll_prodcut.GetCustStd_JH(dt.Rows[0]["C_STD_CODE"].ToString(), dt.Rows[0]["C_STL_GRD"].ToString(), dt.Rows[0]["C_TECH_PROT"].ToString(), dt.Rows[0]["C_ZYX1"].ToString(), dt.Rows[0]["C_ZYX2"].ToString()).Tables[0];

                                    #region //添加参数
                                    Mod_TQC_ZZS_INFO mod = new Mod_TQC_ZZS_INFO();
                                    mod.C_FYDH     = ltlC_FYDH.Text;
                                    mod.C_BATCH_NO = ltlC_BATCH_NO.Text;
                                    mod.C_STOVE    = dt.Rows[0]["C_STOVE"].ToString();
                                    mod.C_SPEC     = dt.Rows[0]["C_SPEC"].ToString();
                                    mod.C_STL_GRD  = dt.Rows[0]["C_STL_GRD"].ToString();
                                    mod.C_STD_CODE = dt.Rows[0]["C_STD_CODE"].ToString();
                                    mod.D_CKSJ     = Convert.ToDateTime(dt.Rows[0]["D_CKSJ"].ToString());
                                    mod.N_JZ       = Convert.ToDecimal(dt.Rows[0]["N_WGT"].ToString());
                                    mod.N_NUM      = Convert.ToDecimal(dt.Rows[0]["QUA"].ToString());
                                    mod.C_CH       = dt.Rows[0]["C_CH"].ToString();

                                    mod.C_ZSH = randomnumber.GetZSH(); //证书号

                                    mod.C_QZR = ltlC_QZR.Text;         //签证人


                                    #region //生成二维码

                                    string msg = $@"http://60.6.254.51:808/Common/qualCert.aspx?fyd={mod.C_FYDH}&zsh={mod.C_ZSH}";

                                    Bitmap bt = GenByZXingNet(msg);            //调用生成二维码方法

                                    mod.C_IMG = $@"D:/QRCode/{mod.C_ZSH}.jpg"; //生成二维码图片命名

                                    string upPath = $@"~/QRCode/{mod.C_ZSH}.jpg";

                                    bt.Save(Server.MapPath(upPath));//保存二维码图片

                                    #endregion

                                    Mod_TS_CUSTFILE mod_TS_CUSTFILE = ts_custfile.GetCustModel(dt.Rows[0]["C_CGC"].ToString());

                                    mod.C_CUST_NO   = mod_TS_CUSTFILE.C_NO;
                                    mod.C_CON_NO    = dt.Rows[0]["C_CON_NO"].ToString();
                                    mod.C_CUST_NAME = dt.Rows[0]["C_CUST_NAME"].ToString();
                                    mod.C_SH_NAME   = mod_TS_CUSTFILE.C_NAME;
                                    mod.C_MAT_NAME  = dt.Rows[0]["C_MAT_DESC"].ToString();
                                    mod.C_STD_JH    = dtCustStd.Rows[0]["C_STD_JH"].ToString();
                                    mod.C_ZLDJ      = dt.Rows[0]["C_JUDGE_LEV_ZH"].ToString();
                                    mod.C_JH_STATE  = dt.Rows[0]["C_JH_STATE"].ToString();
                                    mod.C_JSXYH     = dtJSXYH.Rows[0]["C_JSXYH"].ToString();
                                    mod.C_XKZH      = dt.Rows[0]["C_XKZH"].ToString();
                                    mod.C_BY1       = ltlC_TYPE.Text;

                                    #endregion

                                    result = trc_roll_prodcut.InsertZZS(mod);
                                }
                            }
                        }
                    }
                }
                if (result)
                {
                    GetList();
                }
            }
            catch (Exception ex)
            {
                WebMsg.MessageBox(ex.Message);
            }
        }