コード例 #1
0
        public ActionResult DetailGridBatchUpdate(MVCxGridViewBatchUpdateValues <SystemUser, int> updateValues, List <int> permissions, UserGroupModel master)
        {
            //TODO
            //master 要轉成 Entity(UserGroup)

            var deleteKeys = updateValues.DeleteKeys;
            var insertList = updateValues.Insert;
            // SaveChanges(ref Models.UserGroup entity, List<int> permissions, List<int> insertUser, List<int> deleteUser, EntityState state)

            var data = _Service.GetByKey(master.ID);

            UserGroupBusiness.ToEntity(ref data, master);

            ViewData["MasterForm"] = ReadViewHelper.PartialView(this, "_MasterForm", UserGroupBusiness.FromEntity(data));
            ViewData["TreeList"]   = ReadViewHelper.PartialView(this, "_MasterForm", UserGroupBusiness.FromEntity(data));
            return(PartialView("_DetailGrid", _Service.GetGroupUser(master.ID)));
        }
コード例 #2
0
 public ActionResult DetailGrid(int?key)
 {
     if (key.HasValue)
     {
         var data = _Service.GetByKey(key.Value);
         ViewData["MasterForm"] = ReadViewHelper.PartialView(this, "_MasterForm", UserGroupBusiness.FromEntity(data));
         return(PartialView("_DetailGrid", _Service.GetGroupUser(key.Value)));
     }
     else
     {
         //ViewData["MasterForm"] = ReadViewHelper.PartialView(this, "_MasterForm", new ViewModel.UserGroup.UserGroupModel());
         return(PartialView("_DetailGrid", new List <Models.SystemUser>()));
     }
 }