Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void SendEmail_ItemClick(object sender, ItemClickEventArgs e)
- {
- var comment = UseTaskCommentForm();
- if (string.IsNullOrWhiteSpace(comment))
- {
- UiService.ShowMessage(Resources.Resources.EmptyCommentError);
- return;
- }
- else if (string.CompareOrdinal(comment, "Cancel") == 0)
- {
- return;
- }
- LayoutControl.Enabled = false;
- RibbonControl.Enabled = false;
- GenerateNotificationToInitiator(comment);
- LayoutControl.Enabled = true;
- RibbonControl.Enabled = true;
- }
- internal void GenerateNotificationToInitiator(string comment)
- {
- var docId = GetApprovingDocumentId();
- if (!docId.HasValue) return;
- var doc = Context.GetObject<Document>(docId.Value);
- var recipient = doc.MainInfo.Author;
- List<string> recEmail = new List<string>();
- List<string> ccEmail = new List<string>();
- if (recipient.Email != string.Empty) recEmail.Add(recipient.Email);
- ccEmail.Add(!string.IsNullOrEmpty(StaffService.GetCurrentEmployee().Email)
- ? StaffService.GetCurrentEmployee().Email
- : string.Empty);
- // Выгружаем файлы
- string filesPath = GetFilesInTask(Task);
- if (recEmail.Count > 0)
- {
- string templateName = "Lawyer_1";
- ExtensionManagerHelper.SendNotificationForApprovingProcess(Session, DateTime.Now, templateName,
- new Dictionary<string, string>()
- {
- {"{Digest}", doc.Description},
- {"{attachfolder}", filesPath},
- {"{Comment}", comment}
- }, recEmail, ccEmail);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement