public ActionResult Edit(string id) { if (Session["uname"] != null) { Office ofc = officeService.Get(id); return(View(ofc)); } return(RedirectToAction("Index", "Home")); }
public ActionResult ReceiveConfirmationMail(string id) { ProductService productService = new ProductService(); CustomerService customerService = new CustomerService(); OfficeService officeService = new OfficeService(); Product product = productService.Get(id); Customer customer = customerService.Get(product.CustomerId); Office office = officeService.Get(product.OfficeIdFrom); MailMessage mail = new MailMessage(); mail.To.Add(customer.ReceiverEmail); mail.From = new MailAddress("*****@*****.**"); mail.Subject = "Product Received"; string Body = "Dear <b>" + customer.ReceiverName + ", </b><br/>" + "We just received a product for you that was send by " + customer.CustomerName + ".<br> Please come to our Office with the Product Code below and also bring your Phone 0" + customer.ReceiverPhoneNumber + ".<br/>" + "<b><label>Product Code #: </label>" + product.ProductId + "<b>" + "<br/><label>Product Type : </label>" + product.ProductType + "<br/><label>Quantity : </label>" + product.ProductQuantity + "<br/><label> Office Location : </label>" + office.Location + "<br/><br/><b>For Any Query @Call : </b>" + office.OfficialNumber + "<br/>"; mail.Body = Body; mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.UseDefaultCredentials = false; smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "debug1234"); // Enter seders User name and password smtp.EnableSsl = true; smtp.Send(mail); @TempData["ReceivingMessage"] = " Successfully Received"; return(RedirectToAction("ReceiveProduct", "Product")); }
public ActionResult ProductConfirmationMail(string id) { ProductService productService = new ProductService(); CustomerService customerService = new CustomerService(); OfficeService officeService = new OfficeService(); Product product = productService.Get(id); Customer customer = customerService.Get(product.CustomerId); Office office = officeService.Get(product.OfficeIdFrom); MailMessage mail = new MailMessage(); mail.To.Add(customer.CustomerEmail); mail.From = new MailAddress("*****@*****.**"); mail.Subject = "Oder Confirmation"; string Body = "Dear <b>" + customer.CustomerName + ", </b><br/>" + "Thank you for choosing us. Please keep the following information...<br/>" + "<label>Product Code #: </label>" + product.ProductId + "<br/><label>Product Type : </label>" + product.ProductType + "<br/><label>Quantity : </label>" + product.ProductQuantity + "<br/><label>Total Weight : </label>" + product.ProductWeight + " Unit(s)" + "<br/><label>Shipping Cost : </label>" + product.SendingCost + " TK" + "<br/><label>Sending To : </label>" + customer.ReceiverName + "<br/><br/><b>For Any Query @Call : </b>" + office.OfficialNumber + "<br/>"; mail.Body = Body; mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.UseDefaultCredentials = false; smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "debug1234"); // Enter seders User name and password smtp.EnableSsl = true; smtp.Send(mail); return(RedirectToAction("ProductFinalConfirmation", "Product", new { id = id })); }
public ActionResult Edit(int id) { Office ofc = _OfficeService.Get(id); OfficeViewModel model = new OfficeViewModel(); model.objoffice = ofc; model.Cntries = new SelectList(_CountryService.GetAll(), "Id", "Name", ofc.Country); model.Cties = new SelectList(_CityService.GetCitiesByCountry(Convert.ToInt32(ofc.Country)) .Select(x => new { x.Id, x.Name }), "Id", "Name", ofc.City); model.states = new SelectList(_CityService.Getstatebycity(Convert.ToInt32(ofc.City)) .Select(x => new { x.Id, x.Name }), "Id", "Name", ofc.State); model.CntrySelect = Convert.ToInt32(ofc.Country); model.CitySelect = Convert.ToInt32(ofc.City); model.StateSelect = Convert.ToInt32(ofc.State); return(View(model)); }
public ActionResult Edit(string id) { Office ofc = officeService.Get(id); return(View(ofc)); }