Пример #1
0
        public AccessTypeController(IAccessTypeRepository repository, string catalog, LoginView view)
        {
            this._LoginId = view.LoginId.ToLong();
            this._UserId = view.UserId.ToInt();
            this._OfficeId = view.OfficeId.ToInt();
            this._Catalog = catalog;

            this.AccessTypeRepository = repository;
        }
Пример #2
0
        public AccessTypeController()
        {
            this._LoginId = AppUsers.GetCurrent().View.LoginId.ToLong();
            this._UserId = AppUsers.GetCurrent().View.UserId.ToInt();
            this._OfficeId = AppUsers.GetCurrent().View.OfficeId.ToInt();
            this._Catalog = AppUsers.GetCurrentUserDB();

            this.AccessTypeRepository = new MixERP.Net.Schemas.Policy.Data.AccessType
            {
                _Catalog = this._Catalog,
                _LoginId = this._LoginId,
                _UserId = this._UserId
            };
        }
Пример #3
0
        public AccessTypeController()
        {
            this._LoginId  = AppUsers.GetCurrent().View.LoginId.ToLong();
            this._UserId   = AppUsers.GetCurrent().View.UserId.ToInt();
            this._OfficeId = AppUsers.GetCurrent().View.OfficeId.ToInt();
            this._Catalog  = AppUsers.GetCurrentUserDB();

            this.AccessTypeRepository = new MixERP.Net.Schemas.Policy.Data.AccessType
            {
                _Catalog = this._Catalog,
                _LoginId = this._LoginId,
                _UserId  = this._UserId
            };
        }
Пример #4
0
        public AccessTypeController()
        {
            this._LoginId = AppUsers.GetCurrent().View.LoginId.To<long>();
            this._UserId = AppUsers.GetCurrent().View.UserId.To<int>();
            this._OfficeId = AppUsers.GetCurrent().View.OfficeId.To<int>();
            this._Catalog = AppUsers.GetCatalog();

            this.AccessTypeRepository = new Frapid.Config.DataAccess.AccessType
            {
                _Catalog = this._Catalog,
                _LoginId = this._LoginId,
                _UserId = this._UserId
            };
        }
Пример #5
0
        public AccessTypeController()
        {
            this._LoginId  = AppUsers.GetCurrent().View.LoginId.To <long>();
            this._UserId   = AppUsers.GetCurrent().View.UserId.To <int>();
            this._OfficeId = AppUsers.GetCurrent().View.OfficeId.To <int>();
            this._Catalog  = AppUsers.GetCatalog();

            this.AccessTypeRepository = new Frapid.Config.DataAccess.AccessType
            {
                _Catalog = this._Catalog,
                _LoginId = this._LoginId,
                _UserId  = this._UserId
            };
        }
Пример #6
0
 public UserController(UserManager <ApplicationUser> userManager,
                       SignInManager <ApplicationUser> signInManager, IAccessTypeRepository typeRepository,
                       RoleManager <IdentityRole> roleManager, IUserRepository profileRepository,
                       IHttpContextAccessor httpContextAccessor, Utility utility)
 {
     this.userManager         = userManager;
     this.signInManager       = signInManager;
     this.typeRepository      = typeRepository;
     this.roleManager         = roleManager;
     this.profileRepository   = profileRepository;
     this.httpContextAccessor = httpContextAccessor;
     this.utility             = utility;
     userId = httpContextAccessor.HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
 }
 public static void SeedDatas(
     RoleManager <IdentityRole> roleManager, UserManager <ApplicationUser> userManager,
     IDocumentTypeRepository typeRepository, IAccessTypeRepository accessType,
     IApprovalProgressStatusRepository approvalProgress, IApprovalStatusRepository approvalStatus,
     IAuditActionRepository actionRepository
     )
 {
     SeedRoles(roleManager);
     SeedUsers(userManager);
     SeedDocumentType(typeRepository);
     SeedAccessType(accessType);
     SeedApprovalProgressStatus(approvalProgress);
     SeedApprovalStatus(approvalStatus);
     SeedAuditAction(actionRepository);
 }
 public static void SeedAccessType(IAccessTypeRepository typeRepository)
 {
     string[] accessTypeList = new string[] { "Create", "Read", "Update", "Delete", "Download" };
     foreach (string accessType in accessTypeList)
     {
         if (typeRepository.FindByNameAsync(accessType).Result == null)
         {
             AccessType access = new AccessType()
             {
                 Type = accessType
             };
             try
             {
                 typeRepository.SaveAccessTypeAsync(access);
             }
             catch (Exception ex)
             {
                 Console.WriteLine(ex);
             }
         }
     }
 }
Пример #9
0
 public AccessTypeController(ILogger <AccessTypeController> logger, IAccessTypeRepository accesstype)
 {
     _logger     = logger;
     _accesstype = accesstype;
 }