public bool Edit(T entity)
        {
            context.Entry(entity).State = EntityState.Modified;
            int i = context.SaveChanges();

            return(i > 0);
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "CourseID,VetNationalCode,CourseName,CourseComment")] Course course)
 {
     if (ModelState.IsValid)
     {
         db.Entry(course).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(course));
 }
Example #3
0
 public ActionResult Edit([Bind(Include = "AgentRepresentativeID,FirstMidName,LastName,ContactNumber,EmailAddress")] AgentRepresentative agentRepresentative)
 {
     if (ModelState.IsValid)
     {
         db.Entry(agentRepresentative).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(agentRepresentative));
 }
Example #4
0
 public ActionResult Edit([Bind(Include = "PricingID,CourseID,CourseType,TuitionFee,MaterialFee,ApplicationFee,PricingComment")] Pricing pricing)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pricing).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CourseID = new SelectList(db.Courses, "CourseID", "VetNationalCode", pricing.CourseID);
     return(View(pricing));
 }
Example #5
0
        public ActionResult Edit([Bind(Include = "StaffID,FirstMidName,LastName")] Staff staff)
        {
            if (ModelState.IsValid)
            {
                db.Entry(staff).State = EntityState.Modified;
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            return(View(staff));
        }
Example #6
0
        public ActionResult Edit([Bind(Include = "AgentID,LegalName,TradingName,EmailAddress,ContactNumber," +
                                                 "ContactPerson,AgentApplicationForm,CompanyRegistration,Agreement,AgreementSignedDate,CompanyProfile," +
                                                 "ReportedToAsqa,AgentRepresentativeID,StaffID")] Agent agent)
        {
            if (ModelState.IsValid)
            {
                db.Entry(agent).State = EntityState.Modified;
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }

            return(View(agent));
        }
Example #7
0
 public bool UpdateAccomodationType(AccomodationType accomodationType)
 {
     context.Entry(accomodationType).State = System.Data.Entity.EntityState.Modified;
     return(context.SaveChanges() > 0);
 }