Ejemplo n.º 1
0
 public ActionResult ThankYou()
 {
     if (UserDetail != null && Session["Enquery_ID"] != null)
     {
         var enquiryID = (int)Session["Enquery_ID"];
         var enquiryManager = new EnquiryManager();
         var userDetail = new DataModel.UserDetailManager().Get(UserDetail.UserId);
         using (var sw = new StringWriter())
         {
             ViewData.Model = userDetail;
             ViewEngineResult viewResult = ViewEngines.Engines.FindPartialView(ControllerContext, "Success");
             ViewContext viewContext = new ViewContext(ControllerContext, viewResult.View, ViewData, TempData, sw);
             viewResult.View.Render(viewContext, sw);
             try
             {
                 string subject = "Your Renewable Energy Search Request ID " + Session["Enquery_ID"] + " Created Successfully at RenewIn";
                 Utilities.Email.SendMail(UserDetail.Email, sw.GetStringBuilder().ToString(), subject);
             }
             catch
             {
             }
         }
     }
     return View();
 }
 public JsonResult AddEnquiry(string pincode, string address, string optionOne, string optionMulti, string name, string mobileNumber, string email, float Field1, float Field2, float Field3)
 {
     var userId = UserDetail == null ? 0 : UserDetail.UserId;
     var enquiryManager = new EnquiryManager();
     var status = enquiryManager.Add(pincode, address, optionOne, optionMulti, name, mobileNumber, email, Field1, Field2, Field3, userId);
     Session["Enquery_ID"] = status;
     return Json(status != 0);
 }
 public ActionResult ThankYou()
 {
     if (Session["Enquery_ID"] != null)
     {
         var enquiryID = (int)Session["Enquery_ID"];
         var enquiryManager = new EnquiryManager();
         var enquiryDetail = enquiryManager.GetEnquiryDetail(enquiryID);
         using (var sw = new StringWriter())
         {
             ViewData.Model = enquiryDetail;
             ViewEngineResult viewResult = ViewEngines.Engines.FindPartialView(ControllerContext, "Success");
             ViewContext viewContext = new ViewContext(ControllerContext, viewResult.View, ViewData, TempData, sw);
             viewResult.View.Render(viewContext, sw);
             try
             {
                 Utilities.Email.SendMail(enquiryDetail.Email, sw.GetStringBuilder().ToString(),"");
             }
             catch
             {
             }
         }
     }
     return View();
 }
 public ActionResult Index()
 {
     var enquiryManager = new EnquiryManager();
     var getEnquiries = enquiryManager.GetEnquiries();
     return View(getEnquiries);
 }
 public PartialViewResult Detail(int id)
 {
     var enquiryManager = new DataModel.EnquiryManager();
     var enquiryDetail = enquiryManager.GetEnquiryDetail(id);
     return PartialView(enquiryDetail);
 }