private System.Web.Mail.MailMessage BuildMessage(string reworkCode, string mUser, int mdate, int mtime) { BenQGuru.eMES.BaseSetting.UserFacade userFacade = new BenQGuru.eMES.BaseSetting.UserFacade(_domainDataProvider); object user = userFacade.GetUser(mUser); System.Web.Mail.MailMessage message = new System.Web.Mail.MailMessage(); message.Subject = string.Format("返工需求单({0}),待签核:", reworkCode); message.Priority = System.Web.Mail.MailPriority.High; message.Body = string.Format(@" <html> <table> <tr> <td>您好! </td> </tr> <tr align=right><td> 新增返工需求单 ({0}), 待签核。</td> </tr> <tr align=right><td> {1}</td> </tr> <tr align=right><td> {2}</td> </tr> <tr align=right><td> {3}</td> </tr> </table> </html>", reworkCode, mUser, (user as BenQGuru.eMES.Domain.BaseSetting.User).UserTelephone, FormatHelper.TODateTimeString(mdate, mtime, "-", ":")); return(message); }
private void SendMail(BenQGuru.eMES.Domain.Alert.Alert alert) { BenQGuru.eMES.Web.Helper.ESmtpMail mail = this.GetNewMail(); //收件人 BenQGuru.eMES.BaseSetting.UserFacade userfacade = new BenQGuru.eMES.BaseSetting.UserFacade(DataProvider); int recipientCount = 0; foreach (ListItem li in this.lstUser.Items) { if (li.Value != null && li.Value != string.Empty) { BenQGuru.eMES.Domain.BaseSetting.User user = userfacade.GetUser(li.Value) as BenQGuru.eMES.Domain.BaseSetting.User; if (user != null && user.UserEmail != null && user.UserEmail != string.Empty && user.UserEmail.IndexOf("@") != -1) { mail.AddRecipient(user.UserName, user.UserEmail); recipientCount++; } } } if (recipientCount > 0) { mail.Body = alert.AlertMsg; if (!mail.Send()) { BenQGuru.eMES.Common.ExceptionManager.Raise(this.GetType(), mail.ErrorMessage); } } }
protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { // 初始化页面语言 this.InitPageLanguage(this.languageComponent1, false); } _facade = new BenQGuru.eMES.AlertModel.AlertBillFacade(DataProvider); _userfacade = new BenQGuru.eMES.BaseSetting.UserFacade(DataProvider); _itemcode = Request.QueryString["itemcode"]; _alerttype = Request.QueryString["alerttype"]; _alertitem = Request.QueryString["alertitem"]; _billId = int.Parse(Request.QueryString["billid"]); if (this._alerttype == AlertType_Old.ResourceNG) { isResourceNG = true; } if (isResourceNG) { _rescode = Request.QueryString["rescode"]; _ecg2ec = Request.QueryString["ecg2ec"]; } }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (_facade == null) { _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade(); } return(this._facade.GetAllUserGroup(this.txtUserCode.Text)); }
protected void drpApproverEdit_Load(object sender, System.EventArgs e) { if (!IsPostBack) { if (_userManager == null) { _userManager = new ReworkFacadeFactory(base.DataProvider).CreateUserManager(); } DropDownListBuilder builder = new DropDownListBuilder(this.drpApproverEdit); builder.HandleGetObjectList = new GetObjectListDelegate(this._userManager.GetAllUser); builder.Build("UserCode", "UserCode"); ListItem item = new ListItem("", string.Empty); this.drpApproverEdit.Items.Insert(0, item); } }
private void SaveData() { try { DataProvider.BeginTransaction(); BenQGuru.eMES.Domain.Alert.Alert alert = this._alertFacade.GetAlert(this._alertID) as BenQGuru.eMES.Domain.Alert.Alert; if (alert != null) { alert.AlertLevel = this.drpAlertLevel.SelectedValue; alert.AlertStatus = this.drpAlertStatus.SelectedValue; alert.Description = this.txtDesc.Text; alert.MaintainUser = this.GetUserCode(); alert.MaintainDate = FormatHelper.TODateInt(DateTime.Now.ToShortDateString()); alert.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now); _alertFacade.UpdateAlert(alert); //写处理记录表 BenQGuru.eMES.Domain.Alert.AlertHandleLog log = this._alertFacade.CreateNewAlertHandleLog(); log.AlertID = alert.AlertID; log.AlertLevel = alert.AlertLevel; log.AlertStatus = alert.AlertStatus; log.HandleUser = alert.MaintainUser; log.HandleDate = alert.MaintainDate; log.HandleTime = alert.MaintainTime; log.HandleMsg = alert.Description; log.HandleSeq = _alertFacade.GetNextHandleSeq(alert.AlertID); BenQGuru.eMES.BaseSetting.UserFacade userfacade = new BenQGuru.eMES.BaseSetting.UserFacade(DataProvider); BenQGuru.eMES.Domain.BaseSetting.User user = userfacade.GetUser(log.HandleUser) as BenQGuru.eMES.Domain.BaseSetting.User; if (user != null) { log.UserEmail = user.UserEmail; } _alertFacade.AddAlertHandleLog(log); } DataProvider.CommitTransaction(); } catch (System.Exception ex) { this.DataProvider.RollbackTransaction(); throw ex; } }
protected void cmdAddUser_Click(object sender, System.EventArgs e) { BenQGuru.eMES.BaseSetting.UserFacade userFacade = null; string[] users = this.stbUser.Text.Trim().Split(','); if (users.Length > 0) { userFacade = new BenQGuru.eMES.BaseSetting.UserFacade(this.DataProvider); } for (int i = 0; i < users.Length; i++) { if (this.lstUser.Items.FindByValue(users[i]) == null) { BenQGuru.eMES.Domain.BaseSetting.User user = (BenQGuru.eMES.Domain.BaseSetting.User)userFacade.GetUser(users[i]); if (user != null) { lstUser.Items.Add(new ListItem(user.UserCode + "(" + user.UserEmail + ")", user.UserCode)); } } } }