public JsonResult ConfigAddSave(T_PersonnelTransferConfig model) { try { db.T_PersonnelTransferConfig.Add(model); db.SaveChanges(); return(Json(new { State = "Success" }, JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(Json(new { State = "Faile", Message = e.Message }, JsonRequestBehavior.AllowGet)); } }
public JsonResult ConfigDelete(int ID) { try { T_PersonnelTransferConfig delModel = db.T_PersonnelTransferConfig.Find(ID); db.T_PersonnelTransferConfig.Remove(delModel); db.SaveChanges(); return(Json(new { State = "Success" }, JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(Json(new { State = "Faile", Message = e.Message }, JsonRequestBehavior.AllowGet)); } }
public ActionResult ViewConfigEdit(int ID) { T_PersonnelTransferConfig model = db.T_PersonnelTransferConfig.Find(ID); ViewData["boolList"] = Com.BoolList; ViewData["TypeList"] = TypeList(); if (model != null) { return(View(model)); } else { return(HttpNotFound()); } }
public JsonResult ConfigEditSave(T_PersonnelTransferConfig model) { try { T_PersonnelTransferConfig editModel = db.T_PersonnelTransferConfig.Find(model.ID); editModel.Name = model.Name; editModel.Step = model.Step; editModel.Type = model.Type; editModel.isMultiple = model.isMultiple; db.Entry <T_PersonnelTransferConfig>(editModel).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(Json(new { State = "Success" }, JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(Json(new { State = "Faile", Message = e.Message }, JsonRequestBehavior.AllowGet)); } }