Exemple #1
0
        public WalletAppService(IRepository <Transaction, long> walletLogsRepository,
                                IEmailSender emailSender,
                                IRepository <User, long> userRepository,
                                IUserEmailer userEmailer,
                                IHostSettingsAppService hostSettingsAppService,
                                ISettingManager settingManager,
                                ITenantSettingsAppService tenantSettingService,
                                IRepository <ExchangeRate, long> exchangeRateRepository,
                                ICurrenciesRepository currenciesRepository,
                                IRepository <SupportedCurrency, long> supportedCurrencyRepository, IExchangeRatesManager exchangeManager,
                                IUnitOfWorkManager unitOfWorkManager,
                                IRepository <Tenant> tenantRepository)

        {
            _walletLogsRepository        = walletLogsRepository;
            _emailSender                 = emailSender;
            _userRepository              = userRepository;
            _userEmailer                 = userEmailer;
            _hostSettingsAppService      = hostSettingsAppService;
            _settingManager              = settingManager;
            _tenantSettingService        = tenantSettingService;
            _exchangeRateRepository      = exchangeRateRepository;
            _currenciesRepository        = currenciesRepository;
            _supportedCurrencyRepository = supportedCurrencyRepository;
            _exchangeManager             = exchangeManager;
            _unitOfWorkManager           = unitOfWorkManager;
            _tenantRepository            = tenantRepository;
        }
Exemple #2
0
 public ZonesController(IZoneAppService zoneAppService, IGenericAppService genericAppService, ITenantSettingsAppService tenantsettingsAppService, ITaxAppService taxAppService)
 {
     this._zoneAppService           = zoneAppService;
     this._genericAppService        = genericAppService;
     this._tenantsettingsAppService = tenantsettingsAppService;
     this._taxAppService            = taxAppService;
 }
        public TenantSettingsAppService_Tests()
        {
            _tenantSettingsAppService = Resolve<ITenantSettingsAppService>();
            _settingManager = Resolve<ISettingManager>();

            LoginAsDefaultTenantAdmin();
            InitializeTestSettings();
        }
        public TenantSettingsAppService_Tests()
        {
            _tenantSettingsAppService = Resolve <ITenantSettingsAppService>();
            _settingManager           = Resolve <ISettingManager>();

            LoginAsDefaultTenantAdmin();
            InitializeTestSettings();
        }
Exemple #5
0
 public SettingsController(ITenantSettingsAppService tenantSettingsAppService, IMultiTenancyConfig multiTenancyConfig, TenantManager tenantManager, IBinaryObjectManager binaryObjectManager, IRepository <PaymentSetting, long> paymentSettingRepository)
 {
     this._tenantSettingsAppService = tenantSettingsAppService;
     this._multiTenancyConfig       = multiTenancyConfig;
     this._tenantManager            = tenantManager;
     this._binaryObjectManager      = binaryObjectManager;
     this._paymentSettingRepository = paymentSettingRepository;
 }
 public SettingsController(
     ITenantSettingsAppService tenantSettingsAppService,
     IMultiTenancyConfig multiTenancyConfig,
     ITimingAppService timingAppService)
 {
     _tenantSettingsAppService = tenantSettingsAppService;
     _multiTenancyConfig = multiTenancyConfig;
     _timingAppService = timingAppService;
 }
Exemple #7
0
 public LayoutController(ISessionAppService sessionAppService, IUserNavigationManager userNavigationManager, ITenancyNameFinder tenancyNameFinder, TenantManager tenantManager, IMultiTenancyConfig multiTenancyConfig, ITenantSettingsAppService tenantSettingsAppService)
 {
     this._sessionAppService        = sessionAppService;
     this._userNavigationManager    = userNavigationManager;
     this._tenancyNameFinder        = tenancyNameFinder;
     this._multiTenancyConfig       = multiTenancyConfig;
     this._tenantManager            = tenantManager;
     this._tenantSettingsAppService = tenantSettingsAppService;
 }
Exemple #8
0
 public SettingsController(
     ITenantSettingsAppService tenantSettingsAppService,
     IMultiTenancyConfig multiTenancyConfig,
     ITimingAppService timingAppService)
 {
     _tenantSettingsAppService = tenantSettingsAppService;
     _multiTenancyConfig = multiTenancyConfig;
     _timingAppService = timingAppService;
 }
 public CallApiATTPAppService(ILogger logger,
                              IAbpSession session,
                              ITenantSettingsAppService tenantSettingsr,
                              ICallApiDomainService callApiDomainService)
 {
     _logger               = logger;
     _session              = session;
     _tenantSettingsr      = tenantSettingsr;
     _callApiDomainService = callApiDomainService;
 }
Exemple #10
0
 public SettingsController(
     ITenantSettingsAppService tenantSettingsAppService,
     IMultiTenancyConfig multiTenancyConfig,
     ITimingAppService timingAppService,
     UserManager userManager)
 {
     _tenantSettingsAppService = tenantSettingsAppService;
     _multiTenancyConfig       = multiTenancyConfig;
     _timingAppService         = timingAppService;
     _userManager = userManager;
 }
Exemple #11
0
        public async Task <ActionResult> Zones(string zoneIds)
        {
            int?               impersonatorTenantId;
            object             value;
            object             obj;
            List <ZoneListDto> zoneListDtos = new List <ZoneListDto>();

            string[] strArrays = zoneIds.Split(new char[] { ',' });
            for (int i = 0; i < (int)strArrays.Length; i++)
            {
                string          str            = strArrays[i];
                IZoneAppService zoneAppService = this._zoneAppService;
                long            num            = long.Parse(str.ToString());
                if (this.AbpSession.ImpersonatorTenantId.HasValue)
                {
                    impersonatorTenantId = this.AbpSession.ImpersonatorTenantId;
                    value = impersonatorTenantId.Value;
                }
                else
                {
                    impersonatorTenantId = this.AbpSession.TenantId;
                    value = impersonatorTenantId.Value;
                }
                ZoneListDto zone = await zoneAppService.GetZone(num, (long)value);

                if (zone != null && zone.Id.ToString().Length > 0)
                {
                    zoneListDtos.Add(zone);
                }
            }
            strArrays = null;
            ITenantSettingsAppService tenantSettingsAppService = this._tenantsettingsAppService;

            if (this.AbpSession.ImpersonatorTenantId.HasValue)
            {
                impersonatorTenantId = this.AbpSession.ImpersonatorTenantId;
                obj = impersonatorTenantId.Value;
            }
            else
            {
                impersonatorTenantId = this.AbpSession.TenantId;
                obj = impersonatorTenantId.Value;
            }
            string tenantCoordinates = await tenantSettingsAppService.GetTenantCoordinates((long)obj);

            ZonesMapView zonesMapView = new ZonesMapView()
            {
                Zones             = zoneListDtos,
                TenantCoordinates = tenantCoordinates
            };

            return(this.View(zonesMapView));
        }
Exemple #12
0
 public AccountController(UserManager userManager, IUserAppService userAppService, IMultiTenancyConfig multiTenancyConfig, IUserEmailer userEmailer, RoleManager roleManager, TenantManager tenantManager, IUnitOfWorkManager unitOfWorkManager, ITenancyNameFinder tenancyNameFinder, ICacheManager cacheManager, IWebUrlService webUrlService, ITenantSettingsAppService tenantSettingsAppService)
 {
     this._userManager              = userManager;
     this._userAppService           = userAppService;
     this._multiTenancyConfig       = multiTenancyConfig;
     this._userEmailer              = userEmailer;
     this._roleManager              = roleManager;
     this._tenantManager            = tenantManager;
     this._unitOfWorkManager        = unitOfWorkManager;
     this._tenancyNameFinder        = tenancyNameFinder;
     this._cacheManager             = cacheManager;
     this._webUrlService            = webUrlService;
     this._tenantSettingsAppService = tenantSettingsAppService;
 }
 public SettingsController(
     ITenantSettingsAppService tenantSettingsAppService,
     IMultiTenancyConfig multiTenancyConfig,
     ITimingAppService timingAppService,
     UserManager userManager,
     TenantManager tenantManager,
     IAppConfigurationAccessor configurationAccessor)
 {
     _tenantSettingsAppService = tenantSettingsAppService;
     _multiTenancyConfig       = multiTenancyConfig;
     _timingAppService         = timingAppService;
     _userManager           = userManager;
     _tenantManager         = tenantManager;
     _configurationAccessor = configurationAccessor;
 }
Exemple #14
0
        public async Task <PartialViewResult> MapViewModal()
        {
            int?            impersonatorTenantId;
            int             value;
            object          obj;
            IZoneAppService zoneAppService = this._zoneAppService;

            if (this.AbpSession.ImpersonatorTenantId.HasValue)
            {
                impersonatorTenantId = this.AbpSession.ImpersonatorTenantId;
                value = impersonatorTenantId.Value;
            }
            else
            {
                impersonatorTenantId = this.AbpSession.TenantId;
                value = impersonatorTenantId.Value;
            }
            List <ZoneListDto> zonesByTenantId = await zoneAppService.GetZonesByTenantId(value, true);

            if (zonesByTenantId == null || zonesByTenantId != null && zonesByTenantId.Count == 0)
            {
                zonesByTenantId = new List <ZoneListDto>();
            }
            ITenantSettingsAppService tenantSettingsAppService = this._tenantsettingsAppService;

            if (this.AbpSession.ImpersonatorTenantId.HasValue)
            {
                impersonatorTenantId = this.AbpSession.ImpersonatorTenantId;
                obj = impersonatorTenantId.Value;
            }
            else
            {
                impersonatorTenantId = this.AbpSession.TenantId;
                obj = impersonatorTenantId.Value;
            }
            string tenantCoordinates = await tenantSettingsAppService.GetTenantCoordinates((long)obj);

            ZonesMapView zonesMapView = new ZonesMapView()
            {
                Zones             = zonesByTenantId,
                TenantCoordinates = tenantCoordinates
            };

            return(this.PartialView("_MapViewModal", zonesMapView));
        }
Exemple #15
0
 public DangKyQuangCaoLTDomainService(IRepository <XHoSoVFA, long> vfaHoSoRepos,
                                      ICallApiDomainService callApiAppService,
                                      IRepository <DoanhNghiep, long> doanhNghiepRepos,
                                      ITenantSettingsAppService tenantSettingsr,
                                      IRepository <QuocGia, int> quocGiaRepos,
                                      IRepository <Tinh, int> tinhRepos,
                                      IRepository <Huyen, long> huyenRepos,
                                      IRepository <Xa, long> xaRepos,
                                      ILogger logger)
 {
     _vfaHoSoRepos      = vfaHoSoRepos;
     _callApiAppService = callApiAppService;
     _doanhNghiepRepos  = doanhNghiepRepos;
     _quocGiaRepos      = quocGiaRepos;
     _tinhRepos         = tinhRepos;
     _huyenRepos        = huyenRepos;
     _xaRepos           = xaRepos;
     _logger            = logger;
 }
Exemple #16
0
        public async Task <PartialViewResult> CreateOrUpdateModal(long?id = null)
        {
            int?                   impersonatorTenantId;
            object                 value;
            IZoneAppService        zoneAppService  = this._zoneAppService;
            NullableIdInput <long> nullableIdInput = new NullableIdInput <long>()
            {
                Id = id
            };
            CreateOrUpdateZoneModalViewModel createOrUpdateZoneModalViewModel = new CreateOrUpdateZoneModalViewModel(await zoneAppService.GetZoneForEdit(nullableIdInput));
            CreateOrUpdateZoneModalViewModel tenantCoordinates        = createOrUpdateZoneModalViewModel;
            ITenantSettingsAppService        tenantSettingsAppService = this._tenantsettingsAppService;

            if (this.AbpSession.ImpersonatorTenantId.HasValue)
            {
                impersonatorTenantId = this.AbpSession.ImpersonatorTenantId;
                value = impersonatorTenantId.Value;
            }
            else
            {
                impersonatorTenantId = this.AbpSession.TenantId;
                value = impersonatorTenantId.Value;
            }
            tenantCoordinates.TenantCoordinates = await tenantSettingsAppService.GetTenantCoordinates((long)value);

            tenantCoordinates = null;
            List <SelectListItem> selectListItems = new List <SelectListItem>();

            foreach (Tax taxesForTaxRule in await this._taxAppService.GetTaxesForTaxRules())
            {
                List <SelectListItem> selectListItems1 = selectListItems;
                SelectListItem        selectListItem   = new SelectListItem()
                {
                    Text     = string.Format("{0} - {1}%", taxesForTaxRule.Name, taxesForTaxRule.Rate),
                    Value    = taxesForTaxRule.Id.ToString(),
                    Disabled = false,
                    Selected = false
                };
                selectListItems1.Add(selectListItem);
            }
            this.ViewData["Taxes"] = selectListItems.AsEnumerable <SelectListItem>();
            return(this.PartialView("_CreateOrUpdateModal", createOrUpdateZoneModalViewModel));
        }
Exemple #17
0
 public MapController(IZoneAppService zoneAppService, ITenantSettingsAppService tenantsettingsAppService)
 {
     this._zoneAppService           = zoneAppService;
     this._tenantsettingsAppService = tenantsettingsAppService;
 }
 public SettingsController(ITenantSettingsAppService tenantSettingsAppService, IMultiTenancyConfig multiTenancyConfig)
 {
     _tenantSettingsAppService = tenantSettingsAppService;
     _multiTenancyConfig       = multiTenancyConfig;
 }
Exemple #19
0
 public SettingsController(ITenantSettingsAppService tenantSettingsAppService, IMultiTenancyConfig multiTenancyConfig)
 {
     _tenantSettingsAppService = tenantSettingsAppService;
     _multiTenancyConfig = multiTenancyConfig;
 }
Exemple #20
0
 public TenantSettingsController(ITenantSettingsAppService tenantSettingsAppService)
 {
     _tenantSettingsAppService = tenantSettingsAppService;
 }
Exemple #21
0
        public virtual async Task <JsonResult> UpdateTenantLogos(TenantLogosUploadModel model)
        {
            JsonResult   jsonResult;
            Guid?        headerImageId;
            BinaryObject binaryObject;
            BinaryObject binaryObject1;
            BinaryObject binaryObject2;
            BinaryObject binaryObject3;

            try
            {
                bool flag = false;
                ITenantSettingsAppService tenantSettingsAppService = this._tenantSettingsAppService;
                int?tenantId = this.AbpSession.TenantId;
                TenantLogosEditDto tenantLogos = await tenantSettingsAppService.GetTenantLogos(tenantId.Value);

                if (this.Request.Files.Count > 0)
                {
                    foreach (object key in this.Request.Files.Keys)
                    {
                        HttpPostedFileBase item = this.Request.Files[key.ToString()];
                        if (item.ContentLength > 512000)
                        {
                            throw new UserFriendlyException(this.L("TenantCompanyLogo_Warn_SizeLimit"));
                        }
                        string str = key.ToString();
                        if (str == "HeaderImage")
                        {
                            headerImageId = tenantLogos.HeaderImageId;
                            if (headerImageId.HasValue)
                            {
                                headerImageId = tenantLogos.HeaderImageId;
                                if (headerImageId.Value != Guid.Empty)
                                {
                                    IBinaryObjectManager binaryObjectManager = this._binaryObjectManager;
                                    headerImageId = tenantLogos.HeaderImageId;
                                    await binaryObjectManager.DeleteAsync(headerImageId.Value);
                                }
                            }
                            binaryObject = new BinaryObject(item.InputStream.GetAllBytes());
                            await this._binaryObjectManager.SaveAsync(binaryObject);

                            tenantLogos.HeaderImageId = new Guid?(binaryObject.Id);
                            flag = true;
                        }
                        else if (str == "HeaderMobileImage")
                        {
                            headerImageId = tenantLogos.HeaderMobileImageId;
                            if (headerImageId.HasValue)
                            {
                                headerImageId = tenantLogos.HeaderMobileImageId;
                                if (headerImageId.Value != Guid.Empty)
                                {
                                    IBinaryObjectManager binaryObjectManager1 = this._binaryObjectManager;
                                    headerImageId = tenantLogos.HeaderMobileImageId;
                                    await binaryObjectManager1.DeleteAsync(headerImageId.Value);
                                }
                            }
                            binaryObject1 = new BinaryObject(item.InputStream.GetAllBytes());
                            await this._binaryObjectManager.SaveAsync(binaryObject1);

                            tenantLogos.HeaderMobileImageId = new Guid?(binaryObject1.Id);
                            flag = true;
                        }
                        else if (str == "MailImage")
                        {
                            headerImageId = tenantLogos.MailImageId;
                            if (headerImageId.HasValue)
                            {
                                headerImageId = tenantLogos.MailImageId;
                                if (headerImageId.Value != Guid.Empty)
                                {
                                    IBinaryObjectManager binaryObjectManager2 = this._binaryObjectManager;
                                    headerImageId = tenantLogos.MailImageId;
                                    await binaryObjectManager2.DeleteAsync(headerImageId.Value);
                                }
                            }
                            binaryObject2 = new BinaryObject(item.InputStream.GetAllBytes());
                            await this._binaryObjectManager.SaveAsync(binaryObject2);

                            tenantLogos.MailImageId = new Guid?(binaryObject2.Id);
                            flag = true;
                        }
                        else if (str == "InvoiceImage")
                        {
                            headerImageId = tenantLogos.InvoiceImageId;
                            if (headerImageId.HasValue)
                            {
                                headerImageId = tenantLogos.InvoiceImageId;
                                if (headerImageId.Value != Guid.Empty)
                                {
                                    IBinaryObjectManager binaryObjectManager3 = this._binaryObjectManager;
                                    headerImageId = tenantLogos.InvoiceImageId;
                                    await binaryObjectManager3.DeleteAsync(headerImageId.Value);
                                }
                            }
                            binaryObject3 = new BinaryObject(item.InputStream.GetAllBytes());
                            await this._binaryObjectManager.SaveAsync(binaryObject3);

                            tenantLogos.InvoiceImageId = new Guid?(binaryObject3.Id);
                            flag = true;
                        }
                        binaryObject  = null;
                        binaryObject1 = null;
                        binaryObject2 = null;
                        binaryObject3 = null;
                        item          = null;
                    }
                }
                if (model.ClearHeaderImageId.HasValue && model.ClearHeaderImageId.Value)
                {
                    headerImageId = model.HeaderImageId;
                    if (headerImageId.HasValue)
                    {
                        IBinaryObjectManager binaryObjectManager4 = this._binaryObjectManager;
                        headerImageId = tenantLogos.HeaderImageId;
                        await binaryObjectManager4.DeleteAsync(headerImageId.Value);

                        headerImageId             = null;
                        tenantLogos.HeaderImageId = headerImageId;
                        flag = true;
                    }
                }
                if (model.ClearHeaderMobileImageId.HasValue && model.ClearHeaderMobileImageId.Value)
                {
                    headerImageId = model.HeaderMobileImageId;
                    if (headerImageId.HasValue)
                    {
                        IBinaryObjectManager binaryObjectManager5 = this._binaryObjectManager;
                        headerImageId = tenantLogos.HeaderMobileImageId;
                        await binaryObjectManager5.DeleteAsync(headerImageId.Value);

                        headerImageId = null;
                        tenantLogos.HeaderMobileImageId = headerImageId;
                        flag = true;
                    }
                }
                if (model.ClearMailImageId.HasValue && model.ClearMailImageId.Value)
                {
                    headerImageId = model.MailImageId;
                    if (headerImageId.HasValue)
                    {
                        IBinaryObjectManager binaryObjectManager6 = this._binaryObjectManager;
                        headerImageId = tenantLogos.MailImageId;
                        await binaryObjectManager6.DeleteAsync(headerImageId.Value);

                        headerImageId           = null;
                        tenantLogos.MailImageId = headerImageId;
                        flag = true;
                    }
                }
                if (model.ClearInvoiceImageId.HasValue && model.ClearInvoiceImageId.Value)
                {
                    headerImageId = model.InvoiceImageId;
                    if (headerImageId.HasValue)
                    {
                        IBinaryObjectManager binaryObjectManager7 = this._binaryObjectManager;
                        headerImageId = tenantLogos.InvoiceImageId;
                        await binaryObjectManager7.DeleteAsync(headerImageId.Value);

                        headerImageId = null;
                        tenantLogos.InvoiceImageId = headerImageId;
                        flag = true;
                    }
                }
                if (flag)
                {
                    await this._tenantSettingsAppService.UpdateTenantLogos(tenantLogos);
                }
                jsonResult = this.Json(new MvcAjaxResponse());
            }
            catch (UserFriendlyException userFriendlyException1)
            {
                UserFriendlyException userFriendlyException = userFriendlyException1;
                jsonResult = this.Json(new MvcAjaxResponse(new ErrorInfo(userFriendlyException.Message), false));
            }
            return(jsonResult);
        }