Exemplo n.º 1
0
        //[ChildActionOnly]
        public ActionResult ProceedToCheckOut()
        {
            var cartid = sc.GetCartId(this.HttpContext);
            //Check If already logged in
            string UserName = sc.GetLoginDetail(cartid);

            if (UserName == "Guest" || UserName == "")
            {
                return(View("CheckOutLogin"));
            }
            //Logged in process order
            else
            {
                //var cart = QuickySaleOnlineShopper.Models.ShoppingCart.GetCart(this.HttpContext);
                //Put a protection block incase the back button is pressed on the site
                decimal id = 0;
                if (cartid == null || cartid == "" || UserName == "" || UserName == null)
                {
                    return(View("Error"));
                }
                else
                {
                    //Send Email on order
                    id = sc.CreateOrder(cartid, UserName);
                    BusinessLayer.SendEmails em = new BusinessLayer.SendEmails();
                    em.ProcessEmail(cartid);

                    return(RedirectToAction("Complete", "CheckOut", new { id = id }));
                }
            }


            // return View();
        }
Exemplo n.º 2
0
        public ActionResult SendPasswordToCustomer(string submit)
        {
//check if this email is in the db and retrieve its password
            string fdgrp = dbset.GetPasswordForThisEmail(submit.Trim());

            if (fdgrp == "" || fdgrp == null)
            {
                View("EmailError");
            }
            else
            {
                //Send Email
                BusinessLayer.SendEmails em = new BusinessLayer.SendEmails();
                em.ForgotPassowrdEmail(submit.Trim(), fdgrp);
                return(View());
            }
            return(View("EmailError"));
        }
Exemplo n.º 3
0
        public ActionResult CheckOutLogIn(FormCollection frmCollection)
        {
            //Double chk to ensure this profile is in the userprofile table incase back button was used
            var cartid = sc.GetCartId(this.HttpContext);

            if (!sc.ConfirmMemberisLoggedIn(cartid))
            {
                sc.AddGuestBrowserTotblUserProfile(cartid);
            }

            //Check if person exists
            //var ChkCusomer = storeDB.CustomerDetails.Single(x => x.Username == frmCollection["UserName"].ToString());
            string dbUserName = frmCollection["UserName"].ToString().Trim();
            string dbPwd      = frmCollection["Password"].ToString().Trim();

            if (sc.CheckMembership(dbUserName, dbPwd))
            {
                //Update tblUserProfile with correct UserName
                sc.UpdatetblUserProfileWithCurrentUserName(dbUserName, cartid);

                //Put a protection block incase the back button is pressed on the site
                decimal id = 0;
                if (cartid == null || cartid == "" || dbUserName == "" || dbUserName == null)
                {
                    return(View("Error"));
                }
                else
                {
                    id = sc.CreateOrder(cartid, dbUserName);
                    BusinessLayer.SendEmails em = new BusinessLayer.SendEmails();
                    em.ProcessEmail(cartid);

                    return(RedirectToAction("Complete", "CheckOut", new { id = id }));
                }
                //Send Email on order
            }
            else
            {
                return(View("ErrorIndex"));
            }
        }
        public ActionResult Create(BusinessLayer.ContactUs frmCollection)
        {
            if (ModelState.IsValid)
            {
                // try
                //{
                // TODO: Add insert logic here
                dbset.AddEnquiryToDB(frmCollection);

                //Send information to Administrator email
                BusinessLayer.SendEmails em = new BusinessLayer.SendEmails();
                em.SendEnquiryToEmail(frmCollection);
                return(RedirectToAction("Index"));
                //}
                //catch
                //{
                // return View();
                //}
            }
            return(View());
        }