public ActionResult Edit(Int32 Buildingsystemid) { using (buildingsystemCtl db = new buildingsystemCtl()){ buildingsystemClass obj_buildingsystem = db.selectById(Buildingsystemid); Session["EditPreviousURL"] = Convert.ToString(ControllerContext.HttpContext.Request.UrlReferrer); return(View(obj_buildingsystem)); } }
public ActionResult SaveRecords(FormCollection model) { if (ModelState.IsValid) { using (buildingsystemCtl db = new buildingsystemCtl()){ var BuildingsystemidArray = model.GetValues("item.Buildingsystemid"); var BuildingsystemnameArray = model.GetValues("item.Buildingsystemname"); for (Int32 i = 0; i < BuildingsystemidArray.Length; i++) { buildingsystemClass obj_update = db.selectById(Convert.ToInt32(BuildingsystemidArray[i])); if (!string.IsNullOrEmpty(Convert.ToString(BuildingsystemidArray))) { obj_update.Buildingsystemid = Convert.ToInt32(BuildingsystemidArray[i]); } if (!string.IsNullOrEmpty(Convert.ToString(BuildingsystemnameArray))) { obj_update.Buildingsystemname = Convert.ToString(BuildingsystemnameArray[i]); } db.update(obj_update); } } } return(RedirectToAction("EditTable")); }
public ActionResult Details(Int32 Buildingsystemid) { using (buildingsystemCtl db = new buildingsystemCtl()){ buildingsystemClass obj_buildingsystem = db.selectById(Buildingsystemid); return(View(obj_buildingsystem)); } }