コード例 #1
0
ファイル: PermissionService.cs プロジェクト: nankede/lycoder
        /// <summary>
        /// 逻辑删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public static int Delete(int Id)
        {
            var model = new Sys_Permission()
            {
                Id           = Id,
                SPDeleteMark = 1,
                SPModifyUser = OperatorProvider.Instance.Current.UserId,
                SPModifyTime = DateTime.Now,
            };
            var updateColumns = new List <Sys_PermissionFields>()
            {
                Sys_PermissionFields.SPDeleteMark, Sys_PermissionFields.SPModifyUser, Sys_PermissionFields.SPModifyTime
            };

            return(PermissionAccess.Update(model, updateColumns));
        }
コード例 #2
0
ファイル: PermissionService.cs プロジェクト: nankede/lycoder
        public static new int Update(Sys_Permission model)
        {
            if (model.SPParentId > 0)
            {
                var parent = PermissionAccess.Get(model.SPParentId);
                model.SPLayer = parent == null ? 0 : (parent.SPLayer + 1);
            }
            model.SPModifyUser = OperatorProvider.Instance.Current.UserId;
            model.SPModifyTime = DateTime.Now;
            var updateColumns = new List <Sys_PermissionFields>()
            {
                Sys_PermissionFields.SPParentId, Sys_PermissionFields.SPLayer, Sys_PermissionFields.SPEnCode
                , Sys_PermissionFields.SPName, Sys_PermissionFields.SPJsEvent, Sys_PermissionFields.SPIcon
                , Sys_PermissionFields.SPUrl, Sys_PermissionFields.SPRemark, Sys_PermissionFields.SPType
                , Sys_PermissionFields.SPSortCode, Sys_PermissionFields.SPIsPublic, Sys_PermissionFields.SPIsEnabled
                , Sys_PermissionFields.SPIsEdit, Sys_PermissionFields.SPModifyUser, Sys_PermissionFields.SPModifyTime
            };

            return(PermissionAccess.Update(model, updateColumns));
        }
コード例 #3
0
 public bool Update(object data)
 {
     return(dataAccess.Update(data));
 }