public ActionResult RequestQuote(QuoteModel model) { try { if (ModelState.IsValid) { HelpingMethods hm = new HelpingMethods(); //if (!hm.CheckReCaptcha(Request["g-recaptcha-response"])) //{ // ViewBag.resultmail = "Captcha is not valid. Please try again."; // return View(); //} StringBuilder sbEmailBodyl = new StringBuilder(); sbEmailBodyl.Append("<table border='1' style='width:100%;'>"); sbEmailBodyl.Append("<tr><th colspan='2'>Owner Details</th></tr>"); sbEmailBodyl.Append("<tr><td>Name </td><td>" + model.Name + "</td></tr>"); sbEmailBodyl.Append("<tr><td>Designation </td><td>" + model.Designation + "</td></tr>"); sbEmailBodyl.Append("<tr><td>Contact Number </td><td>" + model.Mobile + "</td></tr>"); sbEmailBodyl.Append("<tr><td>Email </td><td>" + model.Email + "</td></tr>"); sbEmailBodyl.Append("<tr><th colspan='2'>Business Details</th></tr>"); sbEmailBodyl.Append("<tr><td>BKO or Business Name </td><td>" + model.Org_Name + "</td></tr>"); sbEmailBodyl.Append("<tr><td>Brick Kiln or Business Type </td><td>" + model.busiess_type + "</td></tr>"); sbEmailBodyl.Append("<tr><td>Location </td><td>" + model.City_village + "</td></tr>"); sbEmailBodyl.Append("<tr><td>City or Village </td><td>" + model.District + "</td></tr>"); sbEmailBodyl.Append("<tr><td>State </td><td>" + model.State + "</td></tr>"); sbEmailBodyl.Append("<tr><td>Country</td><td>" + model.Country + "</td></tr>"); sbEmailBodyl.Append("<tr><td>See the Vedio Demo First</td><td>" + model.seen_video + "</td></tr>"); sbEmailBodyl.Append("<tr><td>Interested For</td><td>" + model.Interested_for + "</td></tr>"); sbEmailBodyl.Append("</table>"); //var result = hm.SendMail("*****@*****.**", "Request Quote", sbEmailBodyl.ToString(), "eBrickKiln- " + model.Interested_for + ", Request Quote by vistor"); var result = hm.SendMailSales("*****@*****.**", "eBrickKiln- " + model.Interested_for, sbEmailBodyl.ToString(), "eBrickKiln- Sales"); var resulttovisitor = hm.SendMailSales(model.Email, "eBrickKiln- Greetings", MailToClient(), "eBrickKiln- Sales"); var resultsms = hm.sendsmsany("Thanks from 'uSofts' to show your interest in our eBrickkiln product for your business. Detail sent on your mail Id Soon you will get call from sale executive.", model.Mobile); if (result) { //ViewBag.resultmail = "Your message sent."; return(View("ContactSuccess")); } } } catch { } return(View()); }
public ActionResult Return(FormCollection form) { try { string transaction_id = string.Empty; string order_id = string.Empty; string[] keys = Request.Form.AllKeys; Array.Sort(keys); string hash = gethash(keys, form); if (form["hash"] == hash) { if (form["response_code"] == "0") { transaction_id = Request.Form["transaction_id"]; order_id = Request.Form["order_id"]; ViewData["Message"] = "Transaction is successful. Your tranaction ID is: " + transaction_id + " and order id is: " + order_id + ". Please save it for future reference."; HelpingMethods hm = new HelpingMethods(); var resulttovisitor = hm.SendMailSales(Request.Form["email"], "eBrickKiln- Payment Successful", mailcontent(transaction_id, order_id), "eBrickKiln- Sales"); // Response.Write("<br/>Transaction is successful. Hash value is matched"); } else if (form["response_message"] == "Transaction Failed") { ViewData["Message"] = "Transaction is unsuccessful. Please try again."; } else { string response_message = Request.Form["response_message"]; int startIndex = response_message.IndexOf(" - ") + 2; int length = response_message.Length - startIndex; response_message = response_message.Substring(startIndex, length); //Response.Write("Correct the below error <br />"); //Response.Write(response_message); ViewData["Message"] = "To continue to transaction, please correct the error: " + response_message; } } else { ViewData["Message"] = "Transaction is unsuccessful. Please try again."; //Response.Write("<br/>Hash value Not matched"); } } catch (Exception ex) { Response.Write("<span style='color:red'>" + ex.Message + "</span>"); } return(View("../Onlinepay/Return")); }