public ActionResult Edit(int id, FormCollection collection) { // TODO: Add update logic here var v = repo.Get(id); UpdateModel(v); repo.Update(v); return(RedirectToAction("Index")); }
public ActionResult Edit(Contractor Contractor) { if (ModelState.IsValid) { Contractor.COMPANYSITE = int.Parse(Session["companysite"].ToString()); Contractor.ISACTIVEDATE = DateTime.Now; Contractor.UPDATEDATE = DateTime.Now; CTR.Update(Contractor, Session["userid"].ToString()); TempData["successmessage"] = "Saved successfully"; return RedirectToAction("Index"); } else { Contractor.GetSelectListContractorGroup = GetSelectListContractorGroup(); Contractor.GetSelectListControlJob = GetSelectListControlJob(); Contractor.GetSelectListBank = GetSelectListBank(); Contractor.GetSelectListCountry = GetSelectListCountry(); Contractor.GetSelectListProvince = GetSelectListProvince(); Contractor.GetSelectListCity = GetSelectListCity(); return View(Contractor); } }