/// <summary> /// 审核通过 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_SHTG_Click(object sender, EventArgs e) { try { int[] rownumber = gv_GPGP.GetSelectedRows();//获取选中行号数组; if (rownumber.Length == 0) { MessageBox.Show("请选择需要审核的信息!"); return; } if (txt_CZYJ.Text.Trim() == "") { MessageBox.Show("请输入处置意见!"); return; } for (int i = 0; i < rownumber.Length; i++) { int selectedHandle = rownumber[i]; string strStove = gv_GPGP.GetRowCellValue(selectedHandle, "炉号").ToString(); string strSTLGRD = gv_GPGP.GetRowCellValue(selectedHandle, "改判前钢种").ToString(); string strSTD = gv_GPGP.GetRowCellValue(selectedHandle, "改判前标准").ToString(); string strXC = gv_GPGP.GetRowCellValue(selectedHandle, "线材厂审核人").ToString(); string strZKB = gv_GPGP.GetRowCellValue(selectedHandle, "质控部审核人").ToString(); string strLG = gv_GPGP.GetRowCellValue(selectedHandle, "炼钢厂审核人").ToString(); if (strXC == "") { MessageBox.Show("线材厂未审核!"); return; } if (strLG == "") { MessageBox.Show("炼钢厂未审核!"); return; } if (strZKB == "") { MessageBox.Show("质控部未审核!"); return; } DataTable dt = bllTPSlab.GetList_Stove(strStove, strSTLGRD, strSTD).Tables[0]; for (int s = 0; s < dt.Rows.Count; s++) { Mod_TQC_TP_SLAB_COMMUTE mod = bllTPSlab.GetModel(dt.Rows[s]["C_ID"].ToString()); mod.C_CHECK_JSZX = "Y"; mod.C_CZYJ_JSZX = txt_CZYJ.Text.Trim(); mod.C_JSZX_EMP_ID = RV.UI.UserInfo.UserName; mod.D_CHECK_JSZX_DATE = RV.UI.ServerTime.timeNow(); bllTPSlab.Update(mod); } } MessageBox.Show("审核成功!"); btn_Query1_Click(null, null); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// 取消申请 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_QXSQ_Click(object sender, EventArgs e) { if (DialogResult.OK != MessageBox.Show("是否确认取消申请已选中的数据?", "提示", MessageBoxButtons.OKCancel)) { return; } DataRow dr = this.gv_GPGP.GetDataRow(this.gv_GPGP.FocusedRowHandle); if (dr == null) { return; } string stove = dr["炉号"].ToString(); string strBatchNo = dr["开坯号"].ToString(); string stlgrd = dr["改判前钢种"].ToString(); string stdcode = dr["改判前标准"].ToString(); string matID = dr["改判前物料编码"].ToString(); string strZYX1 = dr["改判前自由项1"].ToString(); string strZYX2 = dr["改判前自由项2"].ToString(); string strSlabCode = dr["仓库"].ToString(); string strSTD_GPH = dr["改判后标准"].ToString(); string strMat_GPH = dr["改判后物料编码"].ToString(); string strZYX1_GPH = dr["改判后自由项1"].ToString(); string strZYX2_GPH = dr["改判后自由项2"].ToString(); DataTable dt = bllTPSlab.GetList_TPGP_COU(stove, strBatchNo, stlgrd, stdcode, matID, strZYX1, strZYX2, strSlabCode, strMat_GPH, strSTD_GPH, strZYX1_GPH, strZYX2_GPH).Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { Mod_TQC_TP_SLAB_COMMUTE mod = bllTPSlab.GetModel(dt.Rows[i]["C_ID"].ToString()); mod.N_STATUS = 0; mod.C_COMMUTE_REASON = "取消挑坯改判申请"; mod.C_REMARK1 = RV.UI.UserInfo.UserName; mod.D_COMMUTE_DATE = RV.UI.ServerTime.timeNow(); bllTPSlab.Update(mod); Mod_TSC_SLAB_MAIN mod_slab = bll_slab.GetModel(dt.Rows[i]["C_SLAB_MAIN_ID"].ToString()); mod_slab.C_MOVE_TYPE = dt.Rows[i]["C_REMARK2"].ToString(); bll_slab.Update(mod_slab); } btn_Query1_Click(null, null); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Mod_TQC_TP_SLAB_COMMUTE model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Mod_TQC_TP_SLAB_COMMUTE model) { return(dal.Add(model)); }
/// <summary> /// 钢坯改判 /// </summary> /// <param name="row">选中的数据</param> /// <param name="strGrd">钢种</param> /// <param name="strStdCode">执行标准</param> /// <param name="strMatCode">物料编码</param> /// <param name="strMatName">物料描述</param> /// <param name="strZrdwID">责任单位代码</param> /// <param name="strZrdwName">责任代为描述</param> /// <param name="strPDDJ">判定等级</param> /// <param name="strZYX1">自由项1</param> /// <param name="strZYX2">自由项2</param> /// <param name="strGPYY">改判原因</param> /// <param name="strLen">定尺</param> /// <param name="strISSH">是否审核</param> /// <returns></returns> public string TPGP_Slab(string strs, string strGrd, string strStdCode, string strMatCode, string strMatName, string strZrdwID, string strZrdwName, string strPDDJ, string strZYX1, string strZYX2, string strGPYY, string strLen, decimal strISSH) { string result = "1"; try { Dal_TQC_TP_SLAB_COMMUTE dalTP = new Dal_TQC_TP_SLAB_COMMUTE(); Dal_TSC_SLAB_MAIN dal_slab = new Dal_TSC_SLAB_MAIN(); Dal_TQD_DESIGN dalDesign = new Dal_TQD_DESIGN(); TransactionHelper.BeginTransaction(); string strUserID = RV.UI.UserInfo.userID; DateTime time = RV.UI.ServerTime.timeNow(); string stove = ""; string strDesignNo = dalDesign.Get_Design_No(strStdCode, strGrd); if (string.IsNullOrEmpty(strDesignNo)) { return("改判失败,没有找到对应的执行标准信息!"); } string[] strs_Slab_ID = strs.Substring(0, strs.Length - 1).Split(','); Bll_TB_MATRL_MAIN bll_matrl = new Bll_TB_MATRL_MAIN(); for (int i = 0; i < strs_Slab_ID.Length; i++) { Mod_TSC_SLAB_MAIN mod_slab = dal_slab.GetModel(strs_Slab_ID[i]); stove = mod_slab.C_STOVE; if (mod_slab != null) { Mod_TB_MATRL_MAIN mod_matrl = bll_matrl.GetModel(strMatCode); stove = mod_slab.C_STOVE; Mod_TQC_TP_SLAB_COMMUTE mod = new Mod_TQC_TP_SLAB_COMMUTE(); mod.C_STA_ID = mod_slab.C_STA_DESC; mod.C_SLAB_MAIN_ID = strs_Slab_ID[i]; mod.C_STOVE = mod_slab.C_STOVE; mod.C_BATCH_NO = mod_slab.C_BATCH_NO; mod.N_WGT = mod_slab.N_WGT; mod.N_LEN_BEFORE = mod_slab.N_LEN; mod.C_STL_GRD_BEFORE = mod_slab.C_STL_GRD; mod.C_STD_CODE_BEFORE = mod_slab.C_STD_CODE; mod.C_SPEC_BEFORE = mod_slab.C_SPEC; mod.C_MAT_CODE_BEFORE = mod_slab.C_MAT_CODE; mod.C_MAT_DESC_BEFORE = mod_slab.C_MAT_NAME; mod.C_ZYX1_BEFORE = mod_slab.C_ZYX1; mod.C_ZYX2_BEFORE = mod_slab.C_ZYX2; mod.C_JUDGE_LEV_BP_BEFORE = mod_slab.C_MAT_TYPE; mod.C_STL_GRD_AFTER = strGrd; mod.C_STD_CODE_AFTER = strStdCode; mod.C_SPEC_AFTER = mod_matrl.C_SLAB_SIZE; mod.N_LEN_AFTER = Convert.ToDecimal(strLen); mod.C_MAT_CODE_AFTER = strMatCode; mod.C_MAT_DESC_AFTER = strMatName; mod.C_REASON_DEPMT_ID = strZrdwID; mod.C_REASON_DEPMT_DESC = strZrdwName; mod.C_EMP_ID = RV.UI.UserInfo.UserName; mod.C_ZYX1_AFTER = strZYX1; mod.C_ZYX2_AFTER = strZYX2; mod.C_JUDGE_LEV_BP_AFTER = strPDDJ; mod.C_COMMUTE_SQ = strGPYY; mod.N_IS_SH = strISSH; mod.C_REMARK2 = mod_slab.C_MOVE_TYPE; mod.C_REMARK3 = mod_slab.C_SLABWH_CODE; if (dalTP.Add_Trans(mod)) { if (!dal_slab.UpdateTP_Trans(mod_slab.C_ID, mod_slab.C_BATCH_NO)) { TransactionHelper.RollBack(); return("改判失败,修改钢坯实绩状态时错误!"); } } else { TransactionHelper.RollBack(); return("改判失败,添加改判记录时错误!"); } } } TransactionHelper.Commit(); } catch (Exception ex) { TransactionHelper.RollBack(); return(ex.Message); } return(result); }
/// <summary> /// 审核通过 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_SHTG_Click(object sender, EventArgs e) { try { if (txt_GPYY.Text.Trim() == "") { MessageBox.Show("请输入改判原因!"); return; } if (DialogResult.OK != MessageBox.Show("是否确认改判已选中的数据?", "提示", MessageBoxButtons.OKCancel)) { return; } DataRow dr = this.gv_GPGP.GetDataRow(this.gv_GPGP.FocusedRowHandle); if (dr == null) { return; } string stove = dr["炉号"].ToString(); string strBatchNo = dr["开坯号"].ToString(); string stlgrd = dr["改判前钢种"].ToString(); string stdcode = dr["改判前标准"].ToString(); string matID = dr["改判前物料编码"].ToString(); string strZYX1 = dr["改判前自由项1"].ToString(); string strZYX2 = dr["改判前自由项2"].ToString(); string strSTD_GPH = dr["改判后标准"].ToString(); string strMat_GPH = dr["改判后物料编码"].ToString(); string strZYX1_GPH = dr["改判后自由项1"].ToString(); string strZYX2_GPH = dr["改判后自由项2"].ToString(); string strSlabCode = dr["仓库编码"].ToString(); DataTable dt = bllTPSlab.GetList_TPGP_COU(stove, strBatchNo, stlgrd, stdcode, matID, strZYX1, strZYX2, strSlabCode, strMat_GPH, strSTD_GPH, strZYX1_GPH, strZYX2_GPH).Tables[0]; string strs = ""; for (int i = 0; i < dt.Rows.Count; i++) { strs = strs + dt.Rows[i]["C_SLAB_MAIN_ID"].ToString() + ","; } string strResult = bll_slab.GP_Slab(strs, dr["改判后钢种"].ToString(), dr["改判后标准"].ToString(), dr["改判后物料编码"].ToString(), dr["改判后物料描述"].ToString(), dr["责任单位代码"].ToString(), dr["责任单位描述"].ToString(), dr["改判后判定等级"].ToString(), "", Application.StartupPath, dr["改判后自由项1"].ToString(), dr["改判后自由项2"].ToString(), txt_GPYY.Text.Trim(), dr["改判后定尺"].ToString()); if (strResult == "1") { for (int s = 0; s < dt.Rows.Count; s++) { Mod_TQC_TP_SLAB_COMMUTE mod = bllTPSlab.GetModel(dt.Rows[s]["C_ID"].ToString()); mod.N_STATUS = 2; mod.C_COMMUTE_REASON = txt_GPYY.Text.Trim(); mod.C_REMARK1 = RV.UI.UserInfo.UserName; mod.D_COMMUTE_DATE = RV.UI.ServerTime.timeNow(); bllTPSlab.Update(mod); Mod_TSC_SLAB_MAIN mod_slab = bll_slab.GetModel(dt.Rows[s]["C_SLAB_MAIN_ID"].ToString()); mod_slab.C_MOVE_TYPE = dt.Rows[s]["C_REMARK2"].ToString(); bll_slab.Update(mod_slab); } btn_Query1_Click(null, null); MessageBox.Show("改判成功!"); Common.UserLog.AddLog(strMenuName, this.Name, this.Text, "钢坯挑坯改判");//添加操作日志 } else { MessageBox.Show(strResult); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }