void btn_Click(object sender, EventArgs e) { string accepters = this.Pub1.GetTextBoxByID("TB_Accepter").Text; accepters = accepters.Trim(); if (string.IsNullOrEmpty(accepters)) { this.Alert("接受人不能为空"); return; } string title = this.Pub1.GetTextBoxByID("TB_Title").Text; if (string.IsNullOrEmpty(title)) { this.Alert("标题不能为空"); return; } string doc = this.Pub1.GetTextBoxByID("TB_Doc").Text; /*检查人员是否有问题.*/ string[] emps = accepters.Split(','); BP.WF.Port.WFEmp myemp = new BP.WF.Port.WFEmp(); string errMsg = ""; foreach (string emp in emps) { if (string.IsNullOrEmpty(emp)) { continue; } myemp.No = emp; if (myemp.IsExits == false) { errMsg += "@人员(" + emp + ")拼写错误。"; } } if (string.IsNullOrEmpty(errMsg) == false) { this.Alert(errMsg); return; } foreach (string emp in emps) { if (string.IsNullOrEmpty(emp)) { continue; } myemp.No = emp; myemp.Retrieve(); //执行抄送. BP.WF.Dev2Interface.Node_CC(this.FK_Flow, this.WorkID, emp, myemp.Name, title, doc); } this.WinCloseWithMsg("抄送成功..."); }
public void Skin() { string pageID = this.PageID; string setNo = this.Request.QueryString["SetNo"]; if (setNo != null) { BP.WF.Port.WFEmp em = new BP.WF.Port.WFEmp(BP.Web.WebUser.No); em.Style = setNo; em.Update(); WebUser.Style = setNo; this.Response.Redirect(pageID + ".aspx?RefNo=Skin", true); return; } this.AddFieldSet("风格设置"); BP.WF.XML.Skins sks = new BP.WF.XML.Skins(); sks.RetrieveAll(); this.AddUL(); foreach (BP.WF.XML.Skin item in sks) { if (WebUser.Style == item.No) { this.AddLi(item.Name + " <span style='background:" + item.CSS + "' ><i> </i></span>"); } else { this.AddLi(pageID + ".aspx?RefNo=Skin&SetNo=" + item.No, item.Name + " <span style='background:" + item.CSS + "' ><i> </i></span>"); } //System.Web.UI.WebControls.RadioButton rb = new RadioButton(); //rb.ID = "RB_" + item.No; //rb.Text = item.Name; //rb.GroupName = "s"; //if (WebUser.Style == item.No) // rb.Checked=true; //this.Add(rb); //this.AddBR(); } this.AddULEnd(); Button btn = new Button(); btn.ID = "Btn_Save"; btn.CssClass = "Btn"; btn.Text = "Save"; btn.Click += new EventHandler(btn_SaveSkin_Click); this.AddFieldSetEnd(); // ("风格设置"); }
protected void Page_Load(object sender, EventArgs e) { BP.WF.Port.WFEmp emp = new BP.WF.Port.WFEmp(BP.Web.WebUser.No); BP.WF.Port.WFEmp empAu = new BP.WF.Port.WFEmp(Request["FK_Emp"]); this.sqg.Text = empAu.No + " " + empAu.Name; TB tb = new TB(); tb.ID = "sqrq"; System.DateTime dtNow = System.DateTime.Now; dtNow = dtNow.AddDays(14); this.sqrq.Text = dtNow.ToString(DataType.SysDataTimeFormat); tb.ShowType = TBType.DateTime; tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});"; }
void btnSaveIt_Click(object sender, EventArgs e) { BP.WF.Port.WFEmp emp = new BP.WF.Port.WFEmp(WebUser.No); emp.AuthorDate = BP.DA.DataType.CurrentData; emp.Author = this.Request["FK_Emp"]; emp.AuthorToDate = this.GetTBByID("TB_DT").Text; emp.AuthorWay = this.GetDDLByID("DDL_AuthorWay").SelectedItemIntVal; if (emp.AuthorWay == 2 && emp.AuthorFlows.Length < 3) { this.Alert("您指定授权方式是按指定的流程范围授权,但是您没有指定流程的授权范围."); return; } emp.Update(); BP.Sys.UserLog.AddLog("Auth", WebUser.No, "全部授权"); this.Response.Redirect(this.PageID + ".aspx", true); }
void btn_SaveSkin_Click(object sender, EventArgs e) { BP.WF.XML.Skins sks = new BP.WF.XML.Skins(); sks.RetrieveAll(); foreach (BP.WF.XML.Skin item in sks) { if (this.GetRadioButtonByID("RB_" + item.No).Checked) { WebUser.Style = item.No; BP.WF.Port.WFEmp emp = new BP.WF.Port.WFEmp(WebUser.No); emp.Style = item.No; emp.Update(); this.Response.Redirect(this.Request.RawUrl, true); return; } } }
protected void BtnSave_Click(object sender, EventArgs e) { BP.WF.Port.WFEmp emp = new BP.WF.Port.WFEmp(BP.Web.WebUser.No); emp.AuthorDate = BP.DA.DataType.CurrentData; emp.Author = this.Request["FK_Emp"]; emp.AuthorToDate = this.sqrq.Text; emp.AuthorWay = int.Parse(this.sel.Items[sel.SelectedIndex].Value); if (emp.AuthorWay == 2 && emp.AuthorFlows.Length < 3) { this.Response.Write("您指定授权方式是按指定的流程范围授权,但是您没有指定流程的授权范围."); return; } emp.Update(); //BP.Sys.UserLog.AddLog("Auth", WebUser.No, "全部授权"); BP.Sys.Glo.WriteUserLog("Auth", BP.Web.WebUser.No, "全部授权"); this.Response.Redirect("Default.aspx"); }
public static void DTSData() { string sql = "select No from Port_Emp where No not in (select No from WF_Emp)"; DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sql); foreach (DataRow dr in dt.Rows) { BP.Port.Emp emp1 = new BP.Port.Emp(dr["No"].ToString()); BP.WF.Port.WFEmp empWF = new BP.WF.Port.WFEmp(); empWF.Copy(emp1); try { empWF.UseSta = 1; empWF.DirectInsert(); } catch { } } }
void btn_Profile_Click(object sender, EventArgs e) { string tel = this.GetTextBoxByID("TB_Tel").Text; string mail = this.GetTextBoxByID("TB_Email").Text; int way = this.GetDDLByID("DDL_Way").SelectedItemIntVal; BP.WF.Port.WFEmp emp = new BP.WF.Port.WFEmp(WebUser.No); emp.Tel = tel; emp.Email = mail; emp.HisAlertWay = (BP.WF.Port.AlertWay)way; try { emp.Update(); this.Alert("设置生效,谢谢使用。"); } catch (Exception ex) { this.Alert("设置错误:" + ex.Message); } }
void btnSaveAthFlows_Click(object sender, EventArgs e) { Flows fls = new Flows(); fls.RetrieveAll(); string strs = ""; foreach (Flow fl in fls) { if (this.GetCBByID("CB_" + fl.No).Checked == false) { continue; } strs += "," + fl.No; } BP.WF.Port.WFEmp emp = new BP.WF.Port.WFEmp(WebUser.No); emp.AuthorFlows = strs; emp.Update(); BP.Sys.UserLog.AddLog("Auth", WebUser.No, "授权:" + strs); this.WinCloseWithMsg("保存成功."); }
protected void Page_Load(object sender, EventArgs e) { this.Page.Title = "SMS"; this.AddMsgOfInfo("错误", "没有安装短信发送设备"); return; string sql = "SELECT No,Name,Tel FROM WF_Emp WHERE NO IN (select FK_Emp from WF_GenerWorkerlist WHERE WorkID=" + this.WorkID + " AND FK_Node=" + this.NodeID + ")"; DataTable dt = DBAccess.RunSQLReturnTable(sql); if (dt.Rows.Count == 0) { this.WinCloseWithMsg("对不起,接受人员没有设置短消息提醒。"); return; } this.AddFieldSet("发手机短信提醒"); this.AddTable(); this.AddTR(); this.Add("<TD class=BigDoc>"); bool isHave = false; foreach (DataRow dr in dt.Rows) { CheckBox cb = new CheckBox(); cb.ID = "CB_" + dr["No"].ToString(); BP.WF.Port.WFEmp emp = new BP.WF.Port.WFEmp(dr["No"].ToString()); if (emp.Tel.Length > 10) { cb.Checked = true; cb.Text = emp.No + " " + emp.Name + " ( " + emp.Tel + ")"; isHave = true; } else { cb.Text = emp.No + " " + emp.Name + " (没有设置手机号)"; cb.Checked = false; cb.Enabled = false; this.Add(cb); } } this.AddTDEnd(); this.AddTREnd(); this.AddTR(); this.Add("<TD class=BigDoc>"); TextBox tb = new TextBox(); tb.Attributes["width"] = "100%"; tb.TextMode = TextBoxMode.MultiLine; BP.WF.Node nd = new BP.WF.Node(this.NodeID); tb.Text = "您好:\t\n您有工作需要处理" + nd.Name + " ; \t\n" + WebUser.Name; tb.Columns = 50; tb.Rows = 7; this.Add(tb); this.AddTDEnd(); this.AddTREnd(); this.AddTR(); this.Add("<TD>"); Btn btn = new Btn(); btn.Text = "发送手机消息"; btn.Click += new EventHandler(btn_Click); btn.Enabled = isHave; this.Add(btn); this.AddTDEnd(); this.AddTREnd(); this.AddTableEnd(); this.AddFieldSetEnd(); }
/// <summary> /// 发送邮件。 /// </summary> /// <param name="sms"></param> public void SendMail(BP.Sys.SMS sms) { //如果向 ccim 写入消息。 if (this.CB_IsWriteToCCIM.Checked) { try { Glo.SendMessage(sms.MyPK, DateTime.Now.ToString(), sms.Title + "\t\n" + sms.Doc, sms.MsgAccepter); } catch (Exception ex) { MessageBox.Show(ex.Message, "错误"); return; } } if (string.IsNullOrEmpty(sms.MsgAccepter)) { BP.WF.Port.WFEmp emp = new BP.WF.Port.WFEmp(sms.SendToEmpID); if (sms.MsgType == 0) { sms.MsgAccepter = emp.Email; } else { sms.MsgAccepter = emp.Tel; } } System.Net.Mail.MailMessage myEmail = new System.Net.Mail.MailMessage(); myEmail.From = new MailAddress("*****@*****.**", "ccflow", System.Text.Encoding.UTF8); myEmail.To.Add(sms.MsgAccepter); myEmail.Subject = sms.Title; myEmail.SubjectEncoding = System.Text.Encoding.UTF8;//邮件标题编码 myEmail.Body = sms.Doc; myEmail.BodyEncoding = System.Text.Encoding.UTF8; //邮件内容编码 myEmail.IsBodyHtml = true; //是否是HTML邮件 myEmail.Priority = MailPriority.High; //邮件优先级 SmtpClient client = new SmtpClient(); client.Credentials = new System.Net.NetworkCredential(SystemConfig.GetValByKey("SendEmailAddress", "*****@*****.**"), SystemConfig.GetValByKey("SendEmailPass", "ccflow123")); //上述写你的邮箱和密码 client.Port = SystemConfig.GetValByKeyInt("SendEmailPort", 587); //使用的端口 client.Host = SystemConfig.GetValByKey("SendEmailHost", "smtp.gmail.com"); client.EnableSsl = SystemConfig.GetValByKeyBoolen("SendEmailEnableSsl", true); object userState = myEmail; try { client.SendAsync(myEmail, userState); sms.HisMsgSta = BP.Sys.MsgSta.RunOK; sms.Update(); } catch (System.Net.Mail.SmtpException ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { this.Page.Title = "Empleyes"; if (WebUser.IsWap) { this.BindWap(); return; } string sql = "SELECT a.No,a.Name, b.Name as DeptName FROM Port_Emp a, Port_Dept b WHERE a.FK_Dept=b.No ORDER BY a.FK_Dept "; DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sql); BP.WF.Port.WFEmps emps = new BP.WF.Port.WFEmps(); if (this.DoType != null) { emps.RetrieveAllFromDBSource(); } else { emps.RetrieveAllFromDBSource(); } this.Pub1.AddTable("width=100% align=left"); this.Pub1.AddCaptionMsg("通讯录"); this.Pub1.AddTR(); this.Pub1.AddTDTitle("IDX"); this.Pub1.AddTDTitle("部门"); this.Pub1.AddTDTitle("人员"); this.Pub1.AddTDTitle("Tel"); this.Pub1.AddTDTitle("Email"); this.Pub1.AddTDTitle("岗位"); // <a href=Emps.aspx?DoType=1>刷新</a> "); this.Pub1.AddTDTitle("签名"); if (WebUser.No == "admin") { this.Pub1.AddTDTitle("顺序"); } if (this.DoType != null) { BP.WF.Port.WFEmp.DTSData(); this.GenerAllImg(); } this.Pub1.AddTREnd(); string keys = DateTime.Now.ToString("MMddhhmmss"); string deptName = null; int idx = 0; EmpStations ess = new EmpStations(); ess.RetrieveAll(); foreach (DataRow dr in dt.Rows) { string fk_emp = dr["No"].ToString(); if (fk_emp == "admin") { continue; } idx++; if (dr["DeptName"].ToString() != deptName) { deptName = dr["DeptName"].ToString(); this.Pub1.AddTRSum(); this.Pub1.AddTDIdx(idx); this.Pub1.AddTD(deptName); } else { this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx); this.Pub1.AddTD(); } this.Pub1.AddTD(fk_emp + "-" + dr["Name"]); BP.WF.Port.WFEmp emp = emps.GetEntityByKey(fk_emp) as BP.WF.Port.WFEmp; if (emp != null) { //this.Pub1.AddTD(emp.TelHtml); //this.Pub1.AddTD(emp.EmailHtml); this.Pub1.AddTD(); this.Pub1.AddTD(); string stas = ""; foreach (EmpStation es in ess) { if (es.FK_Emp != emp.No) { continue; } stas += es.FK_StationT + ","; } this.Pub1.AddTD(stas); } else { this.Pub1.AddTD(""); this.Pub1.AddTD(""); this.Pub1.AddTD(""); //break; } this.Pub1.AddTD("<img src='../DataUser/Siganture/" + fk_emp + ".jpg' border=1 onerror=\"this.src='../DataUser/Siganture/UnName.jpg'\"/>"); if (WebUser.No == "admin" && emp != null) { this.Pub1.AddTD("<a href=\"javascript:DoUp('" + emp.No + "','" + keys + "')\" ><img src='Img/Btn/Up.gif' border=0 /></a>-<a href=\"javascript:DoDown('" + emp.No + "','" + keys + "')\" ><img src='Img/Btn/Down.gif' border=0 /></a>"); } this.Pub1.AddTREnd(); } this.Pub1.AddTableEnd(); }
public void AthFlows() { FlowSorts sorts = new FlowSorts(); sorts.RetrieveAll(); Flows fls = new Flows(); fls.RetrieveAll(); BP.WF.Port.WFEmp emp = new BP.WF.Port.WFEmp(WebUser.No); this.AddTable(); this.AddCaptionLeft("授权流程范围"); this.AddTR(); this.AddTDTitle("IDX"); this.AddTDTitle("类别"); this.AddTDTitle("流程"); this.AddTREnd(); int i = 0; foreach (FlowSort sort in sorts) { i++; this.AddTRSum(); this.AddTDIdx(i); this.AddTDB(sort.Name); CheckBox cbAll = new CheckBox(); cbAll.Text = "选择类别下全部"; cbAll.ID = "CB_d" + sort.No; this.AddTD(cbAll); this.AddTREnd(); string ctlIDs = ""; foreach (Flow fl in fls) { if (fl.FK_FlowSort != sort.No) { continue; } i++; this.AddTR(); this.AddTDIdx(i); this.AddTD(""); CheckBox cb = new CheckBox(); cb.ID = "CB_" + fl.No; cb.Text = fl.Name; if (emp.AuthorFlows.Contains(fl.No)) { cb.Checked = true; } ctlIDs += cb.ID + ","; this.AddTD(cb); this.AddTREnd(); } cbAll.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')"; } this.AddTR(); this.AddTDTitle(""); Button btnSaveAthFlows = new Button(); btnSaveAthFlows.CssClass = "Btn"; btnSaveAthFlows.ID = "Btn_Save"; btnSaveAthFlows.Text = "Save"; btnSaveAthFlows.Click += new EventHandler(btnSaveAthFlows_Click); this.Add(btnSaveAthFlows); this.AddTD("colspan=2", btnSaveAthFlows); this.AddTREnd(); this.AddTableEnd(); }
public void BindProfile() { BP.WF.Port.WFEmp emp = new BP.WF.Port.WFEmp(WebUser.No); if (WebUser.IsWap) { this.AddFieldSet("<a href=Home.aspx ><img src='/WF/Img/Home.gif' border=0 >主页</a>-<a href='" + this.PageID + ".aspx'>设置</a>-" + "基本信息" + WebUser.Auth); } else { this.AddFieldSet("基本信息" + WebUser.Auth); } this.Add("<br><table border=0 width='80%' align=center >"); this.AddTR(); this.AddTD("手机"); TextBox tb = new TextBox(); tb.TextMode = TextBoxMode.SingleLine; tb.ID = "TB_Tel"; tb.Text = emp.Tel; this.AddTD(tb); this.AddTREnd(); this.AddTR(); this.AddTD("Email"); tb = new TextBox(); tb.TextMode = TextBoxMode.SingleLine; tb.ID = "TB_Email"; tb.Text = emp.Email; this.AddTD(tb); this.AddTREnd(); this.AddTR(); this.AddTD("QQ/RTX/MSN"); tb = new TextBox(); tb.TextMode = TextBoxMode.SingleLine; tb.ID = "TB_TM"; tb.Text = emp.Email; this.AddTD(tb); this.AddTREnd(); this.AddTR(); this.AddTD("信息接收方式"); DDL ddl = new DDL(); ddl.ID = "DDL_Way"; ddl.BindSysEnum("AlertWay"); //ddl.Items.Add(new ListItem("不接收", "0")); //ddl.Items.Add(new ListItem("手机短信", "1")); //ddl.Items.Add(new ListItem("邮件", "2")); //ddl.Items.Add(new ListItem("手机短信+邮件", "3")); ddl.SetSelectItem((int)emp.HisAlertWay); this.AddTD(ddl); this.AddTREnd(); this.AddTR(); Btn btn = new Btn(); btn.Text = "保存"; btn.Click += new EventHandler(btn_Profile_Click); this.AddTD("colspan=2 align=center", btn); this.AddTREnd(); this.AddTableEnd(); this.AddBR(); this.AddFieldSetEnd(); }
protected void Page_Load(object sender, System.EventArgs e) { Response.AddHeader("P3P", "CP=CAO PSA OUR"); Response.AddHeader("Cache-Control", "no-store"); Response.AddHeader("Expires", "0"); Response.AddHeader("Pragma", "no-cache"); string url = this.Request.RawUrl; if (url.Contains("DTT=") == false) { //this.Response.Redirect(url + "&DTT=" + DateTime.Now.ToString("mmDDhhmmss"), true); //return; } try { switch (this.ActionType) { case "Focus": //把任务放入任务池. BP.WF.Dev2Interface.Flow_Focus(Int64.Parse(this.Request.QueryString["WorkID"])); this.WinClose("ss"); break; case "PutOne": //把任务放入任务池. Int64 workid42 = Int64.Parse(this.Request.QueryString["WorkID"]); BP.WF.Dev2Interface.Node_TaskPoolPutOne(workid42); this.WinClose("ss"); break; case "DoAppTask": // 申请任务. Int64 workid2 = Int64.Parse(this.Request.QueryString["WorkID"]); BP.WF.Dev2Interface.Node_TaskPoolTakebackOne(workid2); this.WinClose("ss"); return; case "DoOpenCC": string fk_flow1 = this.Request.QueryString["FK_Flow"]; string fk_node1 = this.Request.QueryString["FK_Node"]; string workid1 = this.Request.QueryString["WorkID"]; string fid1 = this.Request.QueryString["FID"]; string Sta = this.Request.QueryString["Sta"]; if (Sta == "0") { BP.WF.Template.CCList cc1 = new BP.WF.Template.CCList(); cc1.MyPK = this.Request.QueryString["MyPK"]; cc1.Retrieve(); cc1.HisSta = CCSta.Read; cc1.Update(); } this.Response.Redirect("./WorkOpt/OneWork/Track.aspx?FK_Flow=" + fk_flow1 + "&FK_Node=" + fk_node1 + "&WorkID=" + workid1 + "&FID=" + fid1, false); return; case "DelCC": //删除抄送. CCList cc = new CCList(); cc.MyPK = this.MyPK; cc.Retrieve(); cc.HisSta = CCSta.Del; cc.Update(); this.WinClose(); break; case "DelSubFlow": //删除进程。 try { BP.WF.Dev2Interface.Flow_DeleteSubThread(this.FK_Flow, this.WorkID, "手工删除"); this.WinClose(); } catch (Exception ex) { this.WinCloseWithMsg(ex.Message); } break; case "DownBill": Bill b = new Bill(this.MyPK); b.DoOpen(); break; case "DelDtl": GEDtls dtls = new GEDtls(this.EnsName); GEDtl dtl = (GEDtl)dtls.GetNewEntity; dtl.OID = this.RefOID; if (dtl.RetrieveFromDBSources() == 0) { this.WinClose(); break; } FrmEvents fes = new FrmEvents(this.EnsName); //获得事件. // 处理删除前事件. try { fes.DoEventNode(BP.WF.XML.EventListDtlList.DtlItemDelBefore, dtl); } catch (Exception ex) { this.WinCloseWithMsg(ex.Message); break; } dtl.Delete(); // 处理删除后事件. try { fes.DoEventNode(BP.WF.XML.EventListDtlList.DtlItemDelAfter, dtl); } catch (Exception ex) { this.WinCloseWithMsg(ex.Message); break; } this.WinClose(); break; case "EmpDoUp": BP.WF.Port.WFEmp ep = new BP.WF.Port.WFEmp(this.RefNo); ep.DoUp(); BP.WF.Port.WFEmps emps111 = new BP.WF.Port.WFEmps(); // emps111.RemoveCash(); emps111.RetrieveAll(); this.WinClose(); break; case "EmpDoDown": BP.WF.Port.WFEmp ep1 = new BP.WF.Port.WFEmp(this.RefNo); ep1.DoDown(); BP.WF.Port.WFEmps emps11441 = new BP.WF.Port.WFEmps(); // emps11441.RemoveCash(); emps11441.RetrieveAll(); this.WinClose(); break; case "Track": //通过一个串来打开一个工作. string mySid = this.Request.QueryString["SID"]; string[] mystrs = mySid.Split('_'); Int64 myWorkID = int.Parse(mystrs[1]); string fk_emp = mystrs[0]; int fk_node = int.Parse(mystrs[2]); Node mynd = new Node(); mynd.NodeID = fk_node; mynd.RetrieveFromDBSources(); string fk_flow = mynd.FK_Flow; string myurl = "./WorkOpt/OneWork/Track.aspx?FK_Node=" + mynd.NodeID + "&WorkID=" + myWorkID + "&FK_Flow=" + fk_flow; Web.WebUser.SignInOfGener(new BP.Port.Emp(fk_emp), true); this.Response.Write("<script> window.location.href='" + myurl + "'</script> *^_^* <br><br>正在进入系统请稍后,如果长时间没有反应,请<a href='" + myurl + "'>点这里进入。</a>"); return; case "OF": //通过一个串来打开一个工作. string sid = this.Request.QueryString["SID"]; string[] strs = sid.Split('_'); GenerWorkerList wl = new GenerWorkerList(); int i = wl.Retrieve(GenerWorkerListAttr.FK_Emp, strs[0], GenerWorkerListAttr.WorkID, strs[1], GenerWorkerListAttr.FK_Node, strs[2]); if (i == 0) { this.Response.Write("<h2>提示</h2>此工作已经被别人处理或者此流程已删除。"); return; } BP.Port.Emp empOF = new BP.Port.Emp(wl.FK_Emp); Web.WebUser.SignInOfGener(empOF, true); string u = "MyFlow.aspx?FK_Flow=" + wl.FK_Flow + "&WorkID=" + wl.WorkID + "&FK_Node=" + wl.FK_Node + "&FID=" + wl.FID; this.Response.Write("<script> window.location.href='" + u + "'</script> *^_^* <br><br>正在进入系统请稍后,如果长时间没有反应,请<a href='" + u + "'>点这里进入。</a>"); return; case "ExitAuth": BP.Port.Emp emp = new BP.Port.Emp(this.FK_Emp); //首先退出,再进行登录 BP.Web.WebUser.Exit(); BP.Web.WebUser.SignInOfGenerLang(emp, WebUser.SysLang); this.WinClose(); return; case "LogAs": BP.WF.Port.WFEmp wfemp = new BP.WF.Port.WFEmp(this.FK_Emp); if (wfemp.AuthorIsOK == false) { this.WinCloseWithMsg("授权失败"); return; } BP.Port.Emp emp1 = new BP.Port.Emp(this.FK_Emp); BP.Web.WebUser.SignInOfGener(emp1, WebUser.SysLang, WebUser.No, true, false); this.WinClose(); return; case "TakeBack": // 取消授权。 BP.WF.Port.WFEmp myau = new BP.WF.Port.WFEmp(WebUser.No); BP.DA.Log.DefaultLogWriteLineInfo("取消授权:" + WebUser.No + "取消了对(" + myau.Author + ")的授权。"); myau.Author = ""; myau.AuthorWay = 0; myau.Update(); this.WinClose(); return; case "AutoTo": // 执行授权。 BP.WF.Port.WFEmp au = new BP.WF.Port.WFEmp(); au.No = WebUser.No; au.RetrieveFromDBSources(); au.AuthorDate = BP.DA.DataType.CurrentData; au.Author = this.FK_Emp; au.AuthorWay = 1; au.Save(); BP.DA.Log.DefaultLogWriteLineInfo("执行授权:" + WebUser.No + "执行了对(" + au.Author + ")的授权。"); this.WinClose(); return; case "UnSend": //执行撤消发送。 this.Response.Redirect("./WorkOpt/UnSend.aspx?WorkID=" + this.WorkID + "&FK_Flow=" + this.FK_Flow, false); return; case "SetBillState": break; case "WorkRpt": Bill bk1 = new Bill(this.Request.QueryString["OID"]); Node nd = new Node(bk1.FK_Node); this.Response.Redirect("WFRpt.aspx?WorkID=" + bk1.WorkID + "&FID=" + bk1.FID + "&FK_Flow=" + nd.FK_Flow + "&NodeId=" + bk1.FK_Node, false); //this.WinOpen(); //this.WinClose(); break; case "PrintBill": //Bill bk2 = new Bill(this.Request.QueryString["OID"]); //Node nd2 = new Node(bk2.FK_Node); //this.Response.Redirect("NodeRefFunc.aspx?NodeId=" + bk2.FK_Node + "&FlowNo=" + nd2.FK_Flow + "&NodeRefFuncOID=" + bk2.FK_NodeRefFunc + "&WorkFlowID=" + bk2.WorkID); ////this.WinClose(); break; //删除流程中第一个节点的数据,包括待办工作 case "DeleteFlow": string fk_flowDel = this.Request.QueryString["FK_Flow"]; Int64 workid = Int64.Parse(this.Request.QueryString["WorkID"]); //调用DoDeleteWorkFlowByReal方法 WorkFlow wf = new WorkFlow(new Flow(fk_flowDel), workid); wf.DoDeleteWorkFlowByReal(true); // Glo.ToMsg("流程删除成功"); BP.WF.Glo.ToMsg("流程删除成功"); //this.ToWFMsgPage("流程删除成功"); break; default: throw new Exception("ActionType error" + this.ActionType); } } catch (Exception ex) { this.ToErrorPage("执行其间如下异常:<BR>" + ex.Message); } }
/// <summary> /// 发送邮件。 /// </summary> /// <param name="sms"></param> public void SendMail(SMS sms) { #region 发送邮件. if (string.IsNullOrEmpty(sms.Email)) { BP.WF.Port.WFEmp emp = new BP.WF.Port.WFEmp(sms.SendToEmpNo); sms.Email = emp.Email; } System.Net.Mail.MailMessage myEmail = new System.Net.Mail.MailMessage(); myEmail.From = new MailAddress("*****@*****.**", "ccbpm123", System.Text.Encoding.UTF8); myEmail.To.Add(sms.Email); myEmail.Subject = sms.Title; myEmail.SubjectEncoding = System.Text.Encoding.UTF8;//邮件标题编码 myEmail.Body = sms.DocOfEmail; myEmail.BodyEncoding = System.Text.Encoding.UTF8; //邮件内容编码 myEmail.IsBodyHtml = true; //是否是HTML邮件 myEmail.Priority = MailPriority.High; //邮件优先级 SmtpClient client = new SmtpClient(); //邮件地址. string emailAddr = SystemConfig.GetValByKey("SendEmailAddress", null); if (emailAddr == null) { emailAddr = "*****@*****.**"; } string emailPassword = SystemConfig.GetValByKey("SendEmailPass", null); if (emailPassword == null) { emailPassword = "******"; } //是否启用ssl? bool isEnableSSL = false; string emailEnableSSL = SystemConfig.GetValByKey("SendEmailEnableSsl", null); if (emailEnableSSL == null || emailEnableSSL == "0") { isEnableSSL = false; } else { isEnableSSL = true; } client.Credentials = new System.Net.NetworkCredential(emailAddr, emailPassword); //上述写你的邮箱和密码 client.Port = SystemConfig.GetValByKeyInt("SendEmailPort", 25); //使用的端口 client.Host = SystemConfig.GetValByKey("SendEmailHost", "smtp.tom.com"); //是否启用加密,有的邮件服务器发送配置不成功就是因为此参数的错误。 client.EnableSsl = SystemConfig.GetValByKeyBoolen("SendEmailEnableSsl", isEnableSSL); object userState = myEmail; try { client.SendAsync(myEmail, userState); sms.HisEmailSta = MsgSta.RunOK; sms.Update(); } catch (System.Net.Mail.SmtpException ex) { throw ex; } #endregion 发送邮件. }
public void BindPer() { if (WebUser.Auth != null) { this.AddFieldSet("提示"); this.AddBR(); this.Add("您的登陆是授权模式,您不能查看个人信息。"); this.AddUL(); this.AddLi("<a href=\"javascript:ExitAuth('" + WebUser.Auth + "')\">退出授权模式</a>"); this.AddLi("<a href=" + this.PageID + ".aspx >设置</a>"); if (WebUser.IsWap) { this.AddLi("<a href='Home.aspx'>返回主页</a>"); } this.AddULEnd(); this.AddFieldSetEnd(); return; } if (WebUser.IsWap) { this.AddFieldSet("<a href=Home.aspx ><img src='/WF/Img/Home.gif' border=0 >主页</a>-<a href='" + this.PageID + ".aspx'>设置</a>-" + "基本信息" + WebUser.Auth); } else { this.AddFieldSet("基本信息" + WebUser.Auth); } this.Add("<p class=BigDoc >"); this.Add("用户帐号: <font color=green>" + WebUser.No + "</font> "); this.Add("<br>用户名: <font color=green>" + WebUser.Name + "</font> "); this.AddHR(); this.AddB("电子签字:<img src='/DataUser/Siganture/" + WebUser.No + ".jpg' border=1 onerror=\"this.src='/DataUser/Siganture/UnName.jpg'\"/> ,<a href='" + this.PageID + ".aspx?RefNo=Siganture' >设置/修改</a>。"); this.AddBR(); this.AddBR(); this.Add("主部门 : <font color=green>" + WebUser.FK_DeptName + "</font>"); this.AddBR(); this.AddBR(); BP.WF.Port.WFEmp au = new BP.WF.Port.WFEmp(WebUser.No); // this.Add(au.AuthorIsOK.ToString()); if (au.AuthorIsOK == false) { this.Add("授权情况:未授权 - <a href='" + this.PageID + ".aspx?RefNo=Auto' >执行授权</a>。"); } else { string way = ""; if (au.AuthorWay == 1) { way = "全部授权"; } else { way = "指定流程范围授权"; } this.Add("授权情况:授权给:<font color=green>" + au.Author + "</font>,授权日期: <font color=green>" + au.AuthorDate + "</font>,收回授权日期:<font color=green>" + au.AuthorToDate + "</font>。<br>我要:<a href=\"javascript:TakeBack('" + au.Author + "')\" >取消授权</a>;授权方式:<font color=green>" + way + "</font>,<a href=\"" + this.PageID + ".aspx?RefNo=AutoDtl&FK_Emp=" + au.Author + "\">我要修改授权信息</a>。"); } this.Add(" 我要:<a href='" + this.PageID + ".aspx?RefNo=Pass'>修改密码</a>"); this.AddBR("<hr><b>信息提示:</b><a href='" + this.PageID + ".aspx?RefNo=Profile'>设置/修改</a>"); this.Add("<br><br>接受短消息提醒手机号 : <font color=green>" + au.TelHtml + "</font>"); this.Add("<br><br>接受E-mail提醒 : <font color=green>" + au.EmailHtml + "</font>"); this.AddHR(); Stations sts = WebUser.HisStations; this.AddB("岗位/部门-权限"); this.AddBR(); this.AddBR("岗位权限"); foreach (Station st in sts) { this.Add(" - <font color=green>" + st.Name + "</font>"); } Depts depts = WebUser.HisDepts; this.AddBR(); this.AddBR(); this.Add("部门权限"); foreach (Dept st in depts) { this.Add(" - <font color=green>" + st.Name + "</font>"); } this.Add("</p>"); this.AddFieldSetEnd(); }
/// <summary> /// 授权明细 /// </summary> public void BindAutoDtl() { if (WebUser.IsWap) { this.AddFieldSet("<a href=Home.aspx ><img src='/WF/Img/Home.gif' border=0 >Home</a>-<a href='" + this.PageID + ".aspx'>设置</a>-授权详细信息"); } else { this.AddFieldSet("授权详细信息"); } BP.WF.Port.WFEmp emp = new BP.WF.Port.WFEmp(WebUser.No); BP.WF.Port.WFEmp empAu = new BP.WF.Port.WFEmp(this.Request["FK_Emp"]); this.AddBR(); this.AddTable(); this.AddTR(); this.AddTDTitle("项目"); this.AddTDTitle("内容"); this.AddTREnd(); this.AddTR(); this.AddTD("授权给:"); this.AddTD(empAu.No + " " + empAu.Name); this.AddTREnd(); this.AddTR(); this.AddTD("收回授权日期:"); TB tb = new TB(); tb.ID = "TB_DT"; System.DateTime dtNow = System.DateTime.Now; dtNow = dtNow.AddDays(14); tb.Text = dtNow.ToString(DataType.SysDataTimeFormat); tb.ShowType = TBType.DateTime; tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});"; this.AddTD(tb); this.AddTREnd(); this.AddTR(); this.AddTD("授权方式:"); DDL ddl = new DDL(); ddl.ID = "DDL_AuthorWay"; ddl.BindSysEnum(BP.WF.Port.WFEmpAttr.AuthorWay); ddl.SetSelectItem(emp.AuthorWay); this.AddTD(ddl); this.AddTREnd(); Button btnSaveIt = new Button(); btnSaveIt.ID = "Btn_Save"; btnSaveIt.CssClass = "Btn"; btnSaveIt.Text = "Save"; btnSaveIt.Click += new EventHandler(btnSaveIt_Click); this.AddTR(); this.AddTD("colspan=1", "<b><a href=\"javascript:WinShowModalDialog('ToolsSet.aspx?RefNo=AthFlows&d=" + DateTime.Now.ToString() + "')\" >设置要授权的流程范围</a></b>"); this.AddTD("colspan=1", btnSaveIt); this.AddTREnd(); this.AddTR(); this.AddTDBigDoc("colspan=2", "说明:在您确定了收回授权日期后,被授权人不能再以您的身份登陆,<br>如果未到指定的日期您可以取回授权。"); this.AddTREnd(); this.AddTableEndWithBR(); this.AddFieldSetEnd(); }