Beispiel #1
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Add_Click(object sender, EventArgs e)
        {
            int[] rownumber = gv_std_main.GetSelectedRows();//获取选中行号数组;
            if (rownumber.Length == 0)
            {
                MessageBox.Show("请选择需要添加的信息!");
                return;
            }

            string strUserID = RV.UI.UserInfo.UserID;

            for (int i = 0; i < rownumber.Length; i++)
            {
                int                    selectedHandle = rownumber[i];
                string                 strID          = gv_std_main.GetRowCellValue(selectedHandle, "C_ID").ToString();
                Mod_TQB_STD_MAIN       mod_ID         = bllStdMain.GetModel(strID);
                Mod_TQB_RINSE_TANK_GRD mod            = new Mod_TQB_RINSE_TANK_GRD();
                mod.C_STD_CODE = mod_ID.C_STD_CODE;
                mod.C_STL_GRD  = mod_ID.C_STL_GRD;
                mod.C_EMP_ID   = strUserID;

                bllRinseTank.Add(mod);
            }
            NewMethod();
            NewMethod1();
            MessageBox.Show("添加成功!");

            Common.UserLog.AddLog(strMenuName, this.Name, this.Text, "添加涮槽钢种");//添加操作日志
        }
Beispiel #2
0
        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Audit_Click(object sender, EventArgs e)
        {
            try
            {
                DataRow dr = this.gv_StdMain.GetDataRow(this.gv_StdMain.FocusedRowHandle);
                if (dr == null)
                {
                    return;
                }
                if (dr["N_IS_CHECK"].ToString() == "已审核")
                {
                    MessageBox.Show("请勿重复审核!");
                    return;
                }

                System.Collections.Hashtable ht = new System.Collections.Hashtable();
                ht.Add("C_STD_CODE", dr["C_STD_CODE"].ToString());
                ht.Add("N_IS_CHECK", "1");
                ht.Add("N_STATUS", "1");
                ht.Add("C_STL_GRD", dr["C_STL_GRD"].ToString());
                if (Common.CheckRepeat.CheckTable("TQB_STD_MAIN", ht) > 0)
                {
                    MessageBox.Show("已存在重复的标准,不能审核,请先停用原来的标准!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                string result = bll_StdMain.Creat_Design(dr["C_ID"].ToString());

                if (result == "成功")
                {
                    Mod_TQB_STD_MAIN mod = bll_StdMain.GetModel(dr["C_ID"].ToString());

                    mod.N_IS_CHECK = 1;
                    mod.C_EMP_ID   = RV.UI.UserInfo.UserID;
                    mod.D_MOD_DT   = RV.UI.ServerTime.timeNow();
                    if (bll_StdMain.Update(mod))
                    {
                        MessageBox.Show("已审核!");

                        UpdateDesign(dr["C_ID"].ToString(), dr["C_STD_CODE"].ToString(), dr["C_STL_GRD"].ToString());

                        btn_Query_Click(null, null);
                        Common.UserLog.AddLog(strMenuName, this.Name, this.Text, "审核执行标准");//添加操作日志
                    }
                }
                else
                {
                    MessageBox.Show("成分性能没有维护,不能审核!");
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Save_Click(object sender, EventArgs e)
        {
            DataRow dr_main  = gv_std_main.GetDataRow(gv_std_main.FocusedRowHandle);
            string  str      = "";
            int     succount = 0;

            if (dr_main == null)
            {
                return;
            }
            int[] rownumber = gv_std_right.GetSelectedRows();//获取选中行号数组;
            if (rownumber.Length == 0)
            {
                MessageBox.Show("请选择需要保存的信息!");
                return;
            }
            for (int i = 0; i < rownumber.Length; i++)
            {
                int              selectedHandle = rownumber[i];
                string           strID          = gv_std_right.GetRowCellValue(selectedHandle, "C_ID").ToString();
                Mod_TQB_STD_MAIN mod_ID         = bll_StdMain.GetModel(strID);
                Mod_TQB_GZ_CHECK mod            = new Mod_TQB_GZ_CHECK();
                mod.C_STD_ID      = dr_main["C_ID"].ToString();
                mod.C_STD_MAIN_ID = mod_ID.C_ID.ToString();
                mod.C_CHECK       = "1";
                mod.C_EMP_ID      = RV.UI.UserInfo.UserID;
                mod.D_MOD_DT      = RV.UI.ServerTime.timeNow();
                #region 检测是否重复添加
                System.Collections.Hashtable ht = new System.Collections.Hashtable();
                ht.Add("C_STD_ID", mod.C_STD_ID);
                ht.Add("C_STD_MAIN_ID", mod.C_STD_MAIN_ID);
                ht.Add("C_CHECK", 1);
                if (Common.CheckRepeat.CheckTable("TQB_GZ_CHECK", ht) > 0)
                {
                    str += mod_ID.C_STL_GRD + "(" + mod_ID.C_STD_CODE + "),";
                }
                else
                {
                    bll_GzCheck.Add(mod);
                    succount += 1;
                }
                #endregion
            }
            if (str.Length > 0)
            {
                MessageBox.Show("共" + rownumber.Count() + "条数据,保存成功" + succount + "条," + str.Substring(0, str.Length - 1) + "已存在!");
                NewMethod2();
            }
            else
            {
                MessageBox.Show("保存成功!");
                NewMethod2();
            }
            Common.UserLog.AddLog(strMenuName, this.Name, this.Text, "保存钢种生产规则");//添加操作日志
        }
Beispiel #4
0
        public static string GetUSES(string C_STD_ID)
        {
            string result = string.Empty;

            Mod_TQB_STD_MAIN mod = std_main.GetModel(C_STD_ID);

            if (mod != null)
            {
                result = mod.C_USES;
            }
            return(result);
        }
Beispiel #5
0
        /// <summary>
        /// 根据钢种、自由项获取标准
        /// </summary>
        /// <param name="C_STL_GRD">钢种</param>
        /// <param name="zyx1">自由项1</param>
        /// <param name="zyx2">自由项2</param>
        /// <returns></returns>
        public Mod_TQB_STD_MAIN GetModel(string C_STL_GRD, string zyx1, string zyx2)
        {
            string strSql = "SELECT * FROM tqb_std_main t WHERE t.c_stl_grd='" + C_STL_GRD + "' AND (INSTR('" + zyx1 + "', t.c_std_code)>0 OR INSTR('" + zyx2 + "', t.c_std_code)>0)";

            Mod_TQB_STD_MAIN model = new Mod_TQB_STD_MAIN();
            DataSet          ds    = DbHelperOra.Query(strSql.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Beispiel #6
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TQB_STD_MAIN GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_STD_TYPE,C_STD_CODE,C_STD_DESC,C_STL_GRD,C_PROD_NAME,C_PROD_KIND,C_USES,n_EDIT_NUM,C_EDITION,C_IS_LF,C_IS_RH,C_IS_HL,C_IS_XM,C_IRON_REQUIRE,C_STOCK_REQUIRE,C_DELIVERY_STATE,C_PHYSICS_TIME,N_IS_CHECK,N_STATUS,C_REMARK,C_EMP_ID,D_MOD_DT,C_IS_BXG from TQB_STD_MAIN ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TQB_STD_MAIN model = new Mod_TQB_STD_MAIN();
            DataSet          ds    = DbHelperOra.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Beispiel #7
0
        public static bool AddOrder(string c_con_no, string c_con_name, string c_area, string c_mat_code, string c_mat_name, string c_tech_prot, string c_spec, string c_stl_grd, string c_unitis, string c_pro_use, string d_delivery_dt, string n_wgt, string addrid, string c_otc, string n_currency_type, string c_std_code, string n_type, string n_dia, string c_pack, string orderNo, string custNo, string custName, string custLEV, string custType, string sysDate, string shipvia)
        {
            if (!string.IsNullOrEmpty(orderNo))//更新数据
            {
                Mod_TMO_CONDETAILS mod = condetails.GetModel(orderNo);
                mod.C_MAT_CODE  = c_mat_code;
                mod.C_MAT_NAME  = c_mat_name;
                mod.C_TECH_PROT = c_tech_prot;
                mod.C_SPEC      = c_spec;
                mod.C_STL_GRD   = c_stl_grd;
                //mod.C_STD_CODE = c_std_code;
                mod.C_UNITIS          = c_unitis;
                mod.C_PRO_USE         = c_pro_use;
                mod.D_DELIVERY_DT     = Convert.ToDateTime(d_delivery_dt);//交货日期
                mod.N_WGT             = Convert.ToDecimal(n_wgt);
                mod.N_DIA             = Convert.ToDecimal(n_dia);
                mod.N_TYPE            = Convert.ToDecimal(n_type);
                mod.C_PACK            = c_pack;
                mod.C_CURRENCY_TYPE   = n_currency_type;
                mod.C_OTC             = c_otc;
                mod.C_CUST_NO         = custNo;
                mod.C_CUST_NAME       = custName;
                mod.N_USER_LEV        = Convert.ToDecimal(custLEV);  //客户等级
                mod.C_SALE_CHANNEL    = custType;
                mod.D_SYS_DELIVERY_DT = Convert.ToDateTime(sysDate); //系统推荐交货日期
                mod.D_NEED_DT         = Convert.ToDateTime(sysDate); //需求日期
                mod.C_SHIPVIA         = shipvia;


                #region //收货单位相关信息
                Mod_TS_CUSTADDR modaddr = custaddr.GetModel(addrid);
                if (modaddr != null)
                {
                    mod.C_CGC      = modaddr.C_CGC;
                    mod.C_CGAREA   = modaddr.C_CGAREA;
                    mod.C_CGADDR   = modaddr.C_CGADDR;
                    mod.C_CGMAN    = modaddr.C_CGMAN;
                    mod.C_CGMOBILE = modaddr.C_CGMOBILE;
                }
                #endregion

                #region //获取钢种单价-折扣-税率
                DataTable dt = activity.GetActivityList(c_mat_code, c_stl_grd, c_spec).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    decimal n_notax_unitprice = Convert.ToDecimal(dt.Rows[0]["N_PRICE"]);       //无税单价
                    decimal n_rate            = Convert.ToDecimal(dt.Rows[0]["N_RATE"]);        //税率
                    decimal unitPrice         = n_notax_unitprice * n_rate + n_notax_unitprice; //含税单价

                    decimal n_discount = Convert.ToDecimal(dt.Rows[0]["N_DISCOUNT"]);           //折扣

                    decimal n_orimoto = Convert.ToDecimal(dt.Rows[0]["N_ORIMOTO"]);             //折本汇率
                    mod.N_CELING_RATE = n_orimoto;

                    mod.N_NOTAX_UNITPRICE       = n_notax_unitprice;                  //无税单价
                    mod.N_NOTAX_NETPRICE        = n_notax_unitprice;                  //无税净价
                    mod.N_INCLUTAX_NETPRICE     = unitPrice;                          //含税净价
                    mod.N_DC_NOTAX_UNITPRICE    = n_notax_unitprice;                  //本币无税单价
                    mod.N_DC_INCLUTAX_UNITPRICE = unitPrice;                          //本币含税单价

                    mod.N_TAX = n_rate;                                               //税率

                    decimal n_nomoney = Convert.ToDecimal(n_wgt) * n_notax_unitprice; //无税金额
                    mod.N_NOMONEY = n_nomoney;                                        //无税金额

                    decimal n_pricetax_sum = Convert.ToDecimal(n_wgt) * unitPrice;    //价税合计
                    mod.N_PRICETAX_SUM    = n_pricetax_sum;                           //价税合计
                    mod.N_DC_PRICETAX_SUM = n_pricetax_sum;                           //本币价税合计

                    mod.N_ITEM_DIS = Convert.ToDecimal(dt.Rows[0]["N_DISCOUNT"]);     //单品折扣

                    mod.N_AMOUNT_FAX    = n_pricetax_sum - n_nomoney;                 //税额
                    mod.N_DC_AMOUNT_FAX = n_pricetax_sum - n_nomoney;                 //税额
                }
                #endregion

                #region  //获取执行标准/自由项/品种/类别 //设置质量设计号//订单-质量 //等级

                Mod_TQB_STD_MAIN mod_std_main = std_main.GetModel(c_std_code);
                if (mod_std_main != null)
                {
                    mod.C_PROD_NAME = mod_std_main.C_PROD_NAME; //类别
                    mod.C_PROD_KIND = mod_std_main.C_PROD_KIND; //品种
                    mod.C_STD_CODE  = mod_std_main.C_STD_CODE;  //执行标准代码
                }

                DataRow dr = std_config.GetFREE(c_std_code);
                if (dr != null)
                {
                    mod.C_FREE_TERM  = dr["C_ZYX1"].ToString();
                    mod.C_FREE_TERM2 = dr["C_ZYX2"].ToString();
                }

                mod.C_LEV = "普通";

                string PK_DESIGN_ID = "";                                      //质量设计号主键ID

                DataTable dtDesign = design.GetList("", c_std_code).Tables[0]; //质量设计信息
                if (dtDesign.Rows.Count > 0)
                {
                    mod.C_DESIGN_NO = dtDesign.Rows[0]["C_DESIGN_NO"].ToString(); //质量设计号
                    PK_DESIGN_ID    = dtDesign.Rows[0]["C_ID"].ToString();        //质量设计主键ID
                }

                #endregion

                bool result = false;

                if (condetails.Update(mod))
                {
                    //删除订单-质量
                    if (design_order.DeleteOder(orderNo))
                    {
                        //订单质量设计信息插入
                        Mod_TQB_DESIGN_ORDER modDesign_Order = new Mod_TQB_DESIGN_ORDER();
                        modDesign_Order.C_ORDER_ID  = orderNo;
                        modDesign_Order.C_DESIGN_ID = PK_DESIGN_ID;
                        result = design_order.Add(modDesign_Order);
                    }
                }
                return(result);
            }
            else//新增数据
            {
                Mod_TMO_CONDETAILS mod = new Mod_TMO_CONDETAILS();

                string order_no = c_con_no + DateTime.Now.ToString("MMddHHmmss");//订单号
                mod.C_NO              = order_no;
                mod.C_CON_NO          = c_con_no;
                mod.C_CON_NAME        = c_con_name;
                mod.C_AREA            = c_area;
                mod.C_MAT_CODE        = c_mat_code;
                mod.C_MAT_NAME        = c_mat_name;
                mod.C_STD_CODE        = c_std_code;
                mod.C_TECH_PROT       = c_tech_prot;
                mod.C_SPEC            = c_spec;
                mod.C_STL_GRD         = c_stl_grd;
                mod.C_UNITIS          = c_unitis;
                mod.C_PRO_USE         = c_pro_use;
                mod.D_DELIVERY_DT     = Convert.ToDateTime(d_delivery_dt);
                mod.D_DT              = DateTime.Now;
                mod.N_WGT             = Convert.ToDecimal(n_wgt);
                mod.N_DIA             = Convert.ToDecimal(n_dia);
                mod.N_TYPE            = Convert.ToDecimal(n_type);
                mod.C_PACK            = c_pack;
                mod.C_CURRENCY_TYPE   = n_currency_type;
                mod.C_OTC             = c_otc;
                mod.D_SYS_DELIVERY_DT = Convert.ToDateTime(sysDate); //系统推荐交货日期
                mod.D_NEED_DT         = Convert.ToDateTime(sysDate); //需求日期

                mod.C_CUST_NO      = custNo;
                mod.C_CUST_NAME    = custName;
                mod.N_USER_LEV     = Convert.ToDecimal(custLEV);//客户等级
                mod.C_SALE_CHANNEL = custType;

                var BaseUser = (NF.Framework.CurrentUser)HttpContext.Current.Session["CurrentUser"];
                if (BaseUser != null)
                {
                    mod.C_EMP_ID   = BaseUser.Id;
                    mod.C_EMP_NAME = BaseUser.Name;
                }



                #region //收货单位相关信息
                Mod_TS_CUSTADDR modaddr = custaddr.GetModel(addrid);
                if (modaddr != null)
                {
                    mod.C_CGC      = modaddr.C_CGC;
                    mod.C_CGAREA   = modaddr.C_CGAREA;
                    mod.C_CGADDR   = modaddr.C_CGADDR;
                    mod.C_CGMAN    = modaddr.C_CGMAN;
                    mod.C_CGMOBILE = modaddr.C_CGMOBILE;
                }
                #endregion

                #region //获取钢种单价-折扣-税率
                DataTable dt = activity.GetActivityList(c_mat_code, c_stl_grd, c_spec).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    decimal n_notax_unitprice = Convert.ToDecimal(dt.Rows[0]["N_PRICE"]);       //无税单价
                    decimal n_rate            = Convert.ToDecimal(dt.Rows[0]["N_RATE"]);        //税率
                    decimal unitPrice         = n_notax_unitprice * n_rate + n_notax_unitprice; //含税单价

                    decimal n_discount = Convert.ToDecimal(dt.Rows[0]["N_DISCOUNT"]);           //折扣

                    decimal n_orimoto = Convert.ToDecimal(dt.Rows[0]["N_ORIMOTO"]);             //折本汇率
                    mod.N_CELING_RATE = n_orimoto;

                    mod.N_NOTAX_UNITPRICE       = n_notax_unitprice;                  //无税单价
                    mod.N_NOTAX_NETPRICE        = n_notax_unitprice;                  //无税净价
                    mod.N_INCLUTAX_NETPRICE     = unitPrice;                          //含税净价
                    mod.N_DC_NOTAX_UNITPRICE    = n_notax_unitprice;                  //本币无税单价
                    mod.N_DC_INCLUTAX_UNITPRICE = unitPrice;                          //本币含税单价

                    mod.N_TAX = n_rate;                                               //税率

                    decimal n_nomoney = Convert.ToDecimal(n_wgt) * n_notax_unitprice; //无税金额
                    mod.N_NOMONEY = n_nomoney;                                        //无税金额

                    decimal n_pricetax_sum = Convert.ToDecimal(n_wgt) * unitPrice;    //价税合计
                    mod.N_PRICETAX_SUM    = n_pricetax_sum;                           //价税合计
                    mod.N_DC_PRICETAX_SUM = n_pricetax_sum;                           //本币价税合计

                    mod.N_ITEM_DIS = Convert.ToDecimal(dt.Rows[0]["N_DISCOUNT"]);     //单品折扣

                    mod.N_AMOUNT_FAX    = n_pricetax_sum - n_nomoney;                 //税额
                    mod.N_DC_AMOUNT_FAX = n_pricetax_sum - n_nomoney;                 //税额
                }
                #endregion

                #region  //获取执行标准/自由项/品种/类别 //设置质量设计号//订单-质量 //等级

                Mod_TQB_STD_MAIN mod_std_main = std_main.GetModel(c_std_code);
                if (mod_std_main != null)
                {
                    mod.C_PROD_NAME = mod_std_main.C_PROD_NAME; //类别
                    mod.C_PROD_KIND = mod_std_main.C_PROD_KIND; //品种
                    mod.C_STD_CODE  = mod_std_main.C_STD_CODE;  //执行标准代码
                }

                DataRow dr = std_config.GetFREE(c_std_code);
                if (dr != null)
                {
                    mod.C_FREE_TERM  = dr["C_ZYX1"].ToString();
                    mod.C_FREE_TERM2 = dr["C_ZYX2"].ToString();
                }

                mod.C_LEV = "普通";

                string PK_DESIGN_ID = "";                                      //质量设计号主键ID

                DataTable dtDesign = design.GetList("", c_std_code).Tables[0]; //质量设计信息
                if (dtDesign.Rows.Count > 0)
                {
                    mod.C_DESIGN_NO = dtDesign.Rows[0]["C_DESIGN_NO"].ToString(); //质量设计号
                    PK_DESIGN_ID    = dtDesign.Rows[0]["C_ID"].ToString();        //质量设计主键ID
                }

                #endregion


                bool result = false;

                if (condetails.Add(mod))
                {
                    //插入订单质量设计号
                    Mod_TQB_DESIGN_ORDER modDesign_Order = new Mod_TQB_DESIGN_ORDER();
                    modDesign_Order.C_ORDER_ID  = order_no;
                    modDesign_Order.C_DESIGN_ID = PK_DESIGN_ID;
                    result = design_order.Add(modDesign_Order);
                }
                return(result);
            }
        }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Mod_TQB_STD_MAIN model)
 {
     return(dal.Update(model));
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Mod_TQB_STD_MAIN model)
 {
     return(dal.Add(model));
 }
Beispiel #10
0
        private void btn_import_Click(object sender, EventArgs e)
        {
            try
            {
                WaitingFrom.ShowWait("");
                DataTable dt = ReadExcel(this.txtUrl.Text);
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        #region 导入订单
                        string        strGUID  = System.Guid.NewGuid().ToString();
                        Mod_TMO_ORDER modorder = new Mod_TMO_ORDER();
                        modorder.C_ID          = System.Guid.NewGuid().ToString();
                        modorder.C_ORDER_NO    = dt.Rows[i]["计划订单号"].ToString();
                        modorder.D_DT          = Convert.ToDateTime(dt.Rows[i]["计划日期"].ToString());
                        modorder.D_NEED_DT     = Convert.ToDateTime(dt.Rows[i]["需求日期"].ToString());
                        modorder.D_DELIVERY_DT = Convert.ToDateTime(dt.Rows[i]["交货日期"].ToString());
                        modorder.C_MAT_CODE    = dt.Rows[i]["物料编码"].ToString();
                        modorder.C_STL_GRD     = dt.Rows[i]["型号"].ToString();
                        modorder.C_SPEC        = dt.Rows[i]["规格"].ToString();
                        modorder.C_MAT_NAME    = dt.Rows[i]["工艺代码"].ToString();
                        Mod_TB_MATRL_MAIN modwl = bllwl.GetModel(modorder.C_MAT_CODE);

                        if (modwl != null)
                        {
                            modorder.C_INVBASDOCID = modwl.C_PK_INVBASDOC;
                            modorder.C_MAT_NAME    = modwl.C_MAT_NAME;
                            modorder.C_SPEC        = modwl.C_SPEC;
                            modorder.C_STL_GRD     = modwl.C_STL_GRD;
                        }
                        else
                        {
                            // continue;
                        }
                        modorder.C_FREE1 = dt.Rows[i]["产品标准"].ToString();
                        modorder.C_FREE2 = dt.Rows[i]["技术要求"].ToString();

                        Mod_TQB_STD_MAIN modbz = bllbz.GetModel(modorder.C_STL_GRD, modorder.C_FREE1, modorder.C_FREE2);
                        if (modbz != null)
                        {
                            modorder.C_STD_CODE = modbz.C_STD_CODE;
                        }
                        // modorder.C_STD_CODE=
                        modorder.C_PACK = dt.Rows[i]["包装"].ToString();
                        modorder.N_WGT  = Convert.ToDecimal(dt.Rows[i]["需求数量"].ToString());


                        modorder.C_AREA        = dt.Rows[i]["其他要求"].ToString();
                        modorder.C_TRANSMODE   = dt.Rows[i]["内部备注"].ToString();
                        modorder.C_ORDER_LEV   = dt.Rows[i]["订单级别"].ToString();
                        modorder.C_PRO_USE     = dt.Rows[i]["客户用途"].ToString();
                        modorder.N_PROD_WGT    = Convert.ToDecimal(dt.Rows[i]["完工数量"].ToString() == ""?"0": dt.Rows[i]["完工数量"].ToString());
                        modorder.N_EXEC_STATUS = 0;    //订单刚导入状态
                        modorder.N_TYPE        = 8;    //线材订单
                        modorder.N_STATUS      = 2;    //可执行
                        modorder.C_REMARK      = "导入"; //标志订单是导入的
                        modorder.C_CON_NO      = (Convert.ToInt64(System.DateTime.Now.ToString("yyMMdd") + "0001") + i).ToString();

                        if (Convert.ToDouble(modorder.N_PROD_WGT) < Convert.ToDouble(modorder.N_WGT) * 0.9)
                        {
                            modorder.N_WGT = modorder.N_WGT - modorder.N_PROD_WGT;
                            bllorder.Add(modorder);//生产量大于90%的视同完成
                        }

                        #endregion
                    }
                    MessageBox.Show("订单导入成功!");
                    WaitingFrom.CloseWait();
                    btn_query_main_Click(null, null);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #11
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Mod_TQB_STD_MAIN model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TQB_STD_MAIN(");
            strSql.Append("C_ID,C_STD_TYPE,C_STD_CODE,C_STD_DESC,C_STL_GRD,C_PROD_NAME,C_PROD_KIND,C_USES,n_EDIT_NUM,C_EDITION,C_IS_LF,C_IS_RH,C_IS_HL,C_IS_XM,C_IRON_REQUIRE,C_STOCK_REQUIRE,C_DELIVERY_STATE,C_PHYSICS_TIME,N_IS_CHECK,N_STATUS,C_REMARK,C_EMP_ID,C_IS_BXG)");
            strSql.Append(" values (");
            strSql.Append(":C_ID,:C_STD_TYPE,:C_STD_CODE,:C_STD_DESC,:C_STL_GRD,:C_PROD_NAME,:C_PROD_KIND,:C_USES,:n_EDIT_NUM,:C_EDITION,:C_IS_LF,:C_IS_RH,:C_IS_HL,:C_IS_XM,:C_IRON_REQUIRE,:C_STOCK_REQUIRE,:C_DELIVERY_STATE,:C_PHYSICS_TIME,:N_IS_CHECK,:N_STATUS,:C_REMARK,:C_EMP_ID,:C_IS_BXG)");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID",             OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STD_TYPE",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STD_CODE",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STD_DESC",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD",        OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PROD_NAME",      OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PROD_KIND",      OracleDbType.Varchar2, 100),
                new OracleParameter(":C_USES",           OracleDbType.Varchar2, 100),
                new OracleParameter(":n_EDIT_NUM",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_EDITION",        OracleDbType.Varchar2, 100),
                new OracleParameter(":C_IS_LF",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_IS_RH",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_IS_HL",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_IS_XM",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_IRON_REQUIRE",   OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STOCK_REQUIRE",  OracleDbType.Varchar2, 100),
                new OracleParameter(":C_DELIVERY_STATE", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PHYSICS_TIME",   OracleDbType.Varchar2, 100),
                new OracleParameter(":N_IS_CHECK",       OracleDbType.Decimal,    1),
                new OracleParameter(":N_STATUS",         OracleDbType.Decimal,    1),
                new OracleParameter(":C_REMARK",         OracleDbType.Varchar2, 500),
                new OracleParameter(":C_EMP_ID",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_IS_BXG",         OracleDbType.Varchar2, 100)
            };
            parameters[0].Value  = model.C_ID;
            parameters[1].Value  = model.C_STD_TYPE;
            parameters[2].Value  = model.C_STD_CODE;
            parameters[3].Value  = model.C_STD_DESC;
            parameters[4].Value  = model.C_STL_GRD;
            parameters[5].Value  = model.C_PROD_NAME;
            parameters[6].Value  = model.C_PROD_KIND;
            parameters[7].Value  = model.C_USES;
            parameters[8].Value  = model.N_EDIT_NUM;
            parameters[9].Value  = model.C_EDITION;
            parameters[10].Value = model.C_IS_LF;
            parameters[11].Value = model.C_IS_RH;
            parameters[12].Value = model.C_IS_HL;
            parameters[13].Value = model.C_IS_XM;
            parameters[14].Value = model.C_IRON_REQUIRE;
            parameters[15].Value = model.C_STOCK_REQUIRE;
            parameters[16].Value = model.C_DELIVERY_STATE;
            parameters[17].Value = model.C_PHYSICS_TIME;
            parameters[18].Value = model.N_IS_CHECK;
            parameters[19].Value = model.N_STATUS;
            parameters[20].Value = model.C_REMARK;
            parameters[21].Value = model.C_EMP_ID;
            parameters[22].Value = model.C_IS_BXG;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #12
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TQB_STD_MAIN DataRowToModel(DataRow row)
        {
            Mod_TQB_STD_MAIN model = new Mod_TQB_STD_MAIN();

            if (row != null)
            {
                if (row["C_ID"] != null)
                {
                    model.C_ID = row["C_ID"].ToString();
                }
                if (row["C_STD_TYPE"] != null)
                {
                    model.C_STD_TYPE = row["C_STD_TYPE"].ToString();
                }
                if (row["C_STD_CODE"] != null)
                {
                    model.C_STD_CODE = row["C_STD_CODE"].ToString();
                }
                if (row["C_STD_DESC"] != null)
                {
                    model.C_STD_DESC = row["C_STD_DESC"].ToString();
                }
                if (row["C_STL_GRD"] != null)
                {
                    model.C_STL_GRD = row["C_STL_GRD"].ToString();
                }
                if (row["C_PROD_NAME"] != null)
                {
                    model.C_PROD_NAME = row["C_PROD_NAME"].ToString();
                }
                if (row["C_PROD_KIND"] != null)
                {
                    model.C_PROD_KIND = row["C_PROD_KIND"].ToString();
                }
                if (row["C_USES"] != null)
                {
                    model.C_USES = row["C_USES"].ToString();
                }
                if (row["N_EDIT_NUM"] != null && row["N_EDIT_NUM"].ToString() != "")
                {
                    model.N_EDIT_NUM = decimal.Parse(row["N_EDIT_NUM"].ToString());
                }
                if (row["C_EDITION"] != null)
                {
                    model.C_EDITION = row["C_EDITION"].ToString();
                }
                if (row["C_IS_LF"] != null)
                {
                    model.C_IS_LF = row["C_IS_LF"].ToString();
                }
                if (row["C_IS_RH"] != null)
                {
                    model.C_IS_RH = row["C_IS_RH"].ToString();
                }
                if (row["C_IS_HL"] != null)
                {
                    model.C_IS_HL = row["C_IS_HL"].ToString();
                }
                if (row["C_IS_XM"] != null)
                {
                    model.C_IS_XM = row["C_IS_XM"].ToString();
                }
                if (row["C_IRON_REQUIRE"] != null)
                {
                    model.C_IRON_REQUIRE = row["C_IRON_REQUIRE"].ToString();
                }
                if (row["C_STOCK_REQUIRE"] != null)
                {
                    model.C_STOCK_REQUIRE = row["C_STOCK_REQUIRE"].ToString();
                }
                if (row["C_DELIVERY_STATE"] != null)
                {
                    model.C_DELIVERY_STATE = row["C_DELIVERY_STATE"].ToString();
                }
                if (row["C_PHYSICS_TIME"] != null)
                {
                    model.C_PHYSICS_TIME = row["C_PHYSICS_TIME"].ToString();
                }
                if (row["N_IS_CHECK"] != null && row["N_IS_CHECK"].ToString() != "")
                {
                    model.N_IS_CHECK = decimal.Parse(row["N_IS_CHECK"].ToString());
                }
                if (row["N_STATUS"] != null && row["N_STATUS"].ToString() != "")
                {
                    model.N_STATUS = decimal.Parse(row["N_STATUS"].ToString());
                }
                if (row["C_REMARK"] != null)
                {
                    model.C_REMARK = row["C_REMARK"].ToString();
                }
                if (row["C_EMP_ID"] != null)
                {
                    model.C_EMP_ID = row["C_EMP_ID"].ToString();
                }
                if (row["D_MOD_DT"] != null && row["D_MOD_DT"].ToString() != "")
                {
                    model.D_MOD_DT = DateTime.Parse(row["D_MOD_DT"].ToString());
                }
                if (row["C_IS_BXG"] != null)
                {
                    model.C_IS_BXG = row["C_IS_BXG"].ToString();
                }
            }
            return(model);
        }
Beispiel #13
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Mod_TQB_STD_MAIN model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TQB_STD_MAIN set ");
            strSql.Append("C_STD_TYPE=:C_STD_TYPE,");
            strSql.Append("C_STD_CODE=:C_STD_CODE,");
            strSql.Append("C_STD_DESC=:C_STD_DESC,");
            strSql.Append("C_STL_GRD=:C_STL_GRD,");
            strSql.Append("C_PROD_NAME=:C_PROD_NAME,");
            strSql.Append("C_PROD_KIND=:C_PROD_KIND,");
            strSql.Append("C_USES=:C_USES,");
            strSql.Append("n_EDIT_NUM=:n_EDIT_NUM,");
            strSql.Append("C_EDITION=:C_EDITION,");
            strSql.Append("C_IS_LF=:C_IS_LF,");
            strSql.Append("C_IS_RH=:C_IS_RH,");
            strSql.Append("C_IS_HL=:C_IS_HL,");
            strSql.Append("C_IS_XM=:C_IS_XM,");
            strSql.Append("C_IRON_REQUIRE=:C_IRON_REQUIRE,");
            strSql.Append("C_STOCK_REQUIRE=:C_STOCK_REQUIRE,");
            strSql.Append("C_DELIVERY_STATE=:C_DELIVERY_STATE,");
            strSql.Append("C_PHYSICS_TIME=:C_PHYSICS_TIME,");
            strSql.Append("N_IS_CHECK=:N_IS_CHECK,");
            strSql.Append("N_STATUS=:N_STATUS,");
            strSql.Append("C_REMARK=:C_REMARK,");
            strSql.Append("C_EMP_ID=:C_EMP_ID,");
            strSql.Append("D_MOD_DT=:D_MOD_DT,");
            strSql.Append("C_IS_BXG=:C_IS_BXG");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_STD_TYPE",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STD_CODE",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STD_DESC",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD",        OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PROD_NAME",      OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PROD_KIND",      OracleDbType.Varchar2, 100),
                new OracleParameter(":C_USES",           OracleDbType.Varchar2, 100),
                new OracleParameter(":n_EDIT_NUM",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_EDITION",        OracleDbType.Varchar2, 100),
                new OracleParameter(":C_IS_LF",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_IS_RH",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_IS_HL",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_IS_XM",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_IRON_REQUIRE",   OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STOCK_REQUIRE",  OracleDbType.Varchar2, 100),
                new OracleParameter(":C_DELIVERY_STATE", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PHYSICS_TIME",   OracleDbType.Varchar2, 100),
                new OracleParameter(":N_IS_CHECK",       OracleDbType.Decimal,    1),
                new OracleParameter(":N_STATUS",         OracleDbType.Decimal,    1),
                new OracleParameter(":C_REMARK",         OracleDbType.Varchar2, 500),
                new OracleParameter(":C_EMP_ID",         OracleDbType.Varchar2, 100),
                new OracleParameter(":D_MOD_DT",         OracleDbType.Date),
                new OracleParameter(":C_IS_BXG",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ID",             OracleDbType.Varchar2, 100)
            };
            parameters[0].Value  = model.C_STD_TYPE;
            parameters[1].Value  = model.C_STD_CODE;
            parameters[2].Value  = model.C_STD_DESC;
            parameters[3].Value  = model.C_STL_GRD;
            parameters[4].Value  = model.C_PROD_NAME;
            parameters[5].Value  = model.C_PROD_KIND;
            parameters[6].Value  = model.C_USES;
            parameters[7].Value  = model.N_EDIT_NUM;
            parameters[8].Value  = model.C_EDITION;
            parameters[9].Value  = model.C_IS_LF;
            parameters[10].Value = model.C_IS_RH;
            parameters[11].Value = model.C_IS_HL;
            parameters[12].Value = model.C_IS_XM;
            parameters[13].Value = model.C_IRON_REQUIRE;
            parameters[14].Value = model.C_STOCK_REQUIRE;
            parameters[15].Value = model.C_DELIVERY_STATE;
            parameters[16].Value = model.C_PHYSICS_TIME;
            parameters[17].Value = model.N_IS_CHECK;
            parameters[18].Value = model.N_STATUS;
            parameters[19].Value = model.C_REMARK;
            parameters[20].Value = model.C_EMP_ID;
            parameters[21].Value = model.D_MOD_DT;
            parameters[22].Value = model.C_IS_BXG;
            parameters[23].Value = model.C_ID;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #14
0
        /// <summary>
        /// 获取NC正式库数据列表
        /// </summary>
        /// <param name="type">NC正式库/测试</param>
        /// <returns></returns>
        public List <Mod_TSC_SLAB_MAIN> Get_GPKNCZS(string type)
        {
            DataTable dtnc = null;

            if (type == "NC正式库")
            {
                dtnc = bll_slab.GetNCGPK();
            }
            else
            {
                dtnc = bll_slab.GetNCCSGPK();
            }
            List <Mod_TSC_SLAB_MAIN> lst = new List <Mod_TSC_SLAB_MAIN>();

            if (dtnc.Rows.Count > 0)
            {
                for (int i = 0; i < dtnc.Rows.Count; i++)
                {
                    string dd  = dtnc.Rows[i]["辅数量"].ToString();
                    int    num = 0;
                    try
                    {
                        num = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(dtnc.Rows[i]["辅数量"].ToString())));//支数
                    }
                    catch (Exception)
                    {
                        num = 10;
                    }
                    string lh  = "";
                    string pch = "";
                    if (dtnc.Rows[i]["连铸炉号"].ToString().Trim() != "")
                    {
                        lh  = dtnc.Rows[i]["连铸炉号"].ToString();
                        pch = dtnc.Rows[i]["批次号"].ToString();
                    }
                    else
                    {
                        lh  = dtnc.Rows[i]["批次号"].ToString();
                        pch = "";
                    }
                    decimal           wgt    = Convert.ToDecimal(Convert.ToDouble(dtnc.Rows[i]["数量"].ToString())) / Convert.ToDecimal(dtnc.Rows[i]["辅数量"].ToString()); //单重
                    Mod_TB_MATRL_MAIN motral = bll_matrl.GetModel(dtnc.Rows[i]["INVCODE"].ToString());
                    string            zyx1   = dtnc.Rows[i]["VFREE1"].ToString();                                                                                      //自由项1
                    string            zyx2   = dtnc.Rows[i]["VFREE2"].ToString();                                                                                      //自由项2
                    string            bz     = zyx1.Split('~')[1].Contains("协议") ? zyx2.Split('~')[1] : zyx1.Split('~')[1];                                            //执行标准//
                    string            zyx3   = dtnc.Rows[i]["VFREE3"].ToString();                                                                                      //自由项3
                    DateTime          wedate = Convert.ToDateTime(dtnc.Rows[i]["生产入库日期"].ToString());                                                                  //生产入库时间
                    string            wlid   = dtnc.Rows[i]["INVCODE"].ToString();                                                                                     //物料编码
                    string            wumc   = dtnc.Rows[i]["INVNAME"].ToString();                                                                                     //物料名称
                    string            hw     = dtnc.Rows[i]["STORCODE"].ToString();                                                                                    //仓库
                    Mod_TQB_STD_MAIN  modbz  = bll_bz.GetModel(motral.C_STL_GRD, zyx1, zyx2);
                    for (int j = 0; j < num; j++)
                    {
                        Mod_TSC_SLAB_MAIN mod = new Mod_TSC_SLAB_MAIN();
                        mod.C_PLAN_ID  = type;
                        mod.C_STOVE    = lh;
                        mod.C_ID       = System.Guid.NewGuid().ToString();
                        mod.C_BATCH_NO = pch;

                        if (mod.C_STOVE == "24")
                        {
                            mod.C_STA_ID   = "890EAA2949E743AFB26C06B8D4209B17";
                            mod.C_STA_CODE = "3#CC";
                            mod.C_STA_DESC = "3#铸机";
                        }
                        else if (mod.C_STOVE == "23")
                        {
                            mod.C_STA_ID   = "5263048C90B44B4D9934C513CE028250";
                            mod.C_STA_CODE = "4#CC";
                            mod.C_STA_DESC = "4#铸机";
                        }
                        else if (mod.C_STOVE == "61")
                        {
                            mod.C_STA_ID   = "01C145B259E740F6A258AF313DD9268C";
                            mod.C_STA_CODE = "6#CC";
                            mod.C_STA_DESC = "6#铸机";
                        }
                        else
                        {
                            mod.C_STA_ID   = "77B9FDA79B884D07AA2B3601D1DA11A2";
                            mod.C_STA_CODE = "5#CC";
                            mod.C_STA_DESC = "5#铸机";
                        }
                        mod.D_WE_DATE   = wedate;
                        mod.C_MAT_CODE  = wlid;
                        mod.C_MAT_NAME  = wumc;
                        mod.C_SPEC      = motral.C_SLAB_SIZE;;
                        mod.N_LEN       = motral.N_LTH;
                        mod.C_STL_GRD   = motral.C_STL_GRD;
                        mod.N_WGT       = wgt;
                        mod.C_SCUTCHEON = "白牌";
                        mod.N_QUA       = 1;
                        if (modbz != null)
                        {
                            mod.C_STD_CODE = modbz.C_STD_CODE;
                        }
                        if (mod.C_STD_CODE == "")
                        {
                            mod.C_STD_CODE = bz.Replace(" ", "").Replace("(", "(").Replace(")", ")");
                        }
                        mod.C_MOVE_TYPE    = "M";
                        mod.D_CCM_DATE     = wedate.AddHours(-2);
                        mod.C_STOCK_STATE  = "F";
                        mod.C_MAT_TYPE     = "合格品";
                        mod.C_JUDGE_LEV_ZH = "合格品";
                        //mod.C_ISXM = "N";
                        mod.C_ZYX1        = zyx1;
                        mod.C_ZYX2        = zyx2;
                        mod.C_IS_QR       = "Y";
                        mod.C_SLABWH_CODE = hw;
                        lst.Add(mod);
                    }
                }

                return(lst);
            }
            return(null);
        }