//private jobtypeCtl db = new jobtypeCtl(); //{privateVariables} public ActionResult Create() { using (jobtypeCtl db = new jobtypeCtl()){ Session["CreatePreviousURL"] = Convert.ToString(ControllerContext.HttpContext.Request.UrlReferrer); return(View()); } }
public ActionResult Create(jobtypeClass Obj_jobtype, string command) { using (jobtypeCtl db = new jobtypeCtl()){ if (ModelState.IsValid) { db.insert(Obj_jobtype); if (command.ToLower().Trim() == "save") { string sesionval = Convert.ToString(Session["CreatePreviousURL"]); if (!string.IsNullOrEmpty(sesionval)) { Session.Remove("CreatePreviousURL"); return(Redirect(sesionval)); } else { return(RedirectToAction("Index")); } } else { ModelState.Clear(); return(View()); } } return(View(Obj_jobtype)); } }
public ActionResult EditTableRowDelete(Int32 Jobtypeid) { using (jobtypeCtl db = new jobtypeCtl()){ db.delete(Jobtypeid); return(RedirectToAction("EditTable")); } }
public ActionResult Delete(Int32 Jobtypeid) { using (jobtypeCtl db = new jobtypeCtl()){ db.delete(Jobtypeid); return(RedirectToAction("Index")); } }
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 EditTableRowsDelete(string records) { using (jobtypeCtl db = new jobtypeCtl()){ foreach (string id in records.Trim(',').Split(',')) { if (!string.IsNullOrEmpty(id.Trim())) { db.delete(Convert.ToInt32(id)); } } return(View()); } }
public ActionResult Edit(jobtypeClass Obj_jobtype) { using (jobtypeCtl db = new jobtypeCtl()){ if (ModelState.IsValid) { db.update(Obj_jobtype); string sesionval = Convert.ToString(Session["EditPreviousURL"]); if (!string.IsNullOrEmpty(sesionval)) { Session.Remove("EditPreviousURL"); return(Redirect(sesionval)); } else { return(RedirectToAction("Index")); } } 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)); } }
public ActionResult EditTableLazyLoading(Int64 StartIndex, Int64 EndIndex, string Search) { using (jobtypeCtl db = new jobtypeCtl()){ return(PartialView(db.selectIndexLazyLoading(StartIndex, EndIndex, Search))); } }
public Int32 EditTablePagingCount(Int64 PageSize, Int64 PageIndex, string Search) { using (jobtypeCtl db = new jobtypeCtl()){ return(db.selectIndexPagingCount(PageSize, PageIndex, Search)); } }
public ActionResult EditTablePaging(Int64 PageSize, Int64 PageIndex, string Search) { using (jobtypeCtl db = new jobtypeCtl()){ return(PartialView(db.selectIndexPaging(PageSize, PageIndex, Search))); } }