コード例 #1
0
 public AccountController(
     AccountService accountService,
     ActionService actionService,
     PermissionService permissionService,
     RoleService roleService,
     AuthLogService logService
     )
 {
     this.accountService    = accountService;
     this.actionService     = actionService;
     this.permissionService = permissionService;
     this.roleService       = roleService;
     this.logService        = logService;
 }
コード例 #2
0
 public RolesController(
     RoleService roleService,
     PermissionService permissionService,
     ActionService actionService,
     AuthLogService logService,
     IRepository <SYS_Permission> permissionRepository
     )
 {
     this.roleService          = roleService;
     this.permissionService    = permissionService;
     this.actionService        = actionService;
     this.logService           = logService;
     this.permissionRepository = permissionRepository;
 }
コード例 #3
0
        public int UpdateIdentificationType(IdentificationType _IdentificationType)
        {
            try
            {
                int  result = 0;
                bool IsRecordExist;
                if (!string.IsNullOrWhiteSpace(_IdentificationType.IdentificationId))
                {
                    IsRecordExist = _IUoW.Repository <IdentificationType>().IsRecordExist(x => x.IdentificationId == _IdentificationType.IdentificationId);
                    if (IsRecordExist)
                    {
                        var _oldIdentificationType       = _IUoW.Repository <IdentificationType>().GetBy(x => x.IdentificationId == _IdentificationType.IdentificationId);
                        var _oldIdentificationTypeForLog = ObjectCopier.DeepCopy(_oldIdentificationType);

                        _oldIdentificationType.AuthStatusId = _IdentificationType.AuthStatusId = "U";
                        _oldIdentificationType.LastAction   = _IdentificationType.LastAction = "EDT";
                        _oldIdentificationType.LastUpdateDT = _IdentificationType.LastUpdateDT = System.DateTime.Now;
                        _oldIdentificationType.MakeBy       = "mtaka";
                        result = _IUoW.Repository <IdentificationType>().Update(_oldIdentificationType);

                        #region Auth Log
                        if (result == 1)
                        {
                            _IAuthLogService = new AuthLogService();
                            long _outMaxSlAuthLogDtl = 0;
                            result = _IAuthLogService.AddAuthLog(_IUoW, _oldIdentificationTypeForLog, _IdentificationType, "EDT", "0001", "010101001", 1, "IdentificationType", "MTK_CP_IDENTIFICATION_TYPE", "IdentificationId", _IdentificationType.IdentificationId, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl);
                        }
                        #endregion

                        if (result == 1)
                        {
                            _IUoW.Commit();
                        }
                        return(result);
                    }
                }
                return(result);
            }
            catch (Exception ex)
            {
                _ObjErrorLogService = new ErrorLogService();
                _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateIdentificationType(obj)", string.Empty);
                return(0);
            }
        }
コード例 #4
0
        public int UpdateCusCategory(CusCategory _CusCategory)
        {
            try
            {
                int  result = 0;
                bool IsRecordExist;
                if (!string.IsNullOrWhiteSpace(_CusCategory.CusCategoryId))
                {
                    IsRecordExist = _IUoW.Repository <CusCategory>().IsRecordExist(x => x.CusCategoryId == _CusCategory.CusCategoryId);
                    if (IsRecordExist)
                    {
                        var _oldCusCategory       = _IUoW.Repository <CusCategory>().GetBy(x => x.CusCategoryId == _CusCategory.CusCategoryId);
                        var _oldCusCategoryForLog = ObjectCopier.DeepCopy(_oldCusCategory);

                        _oldCusCategory.AuthStatusId = _CusCategory.AuthStatusId = "U";
                        _oldCusCategory.LastAction   = _CusCategory.LastAction = "EDT";
                        _oldCusCategory.LastUpdateDT = _CusCategory.LastUpdateDT = System.DateTime.Now;
                        _oldCusCategory.MakeBy       = "mtaka";
                        result = _IUoW.Repository <CusCategory>().Update(_oldCusCategory);

                        #region Auth Log
                        if (result == 1)
                        {
                            _IAuthLogService = new AuthLogService();
                            long _outMaxSlAuthLogDtl = 0;
                            result = _IAuthLogService.AddAuthLog(_IUoW, _oldCusCategoryForLog, _CusCategory, "EDT", "0001", _CusCategory.FunctionId, 1, "CusCategory", "MTK_SP_CUS_CATEGORY", "CusCategoryId", _CusCategory.CusCategoryId, _CusCategory.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl);
                        }
                        #endregion

                        if (result == 1)
                        {
                            _IUoW.Commit();
                        }
                        return(result);
                    }
                }
                return(result);
            }
            catch (Exception ex)
            {
                _ObjErrorLogService = new ErrorLogService();
                _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateCusCategory(obj)", string.Empty);
                return(0);
            }
        }
コード例 #5
0
        public int AddIdentificationType(IdentificationType _IdentificationType)
        {
            try
            {
                var _max = _IUoW.Repository <IdentificationType>().GetMaxValue(x => x.IdentificationId) + 1;
                _IdentificationType.IdentificationId = _max.ToString().PadLeft(2, '0');
                _IdentificationType.AuthStatusId     = "U";
                _IdentificationType.LastAction       = "ADD";
                _IdentificationType.MakeDT           = System.DateTime.Now;
                _IdentificationType.MakeBy           = "mtaka";
                var result = _IUoW.Repository <IdentificationType>().Add(_IdentificationType);

                #region Auth Log
                if (result == 1)
                {
                    _IAuthLogService = new AuthLogService();
                    long _outMaxSlAuthLogDtl = 0;
                    result = _IAuthLogService.AddAuthLog(_IUoW, null, _IdentificationType, "ADD", "0001", "010101001", 1, "IdentificationType", "MTK_CP_IDENTIFICATION_TYPE", "IdentificationId", _IdentificationType.IdentificationId, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl);
                }
                #endregion

                if (result == 1)
                {
                    _IUoW.Commit();
                }

                _IUoW.Commit();
                return(result);
            }
            catch (Exception ex)
            {
                _ObjErrorLogService = new ErrorLogService();
                _ObjErrorLogService.AddErrorLog(ex, string.Empty, "AddIdentificationType(obj)", string.Empty);
                return(0);;
            }
        }
コード例 #6
0
        public int AddCusCategory(CusCategory _CusCategory)
        {
            try
            {
                var _max = _IUoW.Repository <CusCategory>().GetMaxValue(x => x.CusCategoryId) + 1;
                _CusCategory.CusCategoryId = _max.ToString().PadLeft(2, '0');
                _CusCategory.AuthStatusId  = "U";
                _CusCategory.LastAction    = "ADD";
                _CusCategory.MakeDT        = System.DateTime.Now;
                _CusCategory.MakeBy        = "mtaka";
                var result = _IUoW.Repository <CusCategory>().Add(_CusCategory);

                #region Auth Log
                if (result == 1)
                {
                    _IAuthLogService = new AuthLogService();
                    long _outMaxSlAuthLogDtl = 0;
                    result = _IAuthLogService.AddAuthLog(_IUoW, null, _CusCategory, "ADD", "0001", _CusCategory.FunctionId, 1, "CusCategory", "MTK_SP_CUS_CATEGORY", "CusCategoryId", _CusCategory.CusCategoryId, _CusCategory.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl);
                }
                #endregion

                if (result == 1)
                {
                    _IUoW.Commit();
                }

                _IUoW.Commit();
                return(result);
            }
            catch (Exception ex)
            {
                _ObjErrorLogService = new ErrorLogService();
                _ObjErrorLogService.AddErrorLog(ex, string.Empty, "AddCusCategory(obj)", string.Empty);
                return(0);;
            }
        }