public ActionResult Edit(Int32 Jobtypeid) { using (jobtypeCtl db = new jobtypeCtl()){ jobtypeClass obj_jobtype = db.selectById(Jobtypeid); Session["EditPreviousURL"] = Convert.ToString(ControllerContext.HttpContext.Request.UrlReferrer); return(View(obj_jobtype)); } }
public ActionResult SaveRecords(FormCollection model) { if (ModelState.IsValid) { using (jobtypeCtl db = new jobtypeCtl()){ var JobtypeidArray = model.GetValues("item.Jobtypeid"); var JobtypeArray = model.GetValues("item.Jobtype"); for (Int32 i = 0; i < JobtypeidArray.Length; i++) { jobtypeClass obj_update = db.selectById(Convert.ToInt32(JobtypeidArray[i])); if (!string.IsNullOrEmpty(Convert.ToString(JobtypeidArray))) { obj_update.Jobtypeid = Convert.ToInt32(JobtypeidArray[i]); } if (!string.IsNullOrEmpty(Convert.ToString(JobtypeArray))) { obj_update.Jobtype = Convert.ToString(JobtypeArray[i]); } db.update(obj_update); } } } return(RedirectToAction("EditTable")); }
public ActionResult Details(Int32 Jobtypeid) { using (jobtypeCtl db = new jobtypeCtl()){ jobtypeClass obj_jobtype = db.selectById(Jobtypeid); return(View(obj_jobtype)); } }