protected void sendApproval_Click(object sender, ImageClickEventArgs e) { if (ApprovalTable.Rows.Count < 2) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('未设置审批流程或审批人少于两个!');</script>"); return; } #region 保存 int sn_ptr = Writedata(2); if (sn_ptr == -1) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('保存失败!');</script>"); return; } if (Writelog(sn_ptr) == -1) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('保存失败!');</script>"); return; } #endregion #region 邮件提示 CARDataBLL dataBll = new CARDataBLL(CurrentFactoryID); string sp_user = ApprovalTable.Rows[0][2].ToString(); string subject = "8D Form 有新的审批。"; string url = System.Configuration.ConfigurationManager.AppSettings["url"].ToString(); string body = url; XmlSource.SendEmail(sp_user, subject, body); #endregion Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('发送成功!');</script>"); ibtn_Save.Enabled = false; sendApproval.Enabled = false; }
/// <summary> /// 拒绝 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void button_shenpi_no_Click(object sender, ImageClickEventArgs e) { QSMBLL qsmbll = new QSMBLL(FactoryID); CARLogBLL logbll = new CARLogBLL(FactoryID); qsminfo.STATUS = 14; qsmbll.Update(qsminfo); LogInfo loginfo = new LogInfo(); if (ApprovalTable.Rows.Count > 0) { loginfo = logbll.GetByKey(int.Parse(ApprovalTable.Rows[0]["rkey"].ToString())); loginfo.sp_end_date = DateTime.Now; loginfo.sp_content = SP_Content.Text; loginfo.status = 2; logbll.UpdateData(loginfo); } string sp_user = qsminfo.ENT_USER; string subject = "客户投诉单,未通过审批。"; string url = System.Configuration.ConfigurationManager.AppSettings["url"].ToString(); string body = url; XmlSource.SendEmail(sp_user, subject, body); Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('提交成功!');window.opener = null;window.close();</script>"); button_shenpi_yes.Enabled = false; button_shenpi_no.Enabled = false; }
/// <summary> /// 拒绝 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void button_shenpi_no_Click(object sender, ImageClickEventArgs e) { CARDataBLL dataBll = new CARDataBLL(FactoryID); CARLogBLL logbll = new CARLogBLL(FactoryID); DataInfo datainfo = new DataInfo(); datainfo = dataBll.GetByKey(did); datainfo.status = 14;//拒绝 dataBll.UpdateData(datainfo); LogInfo loginfo = new LogInfo(); if (ApprovalTable.Rows.Count > 0) { loginfo = logbll.GetByKey(int.Parse(ApprovalTable.Rows[0]["rkey"].ToString())); loginfo.sp_end_date = DateTime.Now; loginfo.sp_content = SP_Content.Text; loginfo.status = 2; logbll.UpdateData(loginfo); } string sp_user = datainfo.nowuser; string subject = "8D form,未通过审批。"; string url = System.Configuration.ConfigurationManager.AppSettings["url"].ToString(); string body = url; XmlSource.SendEmail(sp_user, subject, body); Response.Write("<script language='javaScript'>alert('操作成功');window.opener = null;window.close();</script>");//无提示关闭页面 button_shenpi_yes.Enabled = false; button_shenpi_no.Enabled = false; }
/// <summary> /// 审批通过 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void button_shenpi_yes_Click(object sender, ImageClickEventArgs e) { SABLL saBLL = new SABLL(FactoryID); CARLogBLL logbll = new CARLogBLL(FactoryID); LogInfo loginfo = new LogInfo(); #region data if (SP_Step == SP_Total_Step) { saInfo.STATUS = 1; saInfo.CLOSE_DATE = DateTime.Now; } saBLL.Update(saInfo); #endregion #region log if (ApprovalTable.Rows.Count >= 1) { loginfo = logbll.GetByKey(int.Parse(ApprovalTable.Rows[0]["rkey"].ToString())); loginfo.sp_end_date = DateTime.Now; loginfo.sp_content = SP_Content.Text; loginfo.status = 1; logbll.UpdateData(loginfo); if (ApprovalTable.Rows.Count >= 2) { loginfo = logbll.GetByKey(int.Parse(ApprovalTable.Rows[1]["rkey"].ToString())); loginfo.sp_start_date = DateTime.Now; logbll.UpdateData(loginfo); } } #endregion #region mail string sp_user = ""; string subject = ""; string body = ""; if (ApprovalTable.Rows.Count == 1) { if (SP_Step == SP_Total_Step) { sp_user = saInfo.ENT_USER; subject = "不良品确认单,审批通过。"; string url = System.Configuration.ConfigurationManager.AppSettings["url"].ToString(); body = url; } else { sp_user = ApprovalTable.Rows[1]["sp_user"].ToString(); subject = "有新的不良品确认单,请审批。"; string url = System.Configuration.ConfigurationManager.AppSettings["url"].ToString(); body = url; } XmlSource.SendEmail(sp_user, subject, body); } #endregion Response.Write("<script language='javaScript'>alert('操作成功');window.opener = null;window.close();</script>");//无提示关闭页面 button_shenpi_yes.Enabled = false; button_shenpi_no.Enabled = false; }
/// <summary> /// 审批通过 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void button_shenpi_yes_Click(object sender, ImageClickEventArgs e) { QSMBLL qsmbll = new QSMBLL(FactoryID); CARLogBLL logbll = new CARLogBLL(FactoryID); LogInfo loginfo = new LogInfo(); #region data if (SP_Step == SP_Total_Step) { qsminfo.CONF_CONTENT = CONF_Content.Text; qsminfo.STATUS = 1; qsminfo.CLOSE_DATE = DateTime.Now; qsmbll.Update(qsminfo); } else { try { qsminfo.DCJIAOHUO_QTY = decimal.Parse(dcjiaohuo_qty.Text); } catch { qsminfo.DCJIAOHUO_QTY = 0; } if (zaitu_status_ck1.Checked) { qsminfo.ZAITU_STATUS = 0; qsminfo.ZAITU_QTY = 0; } if (zaitu_status_ck2.Checked) { qsminfo.ZAITU_STATUS = 1; try { qsminfo.ZAITU_QTY = decimal.Parse(zaitu_qty.Text); } catch { qsminfo.ZAITU_QTY = 0; } } if (chuli_status_ck1.Checked) { qsminfo.ZAITUCHULI_TYPE = 1; } if (chuli_status_ck2.Checked) { qsminfo.ZAITUCHULI_TYPE = 2; } if (chuli_status_ck3.Checked) { qsminfo.ZAITUCHULI_TYPE = 3; } if (changleikuchun_status_ck1.Checked) { qsminfo.CANGCUN_STATUS = 0; qsminfo.CANGCUNCHULI_TYPE = 0; } if (changleikuchun_status_ck2.Checked) { qsminfo.CANGCUN_STATUS = 1; if (chuli_type_ck1.Checked) { qsminfo.CANGCUNCHULI_TYPE = 1; } if (chuli_type_ck2.Checked) { qsminfo.CANGCUNCHULI_TYPE = 2; } if (chuli_type_ck3.Checked) { qsminfo.CANGCUNCHULI_TYPE = 3; } if (chuli_type_ck4.Checked) { qsminfo.CANGCUNCHULI_TYPE = 4; } } qsminfo.INFO_CONTENT = Info_Content.Text; if (ApprovalTable.Rows.Count == SP_Total_Step) { qsminfo.FIRST_REPLY_DATE = DateTime.Now; } if (ApprovalTable.Rows.Count == 2)//倒数第二次审批 { qsminfo.LAST_REPLY_DATE = DateTime.Now; } qsmbll.Update(qsminfo); } #endregion #region log if (ApprovalTable.Rows.Count >= 1) { loginfo = logbll.GetByKey(int.Parse(ApprovalTable.Rows[0]["rkey"].ToString())); loginfo.sp_end_date = DateTime.Now; loginfo.sp_content = SP_Content.Text; loginfo.status = 1; logbll.UpdateData(loginfo); if (ApprovalTable.Rows.Count >= 2) { loginfo = logbll.GetByKey(int.Parse(ApprovalTable.Rows[1]["rkey"].ToString())); loginfo.sp_start_date = DateTime.Now; logbll.UpdateData(loginfo); } } #endregion #region mail string sp_user = ""; string subject = ""; string body = ""; if (ApprovalTable.Rows.Count == 1) { if (SP_Step == SP_Total_Step) { sp_user = qsminfo.ENT_USER; subject = "客户投诉单,审批通过。"; string url = System.Configuration.ConfigurationManager.AppSettings["url"].ToString(); body = url; } } else { sp_user = ApprovalTable.Rows[1]["sp_user"].ToString(); subject = "有新的客户投诉单,请审批。"; string url = System.Configuration.ConfigurationManager.AppSettings["url"].ToString(); body = url; } XmlSource.SendEmail(sp_user, subject, body); #endregion Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('提交成功!');window.opener = null;window.close();</script>"); button_shenpi_yes.Enabled = false; button_shenpi_no.Enabled = false; }
/// <summary> /// 审批通过 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void button_shenpi_yes_Click(object sender, ImageClickEventArgs e) { CARDataBLL dataBll = new CARDataBLL(FactoryID); CARLogBLL logbll = new CARLogBLL(FactoryID); DataInfo datainfo = new DataInfo(); LogInfo loginfo = new LogInfo(); #region data datainfo = dataBll.GetByKey(did); if (SP_Step == 1 && datainfo.serial_no.Trim().Length < 5) //第一步审批之后获得单号 { datainfo.serial_no = dataBll.getSerialNo(datainfo.serial_no); } if (SP_Step == SP_Total_Step) { datainfo.conf_content = CONF_Content.Text; datainfo.conf_user = CONF_User.Text.Trim(); try{ datainfo.conf_user_date = Convert.ToDateTime(CONF_User_Date.Text.Trim()); } catch {} datainfo.conf_app = CONF_APP.Text; try{ datainfo.conf_app_date = Convert.ToDateTime(CONF_APP_Date.Text.Trim()); } catch {} datainfo.status = 1; dataBll.UpdateData(datainfo); } else { datainfo.interim_action = Interim_Action.Text; try { datainfo.ia_date = Convert.ToDateTime(IA_Date.Text.Trim()); } catch { } datainfo.info_content = Info_Content.Text; try { datainfo.Info_Date = Convert.ToDateTime(Info_Date.Text.Trim()); } catch { } datainfo.corrective_action = Corrective_Action.Text; try { datainfo.ca_date = Convert.ToDateTime(CA_Date.Text.Trim()); } catch { } datainfo.ipca = IPCA.Text; try { datainfo.ipca_date = Convert.ToDateTime(IPCA_Date.Text.Trim()); } catch {} datainfo.atpr = ATPR.Text; try { datainfo.atpr_date = Convert.ToDateTime(IPCA_Date.Text.Trim()); } catch { } if (SOP_Status_ck_2.Checked == true) { datainfo.sop_status = 1; datainfo.sop_name = SOP_Name.Text.Trim(); } else if (SOP_Status_ck_1.Checked == true) { datainfo.sop_status = 0; } datainfo.z_app = Z_APP.Text.Trim(); datainfo.z_user = Z_User.Text.Trim(); try { datainfo.sop_date = Convert.ToDateTime(SOP_Date.Text.Trim()); } catch { } dataBll.UpdateData(datainfo); } #endregion #region log if (ApprovalTable.Rows.Count >= 1) { loginfo = logbll.GetByKey(int.Parse(ApprovalTable.Rows[0]["rkey"].ToString())); loginfo.sp_end_date = DateTime.Now; loginfo.sp_content = SP_Content.Text; loginfo.status = 1; logbll.UpdateData(loginfo); if (ApprovalTable.Rows.Count >= 2) { loginfo = logbll.GetByKey(int.Parse(ApprovalTable.Rows[1]["rkey"].ToString())); loginfo.sp_start_date = DateTime.Now; logbll.UpdateData(loginfo); } } #endregion #region mail string sp_user = ""; string subject = ""; string body = ""; if (ApprovalTable.Rows.Count == 1) { if (SP_Step == SP_Total_Step) { sp_user = datainfo.nowuser; subject = "8D form,审批通过。"; string url = System.Configuration.ConfigurationManager.AppSettings["url"].ToString(); body = url; } } else { sp_user = ApprovalTable.Rows[1]["sp_user"].ToString(); subject = "8D form,请审批。"; string url = System.Configuration.ConfigurationManager.AppSettings["url"].ToString(); body = url; } XmlSource.SendEmail(sp_user, subject, body); #endregion Response.Write("<script language='javaScript'>alert('操作成功');window.opener = null;window.close();</script>");//无提示关闭页面 button_shenpi_yes.Enabled = false; button_shenpi_no.Enabled = false; }
/// <summary> /// 审批通过 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void button_shenpi_yes_Click(object sender, ImageClickEventArgs e) { CARDataBLL dataBll = new CARDataBLL(FactoryID); CARLogBLL logbll = new CARLogBLL(FactoryID); DataInfo datainfo = new DataInfo(); LogInfo loginfo = new LogInfo(); datainfo = dataBll.GetByKey(did); if (SP_Step == 1 && datainfo.serial_no.Trim().Length < 5) //第一步审批之后获得单号 { datainfo.serial_no = dataBll.getSerialNo(datainfo.serial_no); } if (SP_Step == SP_Total_Step) { if (CONF_Status_1.Checked == true) { datainfo.conf_status = 1; } else if (CONF_Status_2.Checked == true) { datainfo.conf_status = 2; } else if (CONF_Status_3.Checked == true) { datainfo.conf_status = 3; } datainfo.conf_content = CONF_Content.Text; datainfo.status = 1; dataBll.UpdateData(datainfo); } else { if (Info_Type_1.Checked == true) { datainfo.info_type_1 = 1; } if (Info_Type_2.Checked == true) { datainfo.info_type_2 = 1; } if (Info_Type_3.Checked == true) { datainfo.info_type_3 = 1; } if (Info_Type_4.Checked == true) { datainfo.info_type_4 = 1; } if (Info_Type_5.Checked == true) { datainfo.info_type_5 = 1; } datainfo.info_content = Info_Content.Text; datainfo.interim_action = Interim_Action.Text; datainfo.IA_APP = IA_APP.Text; datainfo.IA_USER = IA_User.Text; try { datainfo.ia_date = Convert.ToDateTime(IA_Date.Text.Trim()); } catch { } datainfo.ipca = IPCA.Text; datainfo.IPCA_APP = IPCA.Text; datainfo.IPCA_USER = IPCA_User.Text; try { datainfo.ipca_date = Convert.ToDateTime(IPCA_Date.Text.Trim()); } catch {} datainfo.levels = Levels.Text; if (SOP_Status_2.Checked == true) { datainfo.sop_status = 1; datainfo.sop_name = SOP_Name.Text.Trim(); } else { datainfo.sop_status = 0; datainfo.sop_name = ""; } datainfo.sop_content = SOP_Content.Text.Trim(); try { datainfo.sop_date = Convert.ToDateTime(SOP_Date.Text.Trim()); } catch { } datainfo.together_write = Together_Write.Text; dataBll.UpdateData(datainfo); } if (ApprovalTable.Rows.Count >= 1) { loginfo = logbll.GetByKey(int.Parse(ApprovalTable.Rows[0]["rkey"].ToString())); loginfo.sp_end_date = DateTime.Now; loginfo.sp_content = SP_Content.Text; loginfo.status = 1; logbll.UpdateData(loginfo); if (ApprovalTable.Rows.Count >= 2) { loginfo = logbll.GetByKey(int.Parse(ApprovalTable.Rows[1]["rkey"].ToString())); loginfo.sp_start_date = DateTime.Now; logbll.UpdateData(loginfo); } } string sp_user = ""; string subject = ""; string body = ""; if (ApprovalTable.Rows.Count == 1) { if (SP_Step == SP_Total_Step) { sp_user = datainfo.nowuser; subject = "HSF异常处理,审批通过。"; string url = System.Configuration.ConfigurationManager.AppSettings["url"].ToString(); body = url; } } else { sp_user = ApprovalTable.Rows[1]["sp_user"].ToString(); subject = "有新的HSF异常处理,请审批。"; string url = System.Configuration.ConfigurationManager.AppSettings["url"].ToString(); body = url; } XmlSource.SendEmail(sp_user, subject, body); Response.Write("<script language='javaScript'>alert('操作成功');window.opener = null;window.close();</script>");//无提示关闭页面 button_shenpi_yes.Enabled = false; button_shenpi_no.Enabled = false; }