public ActionResult ApproveBooking(int id)
        {
            //var addressLo = "";

            Booking book = context.Bookings.Find(id);

            book.Status = "Approved";

            //Get Location Type FOR Client to
            //Add Address Of the Booking Job


            //Send Email To Artist
            string subject = book.ArtistID + " Booking Status Update.";
            string body    = "<b>Dear " + book.UserID + "<br /><br />Booking For Artist : " + book.ArtistID + "<br /><br /><b>Has Been " + book.Status + ", And Has Been Notified. <b /><br /><br /><hr /><b style='color: red'>Please Do not reply</b>.<br /> Thanks & Regards, <br /><b>Studio Foto45!</b>";

            //
            EmailNotif emailNotif = new EmailNotif();

            emailNotif.sendNotif(book.UserID, subject, body);

            context.Entry(book).State = EntityState.Modified;
            context.SaveChangesAsync();

            return(RedirectToAction("Index", "Bookings", new { id = book.BookingID }));
        }
        //
        public ActionResult DeleteNotif(int id)
        {
            EmailNotif ord = db.EmailNotifs.Find(id);

            db.EmailNotifs.Remove(ord);
            db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public ActionResult PayBooking(int id)
        {
            var fffff = db.Bookings.Find(id);

            //
            string     subject    = fffff.ArtistID + " Booking.";
            string     body       = "<b>Dear " + fffff.UserID + "<br /><br />Your Booking Has Been Paid<u>Processing</u>. <b /><br />Total Payment Price : R " + fffff.TotalDue + ".<br /><hr /><b style='color: red'>Please Do not reply</b>.<br /> Thanks & Regards, <br /><b>Studio Foto45!</b>";
            EmailNotif emailNotif = new EmailNotif();

            emailNotif.sendNotif(fffff.UserID, subject, body);

            return(RedirectToAction("Payfast", new { Bookingname = "Final Booking Payment", paymnetamount = (fffff.TotalDue - 100) }));
        }
Exemplo n.º 4
0
        public ActionResult DeleteOrder(int id)
        {
            Order ord = context.Orders.Find(id);

            ord.Status = "Cancelled";

            string subject = ord.OrderName + " Order Status Update.";
            string body    = "<b>Dear " + ord.CustomerName + "<br /><br />Order : " + ord.OrderName + " <b />Your Order Has Been Cancelled. <br /><br /><hr /><b style='color: red'>Please Do not reply</b>.<br /> Thanks & Regards, <br /><b>Studio Foto45!</b>";

            EmailNotif emailNotif = new EmailNotif();

            emailNotif.sendNotif(ord.CustomerEmail, subject, body);

            context.Entry(ord).State = EntityState.Modified;
            context.SaveChangesAsync();

            return(RedirectToAction("customerOrders", new { id = ord.OrderId }));
        }
Exemplo n.º 5
0
        public ActionResult ApproveOrder(int id)
        {
            Order ord = db.Orders.Find(id);

            ord.Status = "Approved";

            string subject = ord.OrderName + " Order Status Update.";
            string body    = "<b>Dear " + ord.CustomerName + "<br /><br />Order : " + ord.OrderName + "<br /><br /><b>Your Order Has Been Approved And Has Sent To Shipping. <b /><br /><br /><hr /><b style='color: red'>Please Do not reply</b>.<br /> Thanks & Regards, <br /><b>Studio Foto45!</b>";

            //
            EmailNotif emailNotif = new EmailNotif();

            emailNotif.sendNotif(ord.CustomerEmail, subject, body);

            db.Entry(ord).State = EntityState.Modified;
            db.SaveChangesAsync();

            return(RedirectToAction("Index", new { id = ord.OrderId }));
        }
        public ActionResult MakeBooking(Booking booking)
        {
            //ViewBag.User = User.Identity.GetUserName().ToString();
            bool time = false;

            ViewBag.time = "";

            if (booking.Date < DateTime.Now)
            {
                time         = true;
                ViewBag.time = "Please select a date that is still to come.";
            }

            if (ModelState.IsValid && time != true)
            {
                booking.LocationVenueFee = booking.calcLocationFee();
                booking.PackageCost      = booking.calcPackageCost();
                booking.EventFee         = booking.calcEventFee();
                booking.Status           = "Processing";
                booking.ArtistRateFee    = booking.calcArtistFee();
                booking.TotalDue         = booking.calcTotalDue();
                booking.Discount         = booking.calcDiscount();

                db.Bookings.Add(booking);
                db.SaveChanges();

                //Send Notification
                //Change To Notify SuperAdmin
                string     subject    = booking.ArtistID + " Booking.";
                string     body       = "<b>Dear " + booking.UserID + "<br /><br />Your Booking Has Been Booked And Has Sent To <u>Processing</u>. <b /><br />Total Price : R " + booking.TotalDue + "<br /><hr /><b style='color: red'>Please Do not reply</b>.<br /> Thanks & Regards, <br /><b>Studio Foto45!</b>";
                EmailNotif emailNotif = new EmailNotif();
                emailNotif.sendNotif(booking.UserID, subject, body);

                return(RedirectToAction("Payfast", new { Bookingname = "Artist Booking", paymnetamount = booking.BookingFee }));
            }

            ViewBag.ArtistID   = new SelectList(db.Users.Where(a => a.Name == "Artist"), "UserName", "UserName");
            ViewBag.LocationId = new SelectList(db.Locations, "LocationId", "LocationType", booking.LocationId);
            ViewBag.PackageId  = new SelectList(db.Packages, "PackageId", "PackageType", booking.PackageId);
            ViewBag.ServiceId  = new SelectList(db.Services, "ServiceId", "ServiceType", booking.ServiceId);
            return(View(booking));
        }
        public ActionResult CancelBooking(int id)
        {
            Booking ord = db.Bookings.Find(id);

            ord.Status = "Cancelled";

            //string subject = ord.OrderName + " Status Update.";
            //string body = "<b>Dear " + ord.CustomerName + "<br /><br />Order : " + ord.OrderName + " Your Order Has Been Cancelled. <b /><br /><br /><hr /><b style='color: red'>Please Do not reply</b>.<br /> Thanks & Regards, <br /><b>Studio Foto45!</b>";
            //ord.SendMail(subject, body);

            db.Entry(ord).State = EntityState.Modified;
            db.SaveChangesAsync();

            //Send Notification
            //Change To Notify SuperAdmin
            string     subject    = ord.ArtistID + " Booking.";
            string     body       = "<b>Dear " + ord.UserID + "<br /><br />Your Booking Has Been <u>" + ord.Status + "</u>. <b /><br /><hr /><b style='color: red'>Please Do not reply</b>.<br /> Thanks & Regards, <br /><b>Studio Foto45!</b>";
            EmailNotif emailNotif = new EmailNotif();

            emailNotif.sendNotif(ord.UserID, subject, body);

            return(RedirectToAction("customerBookings", new { id = ord.BookingID }));
        }
Exemplo n.º 8
0
        public ActionResult ProcessOrder(FormCollection frc)
        {
            //Create a order model & Order Details Model
            List <Item> lstcart = (List <Item>)Session["cart"];

            //
            Order order = new Order()
            {
                PaymentAmount   = System.Convert.ToDouble(frc["TotalAmount"]),
                CustomerName    = frc["custName"],
                CustomerPhone   = frc["custPhone"],
                CustomerEmail   = frc["custEmail"],
                CustomerAddress = frc["Street"] + "," + frc["City"] + "," + frc["Country"] + "," + frc["ZipCode"],
                OrderDate       = DateTime.Now,
                PaymentType     = "Cash",
                Status          = "Processing",
                //LastName = frc["LastName"],

                OrderName = frc["custName"] + "-" + DateTime.Now + "-" + System.Convert.ToDouble(frc["TotalAmount"])
            };

            //Email
            string subject = "Studio Foto45 Purchase Order Details";
            string body    = "Dear " + order.CustomerName + ", <br /><br />Order : <b style='color: green'>" + order.OrderName + "</b> Was Successfull! <br />Delivery to -<b>" + order.CustomerAddress + "</b>-</b><br /> Your Order Will be delivered in 6-7 Working day. Please Login to <b>Studio Foto45!</b> for your Orders.<hr /><b style='color: red'>Please Do not reply</b>.<br /> Thanks & Regards, <br /><b>Studio Foto45!</b>";


            //order.SendMail(subject,body);

            //Db Saving
            context.Orders.Add(order);
            context.SaveChanges();

            ///
            foreach (Item cart1 in lstcart)
            {
                OrderDetails item1 = new OrderDetails()
                {
                    OrderId     = order.OrderId,
                    ProdId      = cart1.Pr.ProductID,
                    Quantity    = cart1.Quantity,
                    Price       = cart1.Pr.Price,
                    ProdName    = cart1.Pr.ProductName,
                    DateOrdered = DateTime.Now
                };

                context.OrderDetails.Add(item1);


                //Write Statement to Update product quantity on purchase
                Product prd = context.Products.Find(cart1.Pr.ProductID);
                prd.InStoreQuantity     -= cart1.Quantity;
                context.Entry(prd).State = EntityState.Modified;


                context.SaveChanges();
            }

            EmailNotif emailNotif = new EmailNotif();

            emailNotif.sendNotif(order.CustomerEmail, subject, body);

            Session.Remove("cart");
            Session.Remove("count");
            return(RedirectToAction("Payfast", new { ordname = order.OrderName, paymnetamount = order.PaymentAmount }));
            //Create a Add Statement for the modes
        }