public ActionResult Create([Bind(Include = "UserName,Emailid,CustomerFeedback,Name")] Feedback feedback)
        {
            if (ModelState.IsValid)
            {
                db.Feedbacks.Add(feedback);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.UserName = new SelectList(db.UserDetails, "UserName", "Name", feedback.UserName);
            return(View(feedback));
        }
Esempio n. 2
0
        public ActionResult DeleteConfirmed(string id)
        {
            EventsAndDecoration eventsAndDecoration = db.EventsAndDecorations.Find(id);

            db.EventsAndDecorations.Remove(eventsAndDecoration);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 3
0
        public ActionResult Register(UserDetail userDetail)
        {
            db.UserDetails.Add(userDetail);
            db.SaveChanges();
            var user = db.UserDetails.Single(u => u.UserName == userDetail.UserName);

            if (user.Role == "EventManager")
            {
                EventManager eventManager = new EventManager(user.Name, user.Email, user.Password, user.UserName);
                db.EventManagers.Add(eventManager);
                db.SaveChanges();
            }
            if (user.Role == "Customer")
            {
                Customer customer = new Customer(user.Name, user.UserName, user.Email, user.Password);
                db.Customers.Add(customer);
                db.SaveChanges();
            }
            return(View());
        }
        public ActionResult PlaceOrder(Order orders)
        {
            using (var context = new ProjectEventManagementEntities1())
            {
                db.Orders.Add(orders);
                db.SaveChanges();
            }
            string message = "Order placed successfully";

            ViewBag.Message = message;
            return(View());
        }
Esempio n. 5
0
        public ActionResult AddEVentsandDecoration(EventsAndDecoration image)
        {
            string fileName  = Path.GetFileNameWithoutExtension(image.ImageFile.FileName);
            string extension = Path.GetExtension(image.ImageFile.FileName);

            fileName = fileName + DateTime.Now.ToString("yymmssfff") + extension;
            // image.Id = 90;
            image.DecorationImage = "~/Image/" + fileName;

            fileName = Path.Combine(Server.MapPath("~/Image/"), fileName);
            image.ImageFile.SaveAs(fileName);

            using (ProjectEventManagementEntities1 db = new ProjectEventManagementEntities1())
            {
                db.EventsAndDecorations.Add(image);
                db.SaveChanges();
            }
            ModelState.Clear();
            string message = "Events dded Successfully";

            ViewBag.Mesage = message;
            return(View());
        }