public JsonResult ConfigAddSave(T_DepartmentActivityConfig model)
 {
     try
     {
         db.T_DepartmentActivityConfig.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_DepartmentActivityConfig delModel = db.T_DepartmentActivityConfig.Find(ID);
         db.T_DepartmentActivityConfig.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_DepartmentActivityConfig model = db.T_DepartmentActivityConfig.Find(ID);

            ViewData["boolList"] = Com.BoolList;
            ViewData["ListUser"] = Com.UserList();
            if (model != null)
            {
                return(View(model));
            }
            else
            {
                return(HttpNotFound());
            }
        }
 public JsonResult ConfigEditSave(T_DepartmentActivityConfig model)
 {
     try
     {
         T_DepartmentActivityConfig editModel = db.T_DepartmentActivityConfig.Find(model.ID);
         editModel.Name       = model.Name;
         editModel.Step       = model.Step;
         editModel.Type       = model.Type;
         editModel.isMultiple = model.isMultiple;
         db.Entry <T_DepartmentActivityConfig>(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));
     }
 }