Beispiel #1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TQB_TSBZ_CF GetModel_GZ(string C_NAME, decimal N_TARGET_VALUE, string C_PRO_CONDITION_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_CHARACTER_ID,C_CODE,C_NAME,N_TARGET_VALUE,N_STATUS,C_REMARK,C_EMP_ID,D_MOD_DT,C_STD_CODE,C_STL_GRD,C_PRO_CONDITION_ID from TQB_TSBZ_CF ");
            strSql.Append(" where  C_NAME=:C_NAME AND N_TARGET_VALUE=:N_TARGET_VALUE  AND C_PRO_CONDITION_ID=:C_PRO_CONDITION_ID  AND N_STATUS=1");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_NAME",             OracleDbType.Varchar2, 100),
                new OracleParameter(":N_TARGET_VALUE",     OracleDbType.Decimal,   15),
                new OracleParameter(":C_PRO_CONDITION_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_NAME;
            parameters[1].Value = N_TARGET_VALUE;
            parameters[2].Value = C_PRO_CONDITION_ID;

            Mod_TQB_TSBZ_CF model = new Mod_TQB_TSBZ_CF();
            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 #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TQB_TSBZ_CF DataRowToModel(DataRow row)
        {
            Mod_TQB_TSBZ_CF model = new Mod_TQB_TSBZ_CF();

            if (row != null)
            {
                if (row["C_ID"] != null)
                {
                    model.C_ID = row["C_ID"].ToString();
                }

                if (row["C_CHARACTER_ID"] != null)
                {
                    model.C_CHARACTER_ID = row["C_CHARACTER_ID"].ToString();
                }
                if (row["C_CODE"] != null)
                {
                    model.C_CODE = row["C_CODE"].ToString();
                }
                if (row["C_NAME"] != null)
                {
                    model.C_NAME = row["C_NAME"].ToString();
                }
                if (row["N_TARGET_VALUE"] != null && row["N_TARGET_VALUE"].ToString() != "")
                {
                    model.N_TARGET_VALUE = decimal.Parse(row["N_TARGET_VALUE"].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_STD_CODE"] != null)
                {
                    model.C_STD_CODE = row["C_STD_CODE"].ToString();
                }
                if (row["C_STL_GRD"] != null)
                {
                    model.C_STL_GRD = row["C_STL_GRD"].ToString();
                }
                if (row["C_PRO_CONDITION_ID"] != null)
                {
                    model.C_PRO_CONDITION_ID = row["C_PRO_CONDITION_ID"].ToString();
                }
            }
            return(model);
        }
Beispiel #3
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Mod_TQB_TSBZ_CF model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TQB_TSBZ_CF set ");
            strSql.Append("C_CHARACTER_ID=:C_CHARACTER_ID,");
            strSql.Append("C_CODE=:C_CODE,");
            strSql.Append("C_NAME=:C_NAME,");
            strSql.Append("N_TARGET_VALUE=:N_TARGET_VALUE,");
            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_STD_CODE=:C_STD_CODE,");
            strSql.Append("C_STL_GRD=:C_STL_GRD,");
            strSql.Append("C_PRO_CONDITION_ID=:C_PRO_CONDITION_ID");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_CHARACTER_ID",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CODE",             OracleDbType.Varchar2, 100),
                new OracleParameter(":C_NAME",             OracleDbType.Varchar2, 100),
                new OracleParameter(":N_TARGET_VALUE",     OracleDbType.Decimal,   15),
                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_STD_CODE",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PRO_CONDITION_ID", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ID",               OracleDbType.Varchar2, 100)
            };
            parameters[0].Value  = model.C_CHARACTER_ID;
            parameters[1].Value  = model.C_CODE;
            parameters[2].Value  = model.C_NAME;
            parameters[3].Value  = model.N_TARGET_VALUE;
            parameters[4].Value  = model.N_STATUS;
            parameters[5].Value  = model.C_REMARK;
            parameters[6].Value  = model.C_EMP_ID;
            parameters[7].Value  = model.D_MOD_DT;
            parameters[8].Value  = model.C_STD_CODE;
            parameters[9].Value  = model.C_STL_GRD;
            parameters[10].Value = model.C_PRO_CONDITION_ID;
            parameters[11].Value = model.C_ID;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #4
0
        /// <summary>
        /// 铁水条件导入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButton4_Click(object sender, EventArgs e)
        {
            try
            {
                // DataTable dt = OpenExcelFile(this.txtUrl.Text, "Sheet2");
                DataTable dt = ReadExcel(this.txtUrl.Text);
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        string strGUID = System.Guid.NewGuid().ToString();

                        string  jhgz   = Regex.Replace(dt.Rows[i][0].ToString(), @"\s", ""); //计划钢种
                        string  jhbz   = Regex.Replace(dt.Rows[i][1].ToString(), @"\s", ""); //计划文件号
                        string  name   = dt.Rows[i][2].ToString().Trim();                    //成分名称
                        int     result = 0;
                        decimal values = 0;
                        if (int.TryParse(dt.Rows[i][3].ToString(), out result))
                        {
                            values = 0;
                        }
                        else
                        {
                            values = Convert.ToDecimal(dt.Rows[i][3]);
                        }

                        Mod_TPB_STEEL_PRO_CONDITION model = bll_steel_pro.GetModel(jhgz, jhbz);
                        string zbID = "";//钢种生产条件表主键
                        if (model != null)
                        {
                            zbID = model.C_ID;
                            Mod_TQB_TSBZ_CF modis = bll_tstj_cf.GetModel_GZ(name, values, zbID);
                            if (modis == null)
                            {
                                Mod_TQB_TSBZ_CF modb = new Mod_TQB_TSBZ_CF();
                                modb.C_ID = strGUID;
                                modb.C_PRO_CONDITION_ID = zbID;
                                modb.C_STL_GRD          = jhgz.Trim();
                                modb.C_STD_CODE         = jhbz.Trim();
                                modb.C_NAME             = dt.Rows[i][2].ToString().Trim();
                                modb.N_TARGET_VALUE     = values;
                                modb.C_REMARK           = dt.Rows[i][4].ToString().Trim();
                                modb.C_EMP_ID           = RV.UI.UserInfo.UserID;
                                bll_tstj_cf.Add(modb);
                            }
                        }
                    }
                    MessageBox.Show("导入成功!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #5
0
 /// <summary>
 /// 导入Excle模板数据
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btn_import_Click(object sender, EventArgs e)
 {
     try
     {
         // DataTable dt = OpenExcelFile(this.txtUrl.Text, "Sheet2");
         DataTable dt = ReadExcel(this.txtUrl.Text);
         if (dt.Rows.Count > 0)
         {
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 string            strGUID = System.Guid.NewGuid().ToString();
                 Mod_TQB_TSBZ_MAIN model   = new Mod_TQB_TSBZ_MAIN();
                 model.C_ID        = strGUID;                  //主键
                 model.C_PROD_KIND = dt.Rows[i][0].ToString(); //钢种分类
                 model.C_STL_GRD   = dt.Rows[i][1].ToString(); //钢种
                 model.C_XY_CODE   = dt.Rows[i][2].ToString(); //协议号
                 model.C_ROUTE     = dt.Rows[i][3].ToString(); //工艺
                 model.C_REMARK    = dt.Rows[i][4].ToString(); //备注
                 model.C_IS_OFTEN  = dt.Rows[i][5].ToString(); //是否常用
                 //model.C_REMARK_JB = dt.Rows[i][6].ToString();//备注级别
                 model.C_EMP_ID = dt.Rows[i][6].ToString();    //负责人
                 bool res = bllTsbz_Main.Add(model);
                 if (res)
                 {
                     for (int j = 7; j < 27; j++)//成分信息
                     {
                         string nvalue = dt.Rows[i][j].ToString().Trim().Replace("-", "");
                         if (nvalue != "")
                         {
                             string          itemName = dt.Columns[j].ColumnName;
                             Mod_TQB_TSBZ_CF modcf    = new Mod_TQB_TSBZ_CF();
                             //  modcf.C_TSBZ_MAIN_ID = strGUID;
                             modcf.C_EMP_ID = RV.UI.UserInfo.userName;
                             modcf.C_NAME   = itemName;
                             try
                             {
                                 modcf.N_TARGET_VALUE = Convert.ToDecimal(nvalue);
                             }
                             catch (Exception)
                             {
                                 modcf.N_TARGET_VALUE = -1;
                             }
                             bool rescf = bllTsbz_CF.Add(modcf);
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Beispiel #6
0
        /// <summary>
        /// 停用字表信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_stop_cf_Click(object sender, EventArgs e)
        {
            try
            {
                if (DialogResult.No == MessageBox.Show("是否确认停用选中的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1))
                {
                    return;
                }

                int   selectedNum = this.gv_tsbz_cf.SelectedRowsCount;
                int   commitNum   = 0;                                 //停用记录数量
                int   failtNum    = 0;                                 //停用失败数量
                int[] rownumber   = this.gv_tsbz_cf.GetSelectedRows(); //获取选中行号数组;
                for (int i = 0; i < rownumber.Length; i++)
                {
                    int    selectedHandle = rownumber[i];
                    string strID          = this.gv_tsbz_cf.GetRowCellValue(selectedHandle, "C_ID").ToString();

                    Mod_TQB_TSBZ_CF model = bllTsbz_CF.GetModel(strID);
                    model.N_STATUS = 0;
                    model.C_EMP_ID = RV.UI.UserInfo.userID;
                    model.D_MOD_DT = RV.UI.ServerTime.timeNow();
                    bool update = bllTsbz_CF.Update(model);
                    if (update)
                    {
                        commitNum = commitNum + 1;
                    }
                    else
                    {
                        failtNum = failtNum + 1;
                    }
                }
                MessageBox.Show("选择" + selectedNum.ToString() + "条记录,停用" + commitNum.ToString() + "条记录!");

                Common.UserLog.AddLog(strMenuName, this.Name, this.Text, "停用铁水成分信息");//添加操作日志

                BindCF(this.lbl_tsbz_main_id.Text, this.rbtn_isty_cf.SelectedIndex == 0 ? 1 : 0);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #7
0
        /// <summary>
        /// 获取铁水成分列表焦点行信息
        /// </summary>
        public void BindFocusedRowCF()
        {
            int selectedHandle = this.gv_tsbz_cf.FocusedRowHandle;//获取焦点行索引

            if (selectedHandle < 0)
            {
                this.lbl_CFID.Text      = "";
                this.groupControl2.Text = "标准成分";
                return;
            }
            this.lbl_CFID.Text = this.gv_tsbz_cf.GetRowCellValue(selectedHandle, "C_ID").ToString();//获取焦点行主键
            //根据主键得到铁水标准对象,并在界面赋值
            Mod_TQB_TSBZ_CF model = bllTsbz_CF.GetModel(this.lbl_CFID.Text);

            this.imgcbo_item.EditValue = model.C_CODE;
            this.txt_value.Text        = model.N_TARGET_VALUE.ToString();
            this.txt_remark_cf.Text    = model.C_REMARK;
            this.groupControl2.Text    = "标准成分:" + this.cbo_stl_grd.Text + "(" + this.cbo_std_code.Text + ")";
        }
Beispiel #8
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Mod_TQB_TSBZ_CF model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TQB_TSBZ_CF(");
            strSql.Append("C_CHARACTER_ID,C_CODE,C_NAME,N_TARGET_VALUE,C_REMARK,C_EMP_ID,C_STD_CODE,C_STL_GRD,C_PRO_CONDITION_ID)");
            strSql.Append(" values (");
            strSql.Append(":C_CHARACTER_ID,:C_CODE,:C_NAME,:N_TARGET_VALUE,:C_REMARK,:C_EMP_ID,:C_STD_CODE,:C_STL_GRD,:C_PRO_CONDITION_ID)");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_CHARACTER_ID",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CODE",             OracleDbType.Varchar2, 100),
                new OracleParameter(":C_NAME",             OracleDbType.Varchar2, 100),
                new OracleParameter(":N_TARGET_VALUE",     OracleDbType.Decimal),
                new OracleParameter(":C_REMARK",           OracleDbType.Varchar2, 500),
                new OracleParameter(":C_EMP_ID",           OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STD_CODE",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PRO_CONDITION_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = model.C_CHARACTER_ID;
            parameters[1].Value = model.C_CODE;
            parameters[2].Value = model.C_NAME;
            parameters[3].Value = model.N_TARGET_VALUE;
            parameters[4].Value = model.C_REMARK;
            parameters[5].Value = model.C_EMP_ID;
            parameters[6].Value = model.C_STD_CODE;
            parameters[7].Value = model.C_STL_GRD;
            parameters[8].Value = model.C_PRO_CONDITION_ID;
            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #9
0
        /// <summary>
        /// 保存子表信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_save_cf_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.lbl_tsbz_main_id.Text.Trim() == "")
                {
                    MessageBox.Show("请选择要求添加成分信息的主表!");
                    return;
                }

                #region 验证信息
                if (this.imgcbo_item.SelectedIndex < 0)
                {
                    MessageBox.Show("请选择项目名称!");
                    this.imgcbo_item.Focus();
                    return;
                }
                if (this.txt_value.Text.Trim().Length == 0)
                {
                    MessageBox.Show("请输入目标值!");
                    this.txt_value.Focus();
                    return;
                }

                #endregion

                bool   res = false;
                string str = "";
                if (this.lbl_CFID.Text == "")
                {
                    if (DialogResult.No == MessageBox.Show("是否确认添加记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1))
                    {
                        return;
                    }

                    Mod_TQB_TSBZ_CF model = new Mod_TQB_TSBZ_CF();
                    model.C_CHARACTER_ID = this.lbl_tsbz_main_id.Text;
                    model.C_CODE         = this.imgcbo_item.Properties.Items[this.imgcbo_item.SelectedIndex].Value.ToString();
                    model.C_NAME         = this.imgcbo_item.Properties.Items[this.imgcbo_item.SelectedIndex].Description.ToString();
                    model.N_TARGET_VALUE = Convert.ToDecimal(this.txt_value.Text);
                    model.C_REMARK       = this.txt_remark_cf.Text;
                    // model.C_TSBZ_MAIN_ID = this.lbl_tsbz_main_id.Text;
                    model.C_EMP_ID = RV.UI.UserInfo.userID;

                    System.Collections.Hashtable ht = new System.Collections.Hashtable();
                    ht.Add("C_CODE", model.C_CODE);

                    if (Common.CheckRepeat.CheckTable("TQB_TSBZ_CF", ht) > 0)
                    {
                        MessageBox.Show("已存在该数据!");
                        return;
                    }
                    else
                    {
                        res = bllTsbz_CF.Add(model);
                    }
                    Common.UserLog.AddLog(strMenuName, this.Name, this.Text, "添加铁水成分信息");//添加操作日志
                }
                else
                {
                    if (DialogResult.No == MessageBox.Show("是否确认编辑选中的记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1))
                    {
                        return;
                    }
                    Mod_TQB_TSBZ_CF model = bllTsbz_CF.GetModel(this.lbl_CFID.Text);
                    model.C_CHARACTER_ID = this.lbl_tsbz_main_id.Text;
                    model.C_CODE         = this.imgcbo_item.Properties.Items[this.imgcbo_item.SelectedIndex].Value.ToString();
                    model.C_NAME         = this.imgcbo_item.Properties.Items[this.imgcbo_item.SelectedIndex].Description.ToString();
                    model.N_TARGET_VALUE = Convert.ToDecimal(this.txt_value.Text);
                    model.C_REMARK       = this.txt_remark_cf.Text;
                    model.C_EMP_ID       = RV.UI.UserInfo.userID;
                    model.D_MOD_DT       = RV.UI.ServerTime.timeNow();
                    res = bllTsbz_CF.Update(model);

                    Common.UserLog.AddLog(strMenuName, this.Name, this.Text, "修改铁水成分信息");//添加操作日志
                }
                if (res)
                {
                    MessageBox.Show("操作成功!");
                    BindCF(this.lbl_tsbz_main_id.Text, this.rbtn_isty_cf.SelectedIndex == 0 ? 1 : 0);
                    //btn_Reset_main_Click(null, null);//清空控件
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #10
0
        /// <summary>
        /// 复制
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Copy_Add_Click(object sender, EventArgs e)
        {
            try
            {
                DataRow dr = this.gv_Main.GetDataRow(this.gv_Main.FocusedRowHandle);
                if (dr != null)
                {
                    if (DialogResult.OK != MessageBox.Show("是否确认复制?", "提示", MessageBoxButtons.OKCancel))
                    {
                        return;
                    }
                    string strID = "";
                    #region 钢种生产条件主表复制添加
                    Mod_TPB_STEEL_PRO_CONDITION mod     = new Mod_TPB_STEEL_PRO_CONDITION();
                    Mod_TPB_STEEL_PRO_CONDITION mod_log = bll_steel_pro.GetModel(dr["C_ID"].ToString());
                    mod.C_ID              = Guid.NewGuid().ToString();
                    mod.C_STD_CODE        = mod_log.C_STD_CODE;
                    mod.C_STL_GRD_TYPE    = mod_log.C_STL_GRD_TYPE;
                    mod.C_STL_GRD_RANK    = mod_log.C_STL_GRD_RANK;
                    mod.C_STL_GRD         = mod_log.C_STL_GRD;
                    mod.C_STL_SCRAP_TYPE  = mod_log.C_STL_SCRAP_TYPE;
                    mod.C_STL_SCRAP_FLIJ  = mod_log.C_STL_SCRAP_FLIJ;
                    mod.C_GOUTE           = mod_log.C_GOUTE;
                    mod.C_TEASE_PERSON    = mod_log.C_TEASE_PERSON;
                    mod.C_ADV_PRO_REQUIRE = mod_log.C_ADV_PRO_REQUIRE;
                    mod.C_REMARK          = mod_log.C_REMARK;
                    mod.C_EMP_ID          = RV.UI.UserInfo.UserID;
                    mod.D_MOD_DT          = RV.UI.ServerTime.timeNow();
                    mod.C_IS_BXG          = mod_log.C_IS_BXG;
                    mod.N_STATUS          = 0;
                    bll_steel_pro.Add(mod);
                    strID = mod.C_ID;
                    #endregion

                    #region 相邻钢种复制添加
                    for (int i = 0; i < gv_TPB_BORDER_GRD.DataRowCount; i++)
                    {
                        DataRow            dr_GRD  = this.gv_TPB_BORDER_GRD.GetDataRow(i);
                        Mod_TPB_BORDER_GRD mod_GRD = new Mod_TPB_BORDER_GRD();
                        mod_GRD.C_BORDER_STL_GRD  = dr_GRD["C_BORDER_STL_GRD"].ToString();
                        mod_GRD.C_BORDER_STD_CODE = dr_GRD["C_BORDER_STD_CODE"].ToString();
                        if (!string.IsNullOrEmpty(dr_GRD["N_LEVEL"].ToString()))
                        {
                            mod_GRD.N_LEVEL = Convert.ToDecimal(dr_GRD["N_LEVEL"]);
                        }
                        else
                        {
                            mod_GRD.N_LEVEL = null;
                        }

                        mod_GRD.C_PRO_CONDITION_ID = strID;
                        mod_GRD.C_SLAB_REQUIRE     = dr_GRD["C_SLAB_REQUIRE"].ToString();
                        mod_GRD.C_EMP_ID           = RV.UI.UserInfo.userID;
                        mod_GRD.C_REMARK           = dr_GRD["C_REMARK"].ToString();
                        bll_border_grd.Add(mod_GRD);
                    }
                    #endregion

                    #region 浇次首尾炉钢种复制添加
                    for (int i = 0; i < gv_TPB_ENDTOEND_GRD.DataRowCount; i++)
                    {
                        DataRow dr_ENDTOEND = this.gv_TPB_ENDTOEND_GRD.GetDataRow(i);
                        Mod_TPB_ENDTOEND_GRD mod_ENDTOEND = new Mod_TPB_ENDTOEND_GRD();
                        mod_ENDTOEND.C_B_E_STOVE       = dr_ENDTOEND["C_B_E_STOVE"].ToString();
                        mod_ENDTOEND.C_B_E_STOVE_STEEL = dr_ENDTOEND["C_B_E_STOVE_STEEL"].ToString();
                        mod_ENDTOEND.C_BORDER_STD_CODE = dr_ENDTOEND["C_BORDER_STD_CODE"].ToString();
                        if (!string.IsNullOrEmpty(dr_ENDTOEND["N_LEVEL"].ToString()))
                        {
                            mod_ENDTOEND.N_LEVEL = Convert.ToDecimal(dr_ENDTOEND["N_LEVEL"]);
                        }
                        else
                        {
                            mod_ENDTOEND.N_LEVEL = null;
                        }

                        mod_ENDTOEND.C_PRO_CONDITION_ID = strID;
                        mod_ENDTOEND.C_EMP_ID           = RV.UI.UserInfo.userID;
                        mod_ENDTOEND.C_REMARK           = dr_ENDTOEND["C_REMARK"].ToString();
                        bll_endtoend.Add(mod_ENDTOEND);
                    }
                    #endregion

                    #region 涮槽钢种复制添加
                    for (int i = 0; i < gv_TPB_RINSE_GRD.DataRowCount; i++)
                    {
                        DataRow           dr_RINSE_GRD  = this.gv_TPB_RINSE_GRD.GetDataRow(i);
                        Mod_TPB_RINSE_GRD mod_RINSE_GRD = new Mod_TPB_RINSE_GRD();
                        mod_RINSE_GRD.C_RINSE_GRD      = dr_RINSE_GRD["C_RINSE_GRD"].ToString();
                        mod_RINSE_GRD.C_RINSE_STD_CODE = dr_RINSE_GRD["C_RINSE_STD_CODE"].ToString();
                        if (!string.IsNullOrEmpty(dr_RINSE_GRD["N_LEVEL"].ToString()))
                        {
                            mod_RINSE_GRD.N_LEVEL = Convert.ToDecimal(dr_RINSE_GRD["N_LEVEL"]);
                        }
                        else
                        {
                            mod_RINSE_GRD.N_LEVEL = null;
                        }

                        mod_RINSE_GRD.C_PRO_CONDITION_ID = strID;
                        mod_RINSE_GRD.C_EMP_ID           = RV.UI.UserInfo.userID;
                        mod_RINSE_GRD.C_REMARK           = dr_RINSE_GRD["C_REMARK"].ToString();
                        bll_rinse.Add(mod_RINSE_GRD);
                    }
                    #endregion
                    #region 铁水条件复制添加
                    for (int i = 0; i < gv_tqb_tstj_cf.DataRowCount; i++)
                    {
                        DataRow         dr_TSBZ_CF  = this.gv_tqb_tstj_cf.GetDataRow(i);
                        Mod_TQB_TSBZ_CF mod_TSBZ_CF = new Mod_TQB_TSBZ_CF();
                        mod_TSBZ_CF.C_CHARACTER_ID = dr_TSBZ_CF["C_CHARACTER_ID"].ToString();
                        mod_TSBZ_CF.C_CODE         = dr_TSBZ_CF["C_CODE"].ToString();
                        mod_TSBZ_CF.C_NAME         = dr_TSBZ_CF["C_NAME"].ToString();
                        mod_TSBZ_CF.C_STL_GRD      = dr_TSBZ_CF["C_STL_GRD"].ToString();
                        mod_TSBZ_CF.C_STD_CODE     = dr_TSBZ_CF["C_STD_CODE"].ToString();
                        if (!string.IsNullOrEmpty(dr_TSBZ_CF["N_TARGET_VALUE"].ToString()))
                        {
                            mod_TSBZ_CF.N_TARGET_VALUE = Convert.ToDecimal(dr_TSBZ_CF["N_TARGET_VALUE"]);
                        }
                        else
                        {
                            mod_TSBZ_CF.N_TARGET_VALUE = null;
                        }

                        mod_TSBZ_CF.C_PRO_CONDITION_ID = strID;
                        mod_TSBZ_CF.C_EMP_ID           = RV.UI.UserInfo.userID;
                        mod_TSBZ_CF.C_REMARK           = dr_TSBZ_CF["C_REMARK"].ToString();
                        bll_tstj_cf.Add(mod_TSBZ_CF);
                    }
                    #endregion

                    #region 钢包条件复制添加
                    for (int i = 0; i < gv_TPB_LADLE.DataRowCount; i++)
                    {
                        DataRow       dr_LADLE  = this.gv_TPB_LADLE.GetDataRow(i);
                        Mod_TPB_LADLE mod_LADLE = new Mod_TPB_LADLE();
                        mod_LADLE.C_STD_CODE         = dr_LADLE["C_STD_CODE"].ToString();
                        mod_LADLE.C_LADLE            = dr_LADLE["C_LADLE"].ToString();
                        mod_LADLE.C_PRO_CONDITION_ID = strID;
                        mod_LADLE.C_EMP_ID           = RV.UI.UserInfo.userID;
                        mod_LADLE.C_REMARK           = dr_LADLE["C_REMARK"].ToString();
                        bll_ladle.Add(mod_LADLE);
                    }
                    #endregion

                    str_cid = strID;
                    FrmPB_GZSCTJWH frm = new FrmPB_GZSCTJWH(strPhyCode);
                    if (frm.ShowDialog() == DialogResult.Cancel)
                    {
                        frm.Close();
                        btn_Query_Click(null, null);

                        Common.UserLog.AddLog(strMenuName, this.Name, this.Text, "修改钢种生产条件");//添加操作日志
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #11
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Mod_TQB_TSBZ_CF model)
 {
     return(dal.Update(model));
 }
Beispiel #12
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Mod_TQB_TSBZ_CF model)
 {
     return(dal.Add(model));
 }