public ActionResult ForgotPassword(string Username) { try { CustomerDataStore ObjUser = new CustomerDataStore(); SA_Customer loginUser = ObjUser.GetCustomerByEmail(Username); if (loginUser == null) { TempData["ErrorMessage"] = "User does not exist."; return(View()); } //string strEncryptedCurr = (Helpers.Encrypt(CurPassword)); string strDecryptedCurr = (Helpers.Decrypt(loginUser.UserPassword)); string EmailBody = SubscriptionDAL.GetHtml("ContactUs.html"); EmailBody = EmailBody.Replace("#Password", strDecryptedCurr); SubscriptionDAL.SendMail("Chem Analyst", "info@chemanalyst", Username, "CONTACT US", EmailBody, "*****@*****.**"); TempData["ErrorMessage"] = "Password sent on your email address."; return(View()); } catch (Exception ex) { TempData["ErrorMessage"] = "Error" + ex.ToString(); return(View()); } }
public JsonResult SendContactUs(ContactUs lead) { bool result = false; try { string EmailBody = SubscriptionDAL.GetHtml("ContactUs.html"); EmailBody = EmailBody.Replace("#Name", lead.Name); EmailBody = EmailBody.Replace("#OfficalEmail", lead.OfficalEmail); EmailBody = EmailBody.Replace("#Mobile", lead.Mobile); EmailBody = EmailBody.Replace("#Organization", lead.Organisation); EmailBody = EmailBody.Replace("#Country", lead.Country); EmailBody = EmailBody.Replace("#State", lead.State); EmailBody = EmailBody.Replace("#City", lead.City); SubscriptionDAL.SendMail("Chem Analyst", "info@chemanalyst", "*****@*****.**", "CONTACT US", EmailBody, "*****@*****.**"); return(Json(new { data = "Success" }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { data = "fail" }, JsonRequestBehavior.AllowGet)); } return(Json(new { result = result, JsonRequestBehavior.AllowGet })); }
public async Task <ActionResult> SaveSalesPackageSubscriptionAsync(SalesPackageSubscription subs) { bool result = false; LeadDAL l = new LeadDAL(); CustomerDataStore c = new CustomerDataStore(); var lst = l.GetLeadByid(subs.LeadId); //string strPassword = "******"; string strPassword = "******"; string strEncrypted = (Helpers.Encrypt(strPassword)); string strDecrypted = (Helpers.Decrypt(strEncrypted)); try { subs.CreatedDate = DateTime.Now; CustWiseAccessDataStore DAL = new CustWiseAccessDataStore(); CustomerDataStore Check = new CustomerDataStore(); SubscriptionDAL Obj = new SubscriptionDAL(); if (ModelState.IsValid) { if (Check.CheckCustomerCount(lst.CorpEmail, strEncrypted) == 0) { SA_Customer Customer = new SA_Customer(); Customer.MenuId = subs.Id.ToString(); Customer.Email = lst.CorpEmail; Customer.Phone = lst.Phone; Customer.UserPassword = strEncrypted; Customer.Role = "Customer"; Customer.ProfileImage = ""; Customer.Fname = lst.Name; Customer.Lname = ""; c.AddCustomer(Customer); subs.UserId = Customer.id; result = await Obj.AddSalesPackageTrial(subs); DAL.AddCustWiseAccess(subs.MenuId, Customer.id); DAL.AddCustProduct(subs.ProductId, Customer.id, subs.MenuId); string EmailBody = SubscriptionDAL.GetHtml("PackageWelcome.html"); //EmailBody = EmailBody.Replace("@Name@", Customer.Fname + " " + Customer.Lname); EmailBody = EmailBody.Replace("@Pass@", "1234"); EmailBody = EmailBody.Replace("@Email@", Customer.Email); //EmailBody = EmailBody.Replace("@SiteRoot@", CommonUtility.SitePath); //EmailBody = EmailBody.Replace("@URL@", CommonUtility.SitePath); SubscriptionDAL.SendMail("Chem Analyst", "info@chemanalyst", Customer.Email, "Package Activation", EmailBody, "*****@*****.**"); UpdateLeadStatus(subs.LeadId); } else { var custId = c.GetCustomerList().Where(w => w.Email == lst.CorpEmail).FirstOrDefault().id; subs.UserId = custId; result = await Obj.AddSalesPackageTrial(subs); DAL.AddCustWiseAccess(subs.MenuId, custId); DAL.AddCustProduct(subs.ProductId, custId, subs.MenuId); return(Json(new { result = "One more package added successfully.", JsonRequestBehavior.AllowGet })); } } } catch (Exception ex) { } return(Json(new { result = "Data Added Successfully", JsonRequestBehavior.AllowGet })); }