/// <summary> /// /// </summary> /// <param name="EmailGuid"></param> /// <param name="Isreply"></param> /// <returns></returns> public ActionResult ComposeEmail(Nullable <Guid> EmailGuid, Nullable <bool> Isreply) { ComposeEmail ComposeEmail = new ComposeEmail(); UserDomainLogic UserDomainLogic = new UserDomainLogic(); EmailDomainLogic EmailDomainLogic = new EmailDomainLogic(); ViewBag.PopupTitle = "Send Message"; if (EmailGuid != null && EmailGuid != Guid.Empty) { ComposeEmail = EmailDomainLogic.GetEmailByEmailGuid(EmailGuid.HasValue ? EmailGuid.Value : Guid.Empty); ComposeEmail.EmailMessage.Body = "<br><hr>" + ComposeEmail.EmailMessage.Body; ComposeEmail.EmailMessage.Subject = (Isreply.HasValue ? (Isreply.Value ? "Re: " : "Fwd: ") : "") + ComposeEmail.EmailMessage.Subject; // ComposeEmail.EmailMessage.EmailTo = (Isreply.HasValue ? (Isreply.Value ? ComposeEmail.EmailMessage.EmailTo : "") : ""); ComposeEmail.Isemailreplyorforward = true; } if (UserVariables.UserRole == Domain.Enums.User.UserRoles.Buyer) { ComposeEmail.UserContactList = UserDomainLogic.GetAllMerchants(); } else { ComposeEmail.UserContactList = UserDomainLogic.GetAllBuyers(); } return(PartialView("_ComposeEmail", ComposeEmail)); }
public ActionResult ComposeEmail(ComposeEmail ComposeEmail) { EmailDomainLogic email = new EmailDomainLogic(); if (ModelState.IsValid) { ComposeEmail.EmailMessage.TemplateType = Enum.GetName(typeof(TemplateType), TemplateType.Mail); ViewBag.Ismessagesent = email.SendEmail(ComposeEmail); ViewBag.IspopUp = true; } ViewBag.PopupTitle = "Send Message"; UserDomainLogic UserDomainLogic = new UserDomainLogic(); if (UserVariables.UserRole == Domain.Enums.User.UserRoles.Buyer) { ComposeEmail.UserContactList = UserDomainLogic.GetAllMerchants(); } else { ComposeEmail.UserContactList = UserDomainLogic.GetAllBuyers(); } return(PartialView("_ComposeEmail", ComposeEmail)); }
/// <summary> /// /// </summary> /// <returns></returns> public List <Contact> GetAllBuyers() { UserDomainLogic userDomainLogic = new UserDomainLogic(); return(userDomainLogic.GetAllBuyers()); }