示例#1
0
        public ActionResult Edit(int id)
        {
            try
            {
                PermissionDataRepository ml = new PermissionDataRepository();

                PermissionData obj = ml.GetPermissionData(id);

                return(View(obj));
            }
            catch (Exception ex)
            {
                return(Content(ContentIcon.Error + "|" + ErrorWirter(RouteData, ex.Message)));
            }
        }
示例#2
0
        public ActionResult Edit(int id, FormCollection formCollection)
        {
            try
            {
                PermissionDataRepository ml = new PermissionDataRepository();

                PermissionData obj = ml.GetPermissionData(id);

                UpdateModel(obj);

                obj.LastUpdateDate = DateTime.Now;

                obj.LastUpdateUserID = ID;

                bool result = ml.Update(obj) > 0 ? true : false;

                return(result ? Content(ContentIcon.Succeed + "|操作成功") : Content(ContentIcon.Error + "|操作失败"));
            }
            catch (Exception ex)
            {
                return(Content(ContentIcon.Error + "|" + ErrorWirter(RouteData, ex.Message)));
            }
        }