public ActionResult Create([Bind(Include = "Event_ID,Event_Name,Start_Date,End_Date,No_Of_Participants,Pay_Event_BookingID,Venue_ID,servicetypeid,PaymentID,EventTypeID,Service_Company_ID,Descriptions,EventType,Venue,FoodCompany,ElectricalCompany")] EventBooking eventBooking)
        {
            if (ModelState.IsValid)
            {
                db.EventBookings.Add(eventBooking);
                db.SaveChanges();
                return(RedirectToAction("Summary"));
            }

            Session["Event_Name"]         = eventBooking.Event_Name;
            Session["Start_Date"]         = eventBooking.Start_Date;
            Session["End_Date"]           = eventBooking.End_Date;
            Session["No_Of_Participants"] = eventBooking.No_Of_Participants;
            Session["EventTypeID"]        = eventBooking.EventTypeID;
            Session["Venue_ID"]           = eventBooking.Venue_ID;
            Session["FoodCompany"]        = eventBooking.FoodCompany;
            Session["ElectricalCompany"]  = eventBooking.ElectricalCompany;


            ViewBag.Pay_Event_BookingID = new SelectList(db.payment_Booking, "Pay_Event_BookingID", "Payment_Type", eventBooking.Pay_Event_BookingID);
            ViewBag.EventTypeID         = new SelectList(db.EventTypes, "EventTypeID", "EventType1", eventBooking.EventTypeID);
            ViewBag.PaymentID           = new SelectList(db.Payments, "PaymentID", "Payment_Status", eventBooking.PaymentID);
            ViewBag.Service_Company_ID  = new SelectList(db.service_company, "Service_Company_ID", "Service_Company1", eventBooking.Service_Company_ID);
            ViewBag.servicetypeid       = new SelectList(db.serviceTypes, "ServiceTypeID", "ServiceType1", eventBooking.servicetypeid);
            ViewBag.Venue_ID            = new SelectList(db.Venues, "Venue_ID", "Venue_Name", eventBooking.Venue_ID);
            return(View(eventBooking));
        }
示例#2
0
 public ActionResult Participants(Participant obj)
 {
     if (ModelState.IsValid)
     {
         db.Participants.Add(obj);
         db.SaveChanges();
     }
     return(View());
 }
示例#3
0
 public ActionResult Participants(Participant obj)
 {
     if (ModelState.IsValid)
     {
         db.Participants.Add(obj);
         db.SaveChanges();
         return(RedirectToAction("Index", "Homepage"));
     }
     return(View(obj));
 }
示例#4
0
        public ActionResult Create([Bind(Include = "Ques1,UserId")] AdminFeedbackForm adminFeedbackForm)
        {
            if (ModelState.IsValid)
            {
                db.AdminFeedbackForms.Add(adminFeedbackForm);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(adminFeedbackForm));
        }
示例#5
0
        public ActionResult Create([Bind(Include = "Company_Name,Description,Type,Contact_Email,Address,Phone_no,Certification,serviceID")] Service service)
        {
            if (ModelState.IsValid)
            {
                db.Services.Add(service);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(service));
        }
示例#6
0
        public ActionResult Create([Bind(Include = "UserId,Ques1,Rating,Description")] FeedBackForm feedBackForm)
        {
            if (ModelState.IsValid)
            {
                db.FeedBackForms.Add(feedBackForm);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Ques1 = new SelectList(db.AdminFeedbackForms, "Ques1", "Ques1", feedBackForm.Ques1);
            return(View(feedBackForm));
        }
 public ActionResult Create([Bind(Include = "Registration_ID,FirstName,LastName,DoB,Gender,ContactNumber,UserId,Password")] Registration registration)
 {
     if (ModelState.IsValid)
     {
         registration.Password = Security.HashSHA1(registration.Password);
         db.Registrations.Add(registration);
         db.SaveChanges();
         ViewBag.Message = "Registration done successfully";
         return(RedirectToAction("Create", "Registration "));
     }
     return(View(registration));
 }
示例#8
0
        public ActionResult Create([Bind(Include = "UserId,ContactName,ContactNumber")] ContactList2 contactList2)
        {
            if (ModelState.IsValid)
            {
                db.ContactList2.Add(contactList2);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ContactName = new SelectList(db.invitation2, "ContactName", "ContactNumber", contactList2.ContactName);
            return(View(contactList2));
        }
示例#9
0
        public ActionResult Save(int?id, FormCollection actionValues)
        {
            var action = new DataAction(actionValues);

            try
            {
                var changedEvent = DHXEventsHelper.Bind <EventBooking>(actionValues);
                switch (action.Type)
                {
                case DataActionTypes.Insert:

                    db.EventBookings.Add(changedEvent);
                    break;

                case DataActionTypes.Delete:
                    db.Entry(changedEvent).State = EntityState.Deleted;
                    break;

                default:    // "update"
                    db.Entry(changedEvent).State = EntityState.Modified;
                    break;
                }


                db.SaveChanges();
                action.TargetId = changedEvent.Event_ID;
            }
            catch (Exception a)
            {
                action.Type = DataActionTypes.Error;
            }

            return(new AjaxSaveResponse(action));
        }
        public ActionResult Create([Bind(Include = "ContactNumber,ContactName,Venue_Name")] invitation2 invitation2)
        {
            if (ModelState.IsValid)
            {
                db.invitation2.Add(invitation2);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ContactName = new SelectList(db.ContactList2, "ContactName", "ContactName", invitation2.ContactName);
            return(View(invitation2));
        }
示例#11
0
        public ActionResult Addimage(Image img, HttpPostedFileBase image)
        {
            if (ModelState.IsValid)
            {
                string filename  = Path.GetFileNameWithoutExtension(image.FileName);
                string extension = Path.GetExtension(image.FileName);
                filename     = filename + extension;
                img.location = "~/Models/img/" + filename;
                filename     = Path.Combine(Server.MapPath("~/Models/img/"), filename);
                image.SaveAs(filename);
                db.Images.Add(img);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(image));
        }