/// <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_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> private int Writedata(int status) { QSMBLL qsmbll = new QSMBLL(CurrentFactoryID); QSMInfo qsminfo = new QSMInfo(); if (did == 0) { qsminfo.RKEY = 0; qsminfo.SERIALNO = qsmbll.GetSerialNo(); } else { qsminfo = qsmbll.getQSMInfoByrkey(did); if (qsminfo.STATUS == 14) { string strTemp = qsminfo.SERIALNO; qsminfo = new QSMInfo(); qsminfo.RKEY = did; qsminfo.SERIALNO = strTemp; } } qsminfo.ENT_DATE = DateTime.Now; qsminfo.ENT_USER = CurrentUser.UserADAcount; qsminfo.CUST_CODE = CustCode.Value; qsminfo.CUST_NAME = CustName.Text; qsminfo.FACTORY_NAME = factoryList.SelectedItem.Text; try { qsminfo.HAPPEN_DATE = Convert.ToDateTime(Happen_Date.Text); } catch { qsminfo.HAPPEN_DATE = DateTime.Now; } qsminfo.CUST_MATERIALNO = cust_MaterialNo.Text; qsminfo.INTERALNO = interalNo.Text; try { qsminfo.REQUIRE_DATE = Convert.ToDateTime(require_Date.Text); } catch { } qsminfo.TOUSU_LEVEL = tousu_level.SelectedItem.Text; qsminfo.TOUSU_TYPE = tousu_type.SelectedItem.Text; try { qsminfo.CHUHUO_QTY = decimal.Parse(chuhuo_qty.Text); } catch { qsminfo.CHUHUO_QTY = 0; } try { qsminfo.JIANCHA_QTY = decimal.Parse(jiancha_qty.Text); } catch { qsminfo.JIANCHA_QTY = 0; } try { qsminfo.BULIANG_QTY = decimal.Parse(buliang_qty.Text); } catch { qsminfo.BULIANG_QTY = 0; } try { qsminfo.BULIANGBILI = decimal.Parse(buliangbili.Text.Trim().Replace("%", "")); } catch { qsminfo.BULIANGBILI = 0; } qsminfo.BULIANGDC = buliangDC.Text; try { qsminfo.ZAIXIAN_QTY = decimal.Parse(zaixian_qty.Text); } catch { qsminfo.ZAIXIAN_QTY = 0; } try { qsminfo.KUCUN_QTY = decimal.Parse(kucun_qty.Text); } catch { qsminfo.KUCUN_QTY = 0; } if (tuihuo_status_ck1.Checked == true) { qsminfo.TUIHUO_STATUS = 0; qsminfo.TUIHUO_QTY = 0; } else if (tuihuo_status_ck2.Checked == true) { qsminfo.TUIHUO_STATUS = 1; try { qsminfo.TUIHUO_QTY = decimal.Parse(tuihuo_qty.Text); } catch { qsminfo.TUIHUO_QTY = 0; } } qsminfo.HAPPEN_ADDRESS = int.Parse(happen_address.SelectedValue); if (tijiao_status_ck1.Checked == true) { qsminfo.TIJIAO_STATUS = 0; } else if (tijiao_status_ck2.Checked == true) { qsminfo.TIJIAO_STATUS = 1; if (tijiao_type_ck1.Checked == true) { qsminfo.TIJIAO_TYPE = 1; } else if (tijiao_type_ck2.Checked == true) { qsminfo.TIJIAO_TYPE = 2; } else if (tijiao_type_ck3.Checked == true) { qsminfo.TIJIAO_TYPE = 3; } } qsminfo.NOTES = notes.Text; qsminfo.CAR_CONTENT = CAR_Content.Text; qsminfo.STATUS = status; int a = 0; if (did == 0) { a = qsmbll.add(qsminfo); } else { a = qsmbll.Update(qsminfo); } if (a != 0) { return(-1); } return(int.Parse(qsminfo.RKEY.ToString())); }