public bool Edit(T entity) { context.Entry(entity).State = EntityState.Modified; int i = context.SaveChanges(); return(i > 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)); }
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)); }
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)); }
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)); }
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)); }
public bool UpdateAccomodationType(AccomodationType accomodationType) { context.Entry(accomodationType).State = System.Data.Entity.EntityState.Modified; return(context.SaveChanges() > 0); }