Exemple #1
0
        public ActionResult Index(string AddressLine1Prop, string AddressLine2Prop, string CityProp,
                                  string StateProvinceRegionProp,
                                  string ZipPostalCodeProp, string AmountProp, string FirstName, string LastName
                                  )
        {
            PageDetails details = new PageDetails();

            details.stage2 = "true";


            DBAccess dbAccess  = new DBAccess();
            int      reference = dbAccess.RecordForm(AddressLine1Prop, AddressLine2Prop, CityProp, StateProvinceRegionProp, ZipPostalCodeProp,
                                                     AmountProp, FirstName, LastName, details.stage2);



            ViewBag.URL = "https://myhackney.hackney.gov.uk/propertysales/LoadForm/Index/" + reference;

            //SendEmail sendEmail = new SendEmail();
            //sendEmail.sendEmail(reference, ViewBag.URL);

            EmailUtils.SendEmail("Property Sales Reservation Form :" + reference, "This is an automated email " +
                                 "for the Property Sales Reservation form created for property " +
                                 AddressLine1Prop + "," + AddressLine2Prop + "," + CityProp + ","
                                 + StateProvinceRegionProp + "," + ZipPostalCodeProp + ". Please forward " +
                                 "The following link to the customer to confirm form details and make the payment..."
                                 + ViewBag.URL);



            return(View(details));
        }
        public static void SendEmail(string strSubject, string strBody)
        {
            string strTo   = AppOptions.GetOption("ToEmail");
            string strFrom = AppOptions.GetOption("FromEmail");
            string strCC   = AppOptions.GetOption("CCEmail");

            EmailUtils objEmail = new EmailUtils();

            objEmail.SendEmail(strTo, strFrom, strCC, strSubject, strBody, "");
        }
        public ActionResult ReturnPage()
        {
            string reference        = Request.QueryString["Ref"];
            string ServiceProcessed = Request.QueryString["serviceprocessed"];
            string receipt          = Request.QueryString["receiptnumber"];


            DBAccess dbAccess = new DBAccess();
            List <Models.FormData> formDetails = dbAccess.getForm(Convert.ToInt32(reference));

            ViewBag.addressLine1 = formDetails[0].addressLine1;
            ViewBag.addressLine2 = formDetails[0].addressLine2;
            ViewBag.city         = formDetails[0].city;
            ViewBag.state        = formDetails[0].state;
            ViewBag.zip          = formDetails[0].zip;
            ViewBag.firstName    = formDetails[0].firstName;
            ViewBag.lastNane     = formDetails[0].lastName;
            ViewBag.amount       = formDetails[0].amount;


            if (ServiceProcessed == "true")
            {
                EmailUtils.SendEmail("Hackney Sales Payment Receipt, Receipt number: "
                                     + receipt, "This is the payment receipt for the following property..."
                                     + System.Environment.NewLine + System.Environment.NewLine +
                                     System.Environment.NewLine +
                                     "Address Line 1:" + formDetails[0].addressLine1 + System.Environment.NewLine
                                     + "Address Line 2:" + formDetails[0].addressLine2 + System.Environment.NewLine
                                     + "City:" + formDetails[0].city + System.Environment.NewLine
                                     + "County:" + formDetails[0].state + System.Environment.NewLine
                                     + "Post code:" + formDetails[0].zip + System.Environment.NewLine
                                     + System.Environment.NewLine + System.Environment.NewLine
                                     + "Amount Paid:" + formDetails[0].amount
                                     + "Payment was sucessful");

                return(View("ReturnPage"));
            }
            else
            {
                EmailUtils.SendEmail("Hackney Sales Payment Receipt, Receipt number: "
                                     + receipt, "PAYMENT FAILED" + System.Environment.NewLine + "This is the payment receipt for the following property..."
                                     + System.Environment.NewLine + System.Environment.NewLine + System.Environment.NewLine +

                                     "Address Line 1:" + formDetails[0].addressLine1 + System.Environment.NewLine
                                     + "Address Line 2:" + formDetails[0].addressLine2 + System.Environment.NewLine
                                     + "City:" + formDetails[0].city + System.Environment.NewLine
                                     + "County:" + formDetails[0].state + System.Environment.NewLine
                                     + "Post code:" + formDetails[0].zip + System.Environment.NewLine
                                     + System.Environment.NewLine + System.Environment.NewLine

                                     + "----------PAYMENT FAILED----------"
                                     + System.Environment.NewLine + "Please contact the customer.");
                return(View("FailedPage"));
            }
        }