public ActionResult ArrangeVisit() { var model = new ArrangeVisitModel(); if (AreaKind > AreaKind.General) { model.SelectedProduct = Area; } return(GetCustomerDto("A386ECA9-08D5-4717-BC5E-A3D6012943B5", model)); }
public ActionResult ArrangeVisit(ArrangeVisitModel model) { var notes = new StringBuilder(1000); notes.AppendLine(model.Notes); var customer = SaveCustomerDto(model, "Ambassador visit request", 21, notes.ToString()); try { var strBody = new StringBuilder(1000); strBody.AppendLine("<html><body>"); strBody.AppendLine("<h2><u>Customer requested Ambassador visit</u></h2>"); strBody.AppendLine("<table border=0>"); strBody.AppendLine("<tr><td align=right nowrap><b>Name:</b></td><td>" + customer.DefaultContact.FullName + "</td></tr>"); strBody.AppendLine("<tr><td align=right nowrap><b>E-mail:</b></td><td>" + model.Email1 + "</td></tr>"); strBody.AppendLine("<tr><td align=right nowrap><b>Company:</b></td><td>" + customer.CompanyName + "</td></tr>"); strBody.AppendLine("<tr><td> </td><td></td></tr>"); strBody.AppendLine("<tr><td align=right nowrap><b>Address1:</b></td><td>" + model.House + "</td></tr>"); strBody.AppendLine("<tr><td align=right nowrap><b>Address2:</b></td><td>" + model.Street + "</td></tr>"); strBody.AppendLine("<tr><td align=right nowrap><b>Town\\City:</b></td><td>" + model.Town + "</td></tr>"); strBody.AppendLine("<tr><td align=right nowrap><b>Country:</b></td><td>" + customer.PrimaryAddress.Country.Name_En + "</td></tr>"); strBody.AppendLine("<tr><td align=right nowrap><b>Region:</b></td><td>" + customer.PrimaryAddress.Region.Name_En + "</td></tr>"); strBody.AppendLine("<tr><td align=right nowrap><b>County:</b></td><td>" + customer.PrimaryAddress.SubRegion.Name_En + "</td></tr>"); strBody.AppendLine("<tr><td align=right nowrap><b>Postcode:</b></td><td>" + model.PostCode + "</td></tr>"); strBody.AppendLine("<tr><td> </td><td></td></tr>"); strBody.AppendLine("<tr><td align=right nowrap><b>Phone:</b></td><td>" + model.Phone + "</td></tr>"); strBody.AppendLine("<tr><td align=right nowrap><b>Mobile:</b></td><td>" + model.Mobile + "</td></tr>"); strBody.AppendLine("<tr><td> </td><td></td></tr>"); strBody.AppendLine("<tr><td align=right><b>Notes:</b></td><td>" + model.Notes + "</td></tr>"); strBody.AppendLine("</table></body></html>"); var mlClient = new MailManager(); mlClient.SendMail(WebGlobal.SystemMail, "*****@*****.**", "Ambassador visit request", strBody.ToString()); } catch (Exception ex) { WebGlobal.HandleException(ex, System.Web.HttpContext.Current); } return(Redirect("/general/ambassador-visit-request-success")); }