Esempio n. 1
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));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "Ques1,UserId")] AdminFeedbackForm adminFeedbackForm)
 {
     if (ModelState.IsValid)
     {
         db.Entry(adminFeedbackForm).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(adminFeedbackForm));
 }
 public ActionResult Edit([Bind(Include = "Registration_ID,FirstName,LastName,DoB,Gender,ContactNumber,UserId,Password,question1,question2,question3")] Registration registration)
 {
     if (ModelState.IsValid)
     {
         db.Entry(registration).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(registration));
 }
Esempio n. 4
0
 public ActionResult Edit([Bind(Include = "Company_Name,Description,Type,Contact_Email,Address,Phone_no,Certification,serviceID")] Service service)
 {
     if (ModelState.IsValid)
     {
         db.Entry(service).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(service));
 }
Esempio n. 5
0
 public ActionResult Edit([Bind(Include = "UserId,ContactName,ContactNumber")] ContactList2 contactList2)
 {
     if (ModelState.IsValid)
     {
         db.Entry(contactList2).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ContactName = new SelectList(db.invitation2, "ContactName", "ContactNumber", contactList2.ContactName);
     return(View(contactList2));
 }
 public ActionResult Edit([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.Entry(eventBooking).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     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));
 }
Esempio n. 7
0
 public virtual void Update(TEntity entityToUpdate)
 {
     _dbset.Attach(entityToUpdate);
     _mainContext.Entry(entityToUpdate).State = EntityState.Modified;
 }