protected void SaveBtn_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(FormName.Text)) { SqlHelper.ExecuteSql("UPDATE hk_Form SET FK_fcid='" + FormType.SelectedValue + "',fName='" + hkdb.GetStr(FormName.Text) + "',fContent='" + hkdb.GetStrTeIn(editor.Value) + "' ,fUserIDs='" + hkdb.GetStr(UserID.Text) + "' ,fUserNames='" + hkdb.GetStr(UserName.Text) + "' WHERE fID='" + hkdb.GetStr(Request.QueryString["id"]) + "'"); mydb.Alert_Refresh_Close("保存成功!", "FormDesign.aspx"); } else { mydb.Alert("请输入表单名称!"); } }
//保存 protected void Save_Click(object sender, EventArgs e) { SqlHelper.ExecuteSql("UPDATE HK_WDYJ SET YJNR='" + hkdb.GetStrTeIn(editor.Value) + "',FJMC='" + hkdb.GetStr(Number.Text) + "' WHERE YJID = '" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "' AND ZT='待回复'"); mydb.Alert_Close("保存成功!"); }
//保存 protected void Save_Click(object sender, EventArgs e) { string fbrstr = null; if (nm.Checked == true) { fbrstr = "匿名"; } else { fbrstr = this.Session["username"].ToString(); } SqlHelper.ExecuteSql("INSERT INTO HK_WDYJ(YJBT,YJNR,YJX,FJMC,ZT,FBRID,FBRMC,FBSJ) VALUES('" + hkdb.GetStr(yjbt.Text) + "','" + hkdb.GetStrTeIn(editor.Value) + "','" + yjx.SelectedValue + "','" + hkdb.GetStr(Number.Text) + "','待回复','" + this.Session["UserID"] + "','" + fbrstr + "',GETDATE())"); //发送消息 string jsr = Convert.ToString(SqlHelper.ExecuteScalar("SELECT GLY FROM HK_YJX WHERE ID='" + yjx.SelectedValue + "'")); string message = "有人向您的意见箱里提交了意见,请尽快回复!"; SqlHelper.ExecuteSql("exec sp_Send_Mess 1,0,'系统提示','" + jsr + "','" + message + "'"); mydb.Alert_Close("发表成功!"); }
//保存 protected void Button1_Click(object sender, EventArgs e) { try { string TjszStrSz, TjszStrCg; string TjszStr; string str1 = null; str1 = "" + strNextNodeNum + "0"; ArrayList myarr = new ArrayList(); string[] mystr = str1.Split(','); for (int s = 0; s < mystr.Length; s++) { TjszStrCg = null; TjszStrSz = null; TjszStr = null; TjszStr = "1 == 1"; //常规型条件 SqlDataReader datar1 = SqlHelper.ExecuteReader("SELECT * FROM hk_WorkFlowBranch WHERE fbTofnid=(SELECT fnID FROM hk_WorkFlowNode WHERE fnNum='" + mystr[s] + "' AND FK_wfno='" + hkdb.GetStr(Request.QueryString["FlowNumber"]) + "') AND FK_fnid='" + strfnid + "' AND fbType='[常规型]'"); while (datar1.Read()) { if (datar1["fbCondi"].ToString() == "包含") { TjszStrCg += "&&" + Request.Form["" + datar1["fbNo"] + ""].IndexOf(datar1["fbValue"].ToString()) + ">= 0 "; } else if (datar1["fbCondi"].ToString() == "不包含") { TjszStrCg += "&&" + Request.Form["" + datar1["fbNo"] + ""].IndexOf(datar1["fbValue"].ToString()) + "< 0 "; } } datar1.Close(); //数字型条件 SqlDataReader datar2 = SqlHelper.ExecuteReader("SELECT * FROM hk_WorkFlowBranch WHERE fbTofnid=(SELECT fnID FROM hk_WorkFlowNode WHERE fnNum='" + mystr[s] + "' AND FK_wfno='" + hkdb.GetStr(Request.QueryString["FlowNumber"]) + "') AND FK_fnid='" + strfnid + "' AND fbType='[数字型]'"); while (datar2.Read()) { TjszStrSz += "&&" + int.Parse(Request.Form["" + datar2["fbNo"] + ""]) + " " + datar2["fbCondi"] + " " + datar2["fbValue"] + " "; } datar2.Close(); TjszStr += TjszStrCg + TjszStrSz; MSScriptControl.ScriptControl sc = new MSScriptControl.ScriptControlClass(); sc.Language = "javascript"; if ((bool)sc.Eval(TjszStr) == false) { strnnNumkey = strnnNumkey.Replace("" + mystr[s] + ",", ""); lblnnnk.Text = lblnnnk.Text.Replace("" + mystr[s] + ",", ""); } } SqlHelper.ExecuteSql("INSERT INTO hk_WorkAppLog(FK_wfID,al_fName,al_wfName,alContent,FK_uid,AddTime) values ('" + hkdb.GetStr(Request.QueryString["id"]) + "','" + lblFormName.Text + "','" + lblName.Text + "','审批工作','" + this.Session["userid"] + "',GETDATE())"); if (lblstrAudiMode.Text == "仅一人通过审批即可向下流转") { SqlHelper.ExecuteSql("UPDATE hk_Work SET wName='" + hkdb.GetStr(whname.Text) + "',wStatus='正在办理', wContent='" + hkdb.GetStrTeIn(ContractContent.Text) + "',EndUserIDs=EndUserIDs+'" + this.Session["userid"].ToString() + ",',EndUserNames=EndUserNames+'" + this.Session["username"].ToString() + ",',LastTime=GETDATE() WHERE wID='" + int.Parse(Request.QueryString["id"]) + "'"); } else { SqlHelper.ExecuteSql("UPDATE hk_Work SET wName='" + hkdb.GetStr(whname.Text) + "',wStatus='正在办理', wContent='" + hkdb.GetStrTeIn(ContractContent.Text) + "',EndUserIDs=EndUserIDs+'" + this.Session["userid"].ToString() + ",',EndUserNames=EndUserNames+'" + this.Session["username"].ToString() + ",',wUserIDs='" + lblstrhyUserIDs.Text + "',wUserNames='" + lblstrhyUserNames.Text + "',LastTime=GETDATE() WHERE wID='" + int.Parse(Request.QueryString["id"]) + "'"); } } catch { mydb.Alert("保存失败,请检查是否有必填项未填写!"); return; } //上传 string strBaseLocation = Server.MapPath("../../Attach/flow/work/"); string TruePath = string.Empty; string Temp1 = string.Empty; if (uploadFile.PostedFile.ContentLength != 0) { string fileName = System.IO.Path.GetFileName(uploadFile.PostedFile.FileName); string extName = System.IO.Path.GetExtension(fileName); Random g = new Random(); string rad = g.Next(10000).ToString(); Temp1 = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString() + rad; uploadFile.PostedFile.SaveAs(strBaseLocation + Temp1 + extName); TruePath = Temp1 + extName; SqlHelper.ExecuteSql("INSERT INTO hk_WorkAppComm(ac_wfID,ac_fName,ac_wfName,acContent,acAttName,acAttNewName,FK_uid,AddTime) values ('" + hkdb.GetStr(Request.QueryString["id"]) + "','" + lblstrfnName.Text + "','" + lblName.Text + "','" + hkdb.GetStr(txt_appcomm.Text) + "','" + fileName + "','" + TruePath + "','" + this.Session["userid"] + "',GETDATE())"); BindDplist(); } else { if (txt_appcomm.Text == "") { } else { SqlHelper.ExecuteSql("INSERT INTO hk_WorkAppComm(ac_wfID,ac_fName,ac_wfName,acContent,acAttName,acAttNewName,FK_uid,AddTime) values ('" + hkdb.GetStr(Request.QueryString["id"]) + "','" + lblstrfnName.Text + "','" + lblName.Text + "','" + hkdb.GetStr(txt_appcomm.Text) + "','','','" + this.Session["userid"] + "',GETDATE())"); } } //保存 SqlDataReader datar3 = SqlHelper.ExecuteReader("SELECT * FROM hk_Work WHERE wID='" + hkdb.GetStr(Request.QueryString["id"]) + "'"); if (datar3.Read()) { SqlDataReader dr_wh = SqlHelper.ExecuteReader("SELECT * FROM hk_WorkHandled WHERE whNo='" + datar3["wNo"] + "'"); if (dr_wh.Read()) { dr_wh.Close(); SqlHelper.ExecuteSql("UPDATE hk_WorkHandled SET whContent='" + hkdb.GetStrTeIn(ContractContent.Text) + "' WHERE whNo='" + datar3["wNo"] + "'"); } else { dr_wh.Close(); SqlHelper.ExecuteSql("INSERT INTO hk_WorkHandled(FK_fid,FK_fno,FK_wfid,FK_wfno,FK_fnno,FK_fnnum,whNo,whSerialNo,whName,whContent,whPromoterID,whEndUserIDs,whEndUserNames,FK_uid,AddTime) values ('" + datar3["FK_fid"] + "','" + datar3["FK_fno"] + "','" + datar3["FK_wfid"] + "','" + datar3["FK_wfno"] + "','" + datar3["NextNodeNo"] + "','" + datar3["NextNodeNum"] + "','" + datar3["wNo"] + "','" + datar3["wSerialNo"] + "','" + datar3["wName"] + "','" + hkdb.GetStrTeIn(ContractContent.Text) + "','" + datar3["PromoterID"] + "','" + datar3["EndUserIDs"] + "','" + datar3["EndUserNames"] + "','" + this.Session["userid"] + "',GETDATE())"); } } datar3.Close(); //Response.Redirect("HandleWork.aspx"); mydb.Refresh_Close("HandleWork.aspx"); }
//下一步按钮 protected void NetxBtn_Click(object sender, EventArgs e) { try { string TjszStrSz, TjszStrCg; string TjszStr; string str1 = null; str1 = "" + NextNodeNum + "0"; ArrayList myarr = new ArrayList(); string[] mystr = str1.Split(','); for (int s = 0; s < mystr.Length; s++) { TjszStrCg = null; TjszStrSz = null; TjszStr = null; TjszStr = "1 == 1"; //[常规型]条件 SqlDataReader datar1 = SqlHelper.ExecuteReader("SELECT * FROM hk_WorkFlowBranch WHERE fbTofnid=(SELECT fnID FROM hk_WorkFlowNode WHERE fnNum='" + mystr[s] + "' AND FK_wfno='" + hkdb.GetStr(Request.QueryString["FlowNumber"]) + "') AND FK_fnid='" + strfnid + "' AND fbType='[常规型]'"); while (datar1.Read()) { if (datar1["fbCondi"].ToString() == "包含") { TjszStrCg += "&&" + Request.Form["" + datar1["fbNo"] + ""].IndexOf(datar1["fbValue"].ToString()) + ">= 0 "; } else if (datar1["fbCondi"].ToString() == "不包含") { TjszStrCg += "&&" + Request.Form["" + datar1["fbNo"] + ""].IndexOf(datar1["fbValue"].ToString()) + "< 0 "; } } datar1.Close(); //[数字型]条件 SqlDataReader datar2 = SqlHelper.ExecuteReader("SELECT * FROM hk_WorkFlowBranch WHERE fbTofnid=(SELECT fnID FROM hk_WorkFlowNode WHERE fnNum='" + mystr[s] + "' AND FK_wfno='" + hkdb.GetStr(Request.QueryString["FlowNumber"]) + "') AND FK_fnid='" + strfnid + "' AND fbType='[数字型]'"); while (datar2.Read()) { TjszStrSz += "&&" + int.Parse(Request.Form["" + datar2["fbNo"] + ""]) + " " + datar2["fbCondi"] + " " + datar2["fbValue"] + " "; } datar2.Close(); TjszStr += TjszStrCg + TjszStrSz; MSScriptControl.ScriptControl sc = new MSScriptControl.ScriptControlClass(); sc.Language = "javascript"; if ((bool)sc.Eval(TjszStr) == false) { NextNodeNumKey = NextNodeNumKey.Replace("" + mystr[s] + ",", ""); lbloNextNodeNum.Text = lbloNextNodeNum.Text.Replace("" + mystr[s] + ",", ""); } } SqlDataReader dr = SqlHelper.ExecuteReader("SELECT * FROM hk_WorkFlowNode where fnPosition='开始' AND FK_wfno='" + hkdb.GetStr(Request.QueryString["FlowNumber"]) + "'"); if (dr.Read()) { string JkUsername = null, JkRealname = null; SqlDataReader dr_wf = SqlHelper.ExecuteReader("SELECT * FROM hk_WorkFlow WHERE wfID='" + dr["FK_wfid"] + "'"); if (dr_wf.Read()) { JkUsername = dr_wf["wfUserIDs"].ToString(); JkRealname = dr_wf["wfUserNames"].ToString(); } dr_wf.Close(); //流水号 SqlDataReader datar3 = SqlHelper.ExecuteReader("SELECT TOP 1 wID FROM hk_Work ORDER BY wID DESC"); if (datar3.Read()) { serid = int.Parse(datar3["wID"].ToString()) + 1; } else { serid = 1; } datar3.Close(); if (!string.IsNullOrEmpty(Request.QueryString["wid"])) { //如果重新发起,则复制原工作记录的审批意见 int iWid = Convert.ToInt32(SqlHelper.ExecuteScalar("INSERT INTO hk_Work(wFileNo,MoniUserIDs,MoniUserNames,FK_fid,FK_fno,FK_wfid,FK_wfno,FK_fnno,FK_fnnum,wNo,wSerialNo,wName,wStatus,wContent,PromoterID,EndUserIDs,EndUserNames,MyUserIDs,MyUserNames,AttentUserIDs,AttentUserNames,FK_uid,FK_did,wQxStr,FK_rid,AddTime,LastTime,ClientUserIDs,ClientUserNames,wTitle) values ('" + nNameid + "','" + JkUsername + "','" + JkRealname + "','" + dr["FK_fid"] + "','" + dr["FK_fno"] + "','" + dr["FK_wfid"] + "','" + dr["FK_wfno"] + "','" + dr["fnNo"] + "','" + dr["fnNum"] + "','" + hkdb.GetStr(Number.Text) + "','" + serid + "','" + hkdb.GetStr(fileid.Text) + "','等待送审','" + hkdb.GetStrTeIn(ContractContent.Text) + "','" + this.Session["userid"] + "','','','','','','','" + this.Session["userid"] + "','" + this.Session["deptid"] + "','" + this.Session["deptqx"] + "','" + this.Session["roleid"] + "',GETDATE(),GETDATE(),'','','" + hkdb.GetStr(wTitle.Text) + "')" + "SELECT CAST(scope_identity() AS int)")); SqlHelper.ExecuteSql("INSERT INTO hk_WorkAppComm(ac_wfID,ac_fName,ac_wfName,acContent,acAttName,acAttNewName,FK_uid,AddTime) SELECT " + iWid + ",ac_fName,ac_wfName,acContent,acAttName,acAttNewName,FK_uid,AddTime FROM hk_WorkAppComm WHERE ac_wfid='" + hkdb.GetStr(Request.QueryString["wid"].ToString()) + "'"); } else { //如果是新发起 SqlHelper.ExecuteSql("INSERT INTO hk_Work(wFileNo,MoniUserIDs,MoniUserNames,FK_fid,FK_fno,FK_wfid,FK_wfno,FK_fnno,FK_fnnum,wNo,wSerialNo,wName,wStatus,wContent,PromoterID,EndUserIDs,EndUserNames,MyUserIDs,MyUserNames,AttentUserIDs,AttentUserNames,FK_uid,FK_did,wQxStr,FK_rid,AddTime,LastTime,ClientUserIDs,ClientUserNames,wTitle) values ('" + nNameid + "','" + JkUsername + "','" + JkRealname + "','" + dr["FK_fid"] + "','" + dr["FK_fno"] + "','" + dr["FK_wfid"] + "','" + dr["FK_wfno"] + "','" + dr["fnNo"] + "','" + dr["fnNum"] + "','" + hkdb.GetStr(Number.Text) + "','" + serid + "','" + hkdb.GetStr(fileid.Text) + "','等待送审','" + hkdb.GetStrTeIn(ContractContent.Text) + "','" + this.Session["userid"] + "','','','','','','','" + this.Session["userid"] + "','" + this.Session["deptid"] + "','" + this.Session["deptqx"] + "','" + this.Session["roleid"] + "',GETDATE(),GETDATE(),'','','" + hkdb.GetStr(wTitle.Text) + "')"); } } else { mydb.Alert("保存失败,请检查是否存在开始流程!"); return; } dr.Close(); Response.Redirect("AddWork_Add_Detail.aspx?UpNodeNum=" + lbloNextNodeNum.Text + "&FlowNumber=" + Request.QueryString["FlowNumber"] + "&FormId=" + Request.QueryString["FormId"] + "&Number=" + Number.Text + ""); } catch { mydb.Alert("保存失败,请检查是否有【必填项】未填写或【可写字段】设置错误!"); return; } }
//保存 protected void Button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txt_appcomm.Text)) { lblMsg.Text = "请输入审批意见!"; return; } try { string TjszStrSz, TjszStrCg; string TjszStr; string str1 = null; str1 = "" + strNextNodeNum + "0"; ArrayList myarr = new ArrayList(); string[] mystr = str1.Split(','); for (int s = 0; s < mystr.Length; s++) { TjszStrCg = null; TjszStrSz = null; TjszStr = null; TjszStr = "1 == 1"; //常规型条件 SqlDataReader datar1 = SqlHelper.ExecuteReader("SELECT * FROM hk_WorkFlowBranch WHERE fbTofnid=(SELECT fnID FROM hk_WorkFlowNode WHERE fnNum='" + mystr[s] + "' AND FK_wfno='" + hkdb.GetStr(Request.QueryString["FlowNumber"]) + "') AND FK_fnid='" + strfnid + "' AND fbType='[常规型]'"); while (datar1.Read()) { if (datar1["fbCondi"].ToString() == "包含") { TjszStrCg += "&&" + Request.Form["" + datar1["fbNo"] + ""].IndexOf(datar1["fbValue"].ToString()) + ">= 0 "; } else if (datar1["fbCondi"].ToString() == "不包含") { TjszStrCg += "&&" + Request.Form["" + datar1["fbNo"] + ""].IndexOf(datar1["fbValue"].ToString()) + "< 0 "; } } datar1.Close(); //数字型条件 SqlDataReader datar2 = SqlHelper.ExecuteReader("SELECT * FROM hk_WorkFlowBranch WHERE fbTofnid=(SELECT fnID FROM hk_WorkFlowNode WHERE fnNum='" + mystr[s] + "' AND FK_wfno='" + hkdb.GetStr(Request.QueryString["FlowNumber"]) + "') AND FK_fnid='" + strfnid + "' AND fbType='[数字型]'"); while (datar2.Read()) { TjszStrSz += "&&" + int.Parse(Request.Form["" + datar2["fbNo"] + ""]) + " " + datar2["fbCondi"] + " " + datar2["fbValue"] + " "; } datar2.Close(); TjszStr += TjszStrCg + TjszStrSz; MSScriptControl.ScriptControl sc = new MSScriptControl.ScriptControlClass(); sc.Language = "javascript"; if ((bool)sc.Eval(TjszStr) == false) { strnnNumkey = strnnNumkey.Replace("" + mystr[s] + ",", ""); lblnnnk.Text = lblnnnk.Text.Replace("" + mystr[s] + ",", ""); } } SqlHelper.ExecuteSql("INSERT INTO hk_WorkAppLog(FK_wfID,al_fName,al_wfName,alContent,FK_uid,AddTime) values ('" + hkdb.GetStr(Request.QueryString["id"]) + "','" + lblFormName.Text + "','" + lblName.Text + "','审批工作','" + this.Session["userid"] + "',GETDATE())"); if (lblstrAudiMode.Text == "仅一人通过审批即可向下流转") { SqlHelper.ExecuteSql("UPDATE hk_Work SET wStatus='正在办理', wContent='" + hkdb.GetStrTeIn(lblhtm.Text) + "',EndUserIDs=EndUserIDs+'" + this.Session["userid"].ToString() + ",',EndUserNames=EndUserNames+'" + this.Session["username"].ToString() + ",',LastTime=GETDATE() WHERE wID='" + int.Parse(Request.QueryString["id"]) + "'"); } else { SqlHelper.ExecuteSql("UPDATE hk_Work SET wStatus='正在办理', wContent='" + hkdb.GetStrTeIn(lblhtm.Text) + "',EndUserIDs=EndUserIDs+'" + this.Session["userid"].ToString() + ",',EndUserNames=EndUserNames+'" + this.Session["username"].ToString() + ",',wUserIDs='" + lblstrhyUserIDs.Text + "',wUserNames='" + lblstrhyUserNames.Text + "',LastTime=GETDATE() WHERE wID='" + int.Parse(Request.QueryString["id"]) + "'"); } } catch { mydb.Alert("保存失败,请检查是否有必填项未填写!"); return; } if (txt_appcomm.Text == "") { } else { SqlHelper.ExecuteSql("INSERT INTO hk_WorkAppComm(ac_wfID,ac_fName,ac_wfName,acContent,acAttName,acAttNewName,FK_uid,AddTime) values ('" + hkdb.GetStr(Request.QueryString["id"]) + "','" + lblstrfnName.Text + "','" + lblName.Text + "','" + hkdb.GetStr(txt_appcomm.Text) + "','','','" + this.Session["userid"] + "',GETDATE())"); } //保存 SqlDataReader datar3 = SqlHelper.ExecuteReader("SELECT * FROM hk_Work WHERE wID='" + hkdb.GetStr(Request.QueryString["id"]) + "'"); if (datar3.Read()) { SqlDataReader dr_wh = SqlHelper.ExecuteReader("SELECT * FROM hk_WorkHandled WHERE whNo='" + datar3["wNo"] + "'"); if (dr_wh.Read()) { dr_wh.Close(); SqlHelper.ExecuteSql("UPDATE hk_WorkHandled SET whContent='" + hkdb.GetStrTeIn(lblhtm.Text) + "' WHERE whNo='" + datar3["wNo"] + "'"); } else { dr_wh.Close(); SqlHelper.ExecuteSql("INSERT INTO hk_WorkHandled(FK_fid,FK_fno,FK_wfid,FK_wfno,FK_fnno,FK_fnnum,whNo,whSerialNo,whName,whContent,whPromoterID,whEndUserIDs,whEndUserNames,FK_uid,AddTime) values ('" + datar3["FK_fid"] + "','" + datar3["FK_fno"] + "','" + datar3["FK_wfid"] + "','" + datar3["FK_wfno"] + "','" + datar3["NextNodeNo"] + "','" + datar3["NextNodeNum"] + "','" + datar3["wNo"] + "','" + datar3["wSerialNo"] + "','" + datar3["wName"] + "','" + hkdb.GetStrTeIn(lblhtm.Text) + "','" + datar3["PromoterID"] + "','" + datar3["EndUserIDs"] + "','" + datar3["EndUserNames"] + "','" + this.Session["userid"] + "',GETDATE())"); } } datar3.Close(); Response.Redirect("HandleWork.aspx"); }
protected void SaveBtn_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(FormName.Text)) { SqlHelper.ExecuteSql("INSERT INTO hk_Form(fNo,FK_fcid,fName,fUserIDs,fUserNames,fContent,FK_uid,FK_did,fQxStr,FK_rid,AddTime) values ('" + hkdb.GetStr(Number.Text) + "','" + FormType.SelectedValue + "','" + hkdb.GetStr(FormName.Text) + "','" + UserID.Text + "','" + UserName.Text + "','" + hkdb.GetStrTeIn(editor.Value) + "','" + this.Session["userid"] + "','" + this.Session["deptid"] + "','" + this.Session["deptqx"] + "','" + this.Session["roleid"] + "',GETDATE())"); mydb.Alert_Refresh_Close("保存成功!", "FormDesign.aspx"); } else { mydb.Alert("请输入表单名称!"); } }