Beispiel #1
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Save2_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(cbo_FA.Text.Trim()))
            {
                MessageBox.Show("请选择方案号!");
                return;
            }

            if (string.IsNullOrEmpty(btnEdit_Std.Text.Trim()))
            {
                MessageBox.Show("请选择执行标准!");
                return;
            }

            if (string.IsNullOrEmpty(txt_Std_Grd.Text.Trim()))
            {
                MessageBox.Show("请填写钢种!");
                return;
            }

            if (string.IsNullOrEmpty(cbo_CC.Text.Trim()) || cbo_CC.Text == "全部")
            {
                MessageBox.Show("请选择连铸!");
                return;
            }

            if (string.IsNullOrEmpty(txt_Wgt.Text.Trim()))
            {
                MessageBox.Show("请填写重量!");
                return;
            }
            else
            {
                double result = 0;
                if (!double.TryParse(txt_Wgt.Text.Trim(), out result))
                {
                    MessageBox.Show("填写的重量不符合规范!");
                    return;
                }
            }

            Mod_TMO_ORDER modeOrder = new Mod_TMO_ORDER();

            modeOrder.C_ORDER_NO = "SD-" + DateTime.Now.ToString("yyyyMMddHHmmss"); //订单号
            modeOrder.C_CON_NO   = "SD-" + DateTime.Now.ToString("yyyyMMddHHmmss"); //合同号
            modeOrder.C_STL_GRD  = txt_Std_Grd.Text.Trim();                         //钢种
            modeOrder.C_STD_CODE = btnEdit_Std.Text.Trim();                         //执行标准
            modeOrder.N_STATUS   = 2;                                               //订单状态
            modeOrder.N_WGT      = Convert.ToDecimal(txt_Wgt.Text.Trim());          //订单重量
            modeOrder.N_TYPE     = 6;                                               //6钢坯;8线材
            modeOrder.C_EMP_ID   = RV.UI.UserInfo.userID;
            modeOrder.C_MAT_CODE = txt_MatCode.Text.Trim();                         //物料编码
            modeOrder.C_MAT_NAME = txt_MatName.Text.Trim();                         //物料名称
            modeOrder.C_SPEC     = txt_Spec.Text.Trim();                            //断面

            if (bll_TMO_ORDER.Add(modeOrder))
            {
                string s_id = bll_TMO_ORDER.Get_ID(modeOrder.C_ORDER_NO, modeOrder.C_CON_NO, modeOrder.C_STL_GRD, modeOrder.C_STD_CODE);

                Mod_TPP_INITIALIZE_ORDER modINITIALIZEORDER = new Mod_TPP_INITIALIZE_ORDER();
                modINITIALIZEORDER.C_INITIALIZE_ID = cbo_FA.EditValue.ToString();
                modINITIALIZEORDER.C_ORDER_ID      = s_id;
                modINITIALIZEORDER.N_WGT           = Convert.ToDecimal(txt_Wgt.Text.Trim());//订单重量
                modINITIALIZEORDER.C_CCM_STA_ID    = cbo_CC.EditValue.ToString();
                modINITIALIZEORDER.C_EMP_ID        = RV.UI.UserInfo.userID;
                bll_ini_order.Add(modINITIALIZEORDER);

                MessageBox.Show("订单手动增加成功!");

                Common.UserLog.AddLog(strMenuName, this.Name, this.Text, "手动添加订单");//添加操作日志
            }
        }