Ejemplo n.º 1
0
 public GenericController(IGenericAppService genericAppService, ITaxAppService taxAppService, IRepository <Role> roleRepository, UserManager userManager)
 {
     this._abpSession        = NullAbpSession.Instance;
     this._genericAppService = genericAppService;
     this._userManager       = userManager;
     this._roleRepository    = roleRepository;
 }
Ejemplo n.º 2
0
 public PlanningController
     (IPlanningAppService planningAppService,
     IGenericAppService <InfoSeance, GetInfoSeanceResource, SetInfoSeanceResource> infoSeanceAppService)
 {
     _planningAppService   = planningAppService;
     _infoSeanceAppService = infoSeanceAppService;
 }
Ejemplo n.º 3
0
 public ZonesController(IZoneAppService zoneAppService, IGenericAppService genericAppService, ITenantSettingsAppService tenantsettingsAppService, ITaxAppService taxAppService)
 {
     this._zoneAppService           = zoneAppService;
     this._genericAppService        = genericAppService;
     this._tenantsettingsAppService = tenantsettingsAppService;
     this._taxAppService            = taxAppService;
 }
Ejemplo n.º 4
0
 public CustomersController(ICustomerAppService customerAppService, IGenericAppService genericAppService, ITitleAppService titleAppService, IRepository <Invoice, long> invoiceRepository, IRepository <InvoicePayment, long> invoicePaymentRepository)
 {
     this._customerAppService       = customerAppService;
     this._genericAppService        = genericAppService;
     this._titleAppService          = titleAppService;
     this._invoiceRepository        = invoiceRepository;
     this._invoicePaymentRepository = invoicePaymentRepository;
 }
Ejemplo n.º 5
0
 public CustomerAppService(IRepository <Customer, long> customerRepository, IRepository <Address, long> addressRepository, IRepository <Phone, long> phoneRepository, ICustomerListExcelExporter customerListExcelExporter, IGenericAppService genericAppService)
 {
     this._customerRepository        = customerRepository;
     this._addressRepository         = addressRepository;
     this._phoneRepository           = phoneRepository;
     this._customerListExcelExporter = customerListExcelExporter;
     this._genericAppService         = genericAppService;
 }
Ejemplo n.º 6
0
 public LayoutController(ISessionAppService sessionAppService, IUserNavigationManager userNavigationManager, IMultiTenancyConfig multiTenancyConfig, ITenancyNameFinder tenancyNameFinder, TenantManager tenantManager, IGenericAppService genericAppService, ITenantSettingsAppService tenantSettingsAppService)
 {
     this._sessionAppService        = sessionAppService;
     this._userNavigationManager    = userNavigationManager;
     this._tenancyNameFinder        = tenancyNameFinder;
     this._multiTenancyConfig       = multiTenancyConfig;
     this._tenantManager            = tenantManager;
     this._genericAppService        = genericAppService;
     this._tenantSettingsAppService = tenantSettingsAppService;
 }
Ejemplo n.º 7
0
        public async Task <PartialViewResult> CreateOrUpdateQuickMenuItemModal(long?id)
        {
            IGenericAppService     genericAppService = this._genericAppService;
            NullableIdInput <long> nullableIdInput   = new NullableIdInput <long>()
            {
                Id = id
            };
            GetQuickMenuItemForEditOutput quickMenuItemForEdit = await genericAppService.GetQuickMenuItemForEdit(nullableIdInput);

            return(this.PartialView("_CreateOrUpdateQuickMenuItemModal", new CreateOrUpdateQuickMenuItemModalViewModel(quickMenuItemForEdit)));
        }
Ejemplo n.º 8
0
 public PayController(TenantSettingsAppService tenantSettingsAppService, IPayAppService paymentAppService, IInvoiceAppService invoiceAppService, ICustomerAppService customerAppService, IGenericAppService genericAppService, TenantManager tenantManager, IWebUrlService webUrlService, UserManager userManager, IUnitOfWorkManager unitOfWorkManager)
 {
     this._tenantSettingsAppService = tenantSettingsAppService;
     this._tenantManager            = tenantManager;
     this._webUrlService            = webUrlService;
     this._paymentAppService        = paymentAppService;
     this._invoiceAppService        = invoiceAppService;
     this._customerAppService       = customerAppService;
     this._genericAppService        = genericAppService;
     this._userManager       = userManager;
     this._unitOfWorkManager = unitOfWorkManager;
 }
Ejemplo n.º 9
0
        public async Task <PartialViewResult> CreateOrUpdatePhoneModal(long?ownerId, string ownerType, int tenantId, long?id = null)
        {
            long num;
            IGenericAppService     genericAppService = this._genericAppService;
            NullableIdInput <long> nullableIdInput   = new NullableIdInput <long>()
            {
                Id = id
            };
            GetPhoneForEditOutput phoneForEdit = await genericAppService.GetPhoneForEdit(nullableIdInput);

            if (string.IsNullOrEmpty(phoneForEdit.Phone.OwnerType))
            {
                phoneForEdit.Phone.OwnerType = ownerType;
                PhoneEditDto phone = phoneForEdit.Phone;
                num           = (ownerId.HasValue ? ownerId.Value : (long)0);
                phone.OwnerId = num;
            }
            CreateOrUpdatePhoneModalViewModel createOrUpdatePhoneModalViewModel = new CreateOrUpdatePhoneModalViewModel(phoneForEdit);
            List <SelectListItem>             selectListItems = new List <SelectListItem>();

            foreach (Lookup lookupItem in (new LookupFill("PhoneTypes", tenantId)).LookupItems)
            {
                SelectListItem selectListItem = new SelectListItem()
                {
                    Text     = lookupItem.Text,
                    Value    = lookupItem.Value,
                    Disabled = lookupItem.Disabled,
                    Selected = lookupItem.Selected
                };
                selectListItems.Add(selectListItem);
            }
            SelectListItem selectListItem1 = new SelectListItem()
            {
                Text     = "",
                Value    = "",
                Disabled = false
            };

            selectListItems.Insert(0, selectListItem1);
            this.ViewData["PhoneTypes"] = selectListItems;
            return(this.PartialView("_CreateOrUpdatePhoneModal", createOrUpdatePhoneModalViewModel));
        }
Ejemplo n.º 10
0
 public GenericController(IGenericAppService genericAppService, ICacheManager cacheManager)
 {
     this._genericAppService = genericAppService;
     this._cacheManager      = cacheManager;
 }
Ejemplo n.º 11
0
 public SuppliersController(ISupplierAppService supplierAppService, IGenericAppService genericAppService, IBinaryObjectManager binaryObjectManager)
 {
     this._supplierAppService  = supplierAppService;
     this._genericAppService   = genericAppService;
     this._binaryObjectManager = binaryObjectManager;
 }
Ejemplo n.º 12
0
 public TrucksController(ITruckAppService truckAppService, IGenericAppService genericAppService, IBinaryObjectManager binaryObjectManager)
 {
     this._truckAppService     = truckAppService;
     this._genericAppService   = genericAppService;
     this._binaryObjectManager = binaryObjectManager;
 }
Ejemplo n.º 13
0
        public async Task <ActionResult> Payeezy(FormCollection formFields)
        {
            int       value;
            string    str;
            Guid      guid;
            string    str1;
            bool      flag;
            PayNowDto payNowDto = new PayNowDto();

            try
            {
                int?impersonatorTenantId = this.AbpSession.ImpersonatorTenantId;
                if (impersonatorTenantId.HasValue)
                {
                    impersonatorTenantId = this.AbpSession.ImpersonatorTenantId;
                    value = impersonatorTenantId.Value;
                }
                else
                {
                    value = this.AbpSession.GetTenantId();
                }
                int num = value;
                TenantSettingsEditDto allSettingsByTenantId = await this._tenantSettingsAppService.GetAllSettingsByTenantId(num);

                long num1 = long.Parse(formFields["invoiceId"]);
                decimal.Parse(formFields["invoiceAmount"]);
                decimal num2    = decimal.Parse(formFields["paymentAmount"]);
                Invoice invoice = await this._invoiceAppService.GetInvoice(num1);

                if (invoice == null || invoice.TenantId != num)
                {
                    if (invoice != null)
                    {
                        throw new Exception("SecurityViolation");
                    }
                    throw new Exception("InvoiceIsNull");
                }
                payNowDto.x_invoice_num = invoice.Number;
                payNowDto.x_po_num      = invoice.PONumber;
                payNowDto.x_reference_3 = invoice.Number;
                ICustomerAppService    customerAppService = this._customerAppService;
                NullableIdInput <long> nullableIdInput    = new NullableIdInput <long>()
                {
                    Id = new long?(invoice.CustomerId)
                };
                GetCustomerForEditOutput customerForEdit = await customerAppService.GetCustomerForEdit(nullableIdInput);

                PayNowDto payNowDto1 = payNowDto;
                string[]  strArrays  = new string[7];
                long      id         = invoice.Id;
                strArrays[0] = id.ToString();
                strArrays[1] = "|";
                long?impersonatorUserId = customerForEdit.Customer.Id;
                id                 = impersonatorUserId.Value;
                strArrays[2]       = id.ToString();
                strArrays[3]       = "|";
                strArrays[4]       = num.ToString();
                strArrays[5]       = "|";
                impersonatorUserId = this.AbpSession.ImpersonatorUserId;
                if (impersonatorUserId.HasValue)
                {
                    impersonatorUserId = this.AbpSession.ImpersonatorUserId;
                    id  = impersonatorUserId.Value;
                    str = id.ToString();
                }
                else
                {
                    impersonatorUserId = this.AbpSession.UserId;
                    if (impersonatorUserId.HasValue)
                    {
                        impersonatorUserId = this.AbpSession.UserId;
                        id  = impersonatorUserId.Value;
                        str = id.ToString();
                    }
                    else
                    {
                        impersonatorUserId = this.AbpSession.UserId;
                        str = impersonatorUserId.ToString();
                    }
                }
                strArrays[6]         = str;
                payNowDto1.x_cust_id = string.Concat(strArrays);
                payNowDto.x_email    = customerForEdit.Customer.Email;
                if (customerForEdit.Customer.BusinessName != null && customerForEdit.Customer.BusinessName.ToString().Length > 0)
                {
                    payNowDto.x_company = customerForEdit.Customer.BusinessName;
                }
                if (customerForEdit.Customer.FirstName != null && customerForEdit.Customer.FirstName.ToString().Length > 0)
                {
                    payNowDto.x_first_name = customerForEdit.Customer.FirstName.ToString();
                }
                if (customerForEdit.Customer.LastName != null && customerForEdit.Customer.LastName.ToString().Length > 0)
                {
                    payNowDto.x_last_name = customerForEdit.Customer.LastName.ToString();
                }
                PayNowDto str2 = payNowDto;
                impersonatorUserId = customerForEdit.Customer.Id;
                id = impersonatorUserId.Value;
                str2.x_customer_tax_id = id.ToString();
                impersonatorUserId     = invoice.CustomerAddressId;
                if (impersonatorUserId.HasValue)
                {
                    impersonatorUserId = invoice.CustomerAddressId;
                    if (impersonatorUserId.Value > (long)0)
                    {
                        IGenericAppService genericAppService = this._genericAppService;
                        GetAddressesInput  getAddressesInput = new GetAddressesInput();
                        impersonatorUserId          = customerForEdit.Customer.Id;
                        getAddressesInput.OwnerId   = new long?(impersonatorUserId.Value);
                        getAddressesInput.OwnerType = "Customer";
                        PagedResultOutput <AddressListDto> addresses = await genericAppService.GetAddresses(getAddressesInput);

                        int num3 = 0;
                        while (num3 < addresses.Items.Count)
                        {
                            long id1 = (long)addresses.Items[num3].Id;
                            impersonatorUserId = invoice.CustomerAddressId;
                            flag = (id1 == impersonatorUserId.GetValueOrDefault() ? impersonatorUserId.HasValue : false);
                            if (!flag)
                            {
                                num3++;
                            }
                            else
                            {
                                payNowDto.x_address  = addresses.Items[num3].PrimaryAddress;
                                payNowDto.x_city     = addresses.Items[num3].City;
                                payNowDto.x_zip      = addresses.Items[num3].PostalCode;
                                impersonatorTenantId = addresses.Items[num3].CountryRegionId;
                                if (!impersonatorTenantId.HasValue)
                                {
                                    break;
                                }
                                IGenericAppService genericAppService1 = this._genericAppService;
                                impersonatorTenantId = addresses.Items[num3].CountryRegionId;
                                int?nullable = new int?(impersonatorTenantId.Value);
                                impersonatorTenantId = null;
                                ListResultOutput <CountryRegionInCountryListDto> countryRegions = genericAppService1.GetCountryRegions(nullable, impersonatorTenantId);
                                if (countryRegions.Items.Count != 1)
                                {
                                    break;
                                }
                                payNowDto.x_state = countryRegions.Items[0].Code;
                                break;
                            }
                        }
                    }
                }
                Tenant byIdAsync = await this._tenantManager.GetByIdAsync(num);

                string tenancyName = byIdAsync.TenancyName;
                string str3        = tenancyName;
                string str4        = tenancyName;
                str4      = str3;
                byIdAsync = await this._tenantManager.FindByTenancyNameAsync(str4);

                string    siteRootAddress = this._webUrlService.GetSiteRootAddress(str4);
                PayNowDto payNowDto2      = payNowDto;
                object[]  objArray        = new object[] { siteRootAddress, "Mpa/Settings/GetLogoById?logoId=", null, null, null };
                guid                            = (allSettingsByTenantId.Logo.InvoiceImageId.HasValue ? allSettingsByTenantId.Logo.InvoiceImageId.Value : Guid.Empty);
                objArray[2]                     = guid;
                objArray[3]                     = "&logoType=header&viewContrast=light&t=";
                id                              = Clock.Now.Ticks;
                objArray[4]                     = id.ToString();
                payNowDto2.x_logo_url           = string.Concat(objArray);
                payNowDto.x_receipt_link_url    = string.Concat(siteRootAddress, "Pay/PayeezyResponse");
                payNowDto.x_receipt_link_method = "AUTO-POST";
                payNowDto.x_receipt_link_text   = this.L("CompleteTransaction");
                if (allSettingsByTenantId.PaymentGatewaySettings.GatewaySettings.Length <= 3)
                {
                    throw new Exception("PaymentGatewayError_PayEezySettingsMissing");
                }
                PayEezyJsonObject payEezyJsonObject = JsonConvert.DeserializeObject <PayEezyJsonObject>(allSettingsByTenantId.PaymentGatewaySettings.GatewaySettings);
                payNowDto.x_login           = payEezyJsonObject.PayEezy_x_login;
                payNowDto.x_transaction_key = payEezyJsonObject.PayEezy_x_transaction_key;
                PayNowDto payNowDto3          = payNowDto;
                bool?     payEezyXTestRequest = payEezyJsonObject.PayEezy_x_test_request;
                payNowDto3.x_test_request = bool.Parse(payEezyXTestRequest.ToString());
                PayNowDto payNowDto4 = payNowDto;
                payEezyXTestRequest         = payEezyJsonObject.PayEezy_x_email_customer;
                payNowDto4.x_email_customer = bool.Parse(payEezyXTestRequest.ToString());
                payNowDto.x_gateway_id      = payEezyJsonObject.PayEezy_x_gateway_id;
                PayNowDto payNowDto5          = payNowDto;
                string    payEezyXDescription = payEezyJsonObject.PayEezy_x_description;
                str1 = (formFields["Description"] == null || formFields["Description"] != null && formFields["Description"].ToString().Length > 0 ? string.Concat(" ", formFields["Description"].ToString()) : "");
                payNowDto5.x_description = string.Concat(payEezyXDescription, str1);
                payNowDto.x_amount       = num2;
                payNowDto.x_customer_ip  = PayController.GetIPAddress(this.Request);
                Random    random = new Random();
                PayNowDto str5   = payNowDto;
                int       num4   = random.Next(0, 1000);
                str5.x_fp_sequence = num4.ToString();
                TimeSpan utcNow = DateTime.UtcNow - new DateTime(1970, 1, 1);
                payNowDto.x_fp_timestamp = ((int)utcNow.TotalSeconds).ToString();
                payNowDto.x_fp_hash      = PayController.GeneratePayeezyHash(payNowDto.x_transaction_key, payNowDto.x_login, payNowDto.x_amount, payNowDto.x_fp_sequence, payNowDto.x_fp_timestamp, "USD");
                if (!payNowDto.x_test_request)
                {
                    payNowDto.PostToUrl = "https://checkout.globalgatewaye4.firstdata.com/payment";
                }
                else
                {
                    payNowDto.PostToUrl = "https://demo.globalgatewaye4.firstdata.com/payment";
                }
                allSettingsByTenantId = null;
                invoice = null;
                str4    = null;
            }
            catch (Exception)
            {
                payNowDto = new PayNowDto();
                ((dynamic)this.ViewBag).Error_InvalidParameters = true;
            }
            return(this.View(payNowDto));
        }
Ejemplo n.º 14
0
        public async Task <PartialViewResult> CreateOrUpdateServiceModal(long addressId, long?ownerId, string ownerType, int tenantId, long?id = null)
        {
            long num;
            IGenericAppService     genericAppService = this._genericAppService;
            NullableIdInput <long> nullableIdInput   = new NullableIdInput <long>()
            {
                Id = id
            };
            GetServiceForEditOutput serviceForEdit = await genericAppService.GetServiceForEdit(nullableIdInput);

            if (string.IsNullOrEmpty(serviceForEdit.Service.OwnerType))
            {
                serviceForEdit.Service.OwnerType = ownerType;
                ServiceEditDto service = serviceForEdit.Service;
                num             = (ownerId.HasValue ? ownerId.Value : (long)0);
                service.OwnerId = num;
                serviceForEdit.Service.AddressId = addressId;
            }
            CreateOrUpdateServiceModalViewModel createOrUpdateServiceModalViewModel = new CreateOrUpdateServiceModalViewModel(serviceForEdit);
            List <SelectListItem> selectListItems = new List <SelectListItem>();
            LookupFill            lookupFill      = new LookupFill("ServiceTypes", tenantId);

            foreach (Lookup lookupItem in lookupFill.LookupItems)
            {
                SelectListItem selectListItem = new SelectListItem()
                {
                    Text     = lookupItem.Text,
                    Value    = lookupItem.Value,
                    Disabled = lookupItem.Disabled,
                    Selected = lookupItem.Selected
                };
                selectListItems.Add(selectListItem);
            }
            SelectListItem selectListItem1 = new SelectListItem()
            {
                Text     = "",
                Value    = "",
                Disabled = false
            };

            selectListItems.Insert(0, selectListItem1);
            this.ViewData["ServiceTypes"] = selectListItems;
            List <SelectListItem> selectListItems1 = new List <SelectListItem>();

            lookupFill = null;
            lookupFill = new LookupFill("RequestedServices", tenantId);
            foreach (Lookup lookup in lookupFill.LookupItems)
            {
                SelectListItem selectListItem2 = new SelectListItem()
                {
                    Text     = lookup.Text,
                    Value    = lookup.Value,
                    Disabled = lookup.Disabled,
                    Selected = lookup.Selected
                };
                selectListItems1.Add(selectListItem2);
            }
            SelectListItem selectListItem3 = new SelectListItem()
            {
                Text     = "",
                Value    = "",
                Disabled = false
            };

            selectListItems1.Insert(0, selectListItem3);
            this.ViewData["RequestedServices"] = selectListItems1.AsEnumerable <SelectListItem>();
            return(this.PartialView("_CreateOrUpdateServiceModal", createOrUpdateServiceModalViewModel));
        }
Ejemplo n.º 15
0
 public MasterPageControllerBase(IGenericAppService <TEntityDto, TCreateOrUpdateInputDto, TCreateOrUpdateOutPutDto, TEntity, TEntityInput> genericAppService)
 {
     _genericAppService = genericAppService;
 }
Ejemplo n.º 16
0
        public async Task <FileDto> GetCustomerWithAddressesToExcel()
        {
            string          str;
            string          str1;
            List <Customer> allListAsync = await this._customerRepository.GetAllListAsync();

            List <CustomerWithAddressListDto> customerWithAddressListDtos = new List <CustomerWithAddressListDto>();

            foreach (Customer customer in allListAsync)
            {
                IRepository <Address, long> repository = this._addressRepository;
                List <Address> addresses = await repository.GetAllListAsync((Address m) => m.OwnerId == customer.Id && m.OwnerType == "Customer");

                foreach (Address address in addresses)
                {
                    CustomerWithAddressListDto customerWithAddressListDto = new CustomerWithAddressListDto()
                    {
                        CustomerId   = customer.Id,
                        AllowBillPay = customer.AllowBillPay,
                        IsActive     = customer.IsActive,
                        FirstName    = customer.FirstName,
                        LastName     = customer.LastName,
                        BusinessName = customer.BusinessName,
                        CreationTime = new DateTime?(customer.CreationTime)
                    };
                    CustomerWithAddressListDto primaryAddress = customerWithAddressListDto;
                    primaryAddress.PrimaryAddress   = address.PrimaryAddress;
                    primaryAddress.SecondaryAddress = address.SecondaryAddress;
                    primaryAddress.City             = address.City;
                    int?countryRegionId = address.CountryRegionId;
                    if (!countryRegionId.HasValue)
                    {
                        primaryAddress.CountryRegionCode = "";
                    }
                    else
                    {
                        IGenericAppService genericAppService = this._genericAppService;
                        countryRegionId = address.CountryRegionId;
                        int?nullable = new int?(countryRegionId.Value);
                        countryRegionId = null;
                        ListResultOutput <CountryRegionInCountryListDto> countryRegions = genericAppService.GetCountryRegions(nullable, countryRegionId);
                        CustomerWithAddressListDto customerWithAddressListDto1          = primaryAddress;
                        str1 = (countryRegions == null || countryRegions.Items.Count != 1 ? "" : countryRegions.Items[0].Code);
                        customerWithAddressListDto1.CountryRegionCode = str1;
                    }
                    if (address.CountryId <= 0)
                    {
                        primaryAddress.CountryCode = "";
                    }
                    else
                    {
                        ListResultOutput <CountriesListDto> countries = this._genericAppService.GetCountries(new int?(address.CountryId));
                        CustomerWithAddressListDto          customerWithAddressListDto2 = primaryAddress;
                        str = (countries == null || countries.Items.Count != 1 ? "" : countries.Items[0].Code);
                        customerWithAddressListDto2.CountryCode = str;
                    }
                    primaryAddress.PostalCode      = address.PostalCode;
                    primaryAddress.Latitude        = address.Latitude;
                    primaryAddress.Longitude       = address.Longitude;
                    primaryAddress.ContactName     = address.ContactName;
                    primaryAddress.Type            = address.Type;
                    primaryAddress.AddressId       = address.Id;
                    primaryAddress.AddressIsActive = address.IsActive;
                    customerWithAddressListDtos.Add(primaryAddress);
                }
            }
            return(this._customerListExcelExporter.ExportToFile(customerWithAddressListDtos));
        }
Ejemplo n.º 17
0
        public async Task <PartialViewResult> CreateOrUpdateAddressModal(long?ownerId, string ownerType, int tenantId, long?id = null)
        {
            long?                  impersonatorUserId;
            string                 str;
            long                   value;
            long                   num;
            IGenericAppService     genericAppService = this._genericAppService;
            NullableIdInput <long> nullableIdInput   = new NullableIdInput <long>()
            {
                Id = id
            };
            GetAddressForEditOutput addressForEdit = await genericAppService.GetAddressForEdit(nullableIdInput);

            if (string.IsNullOrEmpty(addressForEdit.Address.OwnerType))
            {
                addressForEdit.Address.OwnerType = ownerType;
                AddressEditDto address = addressForEdit.Address;
                num             = (ownerId.HasValue ? ownerId.Value : (long)0);
                address.OwnerId = num;
            }
            CreateOrUpdateAddressModalViewModel createOrUpdateAddressModalViewModel = new CreateOrUpdateAddressModalViewModel(addressForEdit);
            List <SelectListItem> selectListItems = new List <SelectListItem>();

            str = (ownerType == "FillLot" ? "FillLotAddressTypes" : "AddressTypes");
            foreach (Lookup lookupItem in (new LookupFill(str, tenantId)).LookupItems)
            {
                SelectListItem selectListItem = new SelectListItem()
                {
                    Text     = lookupItem.Text,
                    Value    = lookupItem.Value,
                    Disabled = lookupItem.Disabled,
                    Selected = lookupItem.Selected
                };
                selectListItems.Add(selectListItem);
            }
            SelectListItem selectListItem1 = new SelectListItem()
            {
                Text     = "",
                Value    = "",
                Disabled = false
            };

            selectListItems.Insert(0, selectListItem1);
            this.ViewData["AddressTypes"] = selectListItems;
            List <SelectListItem> selectListItems1 = new List <SelectListItem>();

            using (HttpClient httpClient = new HttpClient())
            {
                string str1 = this.Url.RouteUrl("DefaultApiWithAction", new { httproute = "", controller = "Generic", action = "GetCountriesAsSelectListItems", countryId = 0, selectedCountryId = createOrUpdateAddressModalViewModel.Address.CountryId }, this.Request.Url.Scheme);
                using (HttpResponseMessage async = await httpClient.GetAsync(str1))
                {
                    if (async.IsSuccessStatusCode)
                    {
                        string str2 = await async.Content.ReadAsStringAsync();

                        selectListItems1 = JsonConvert.DeserializeObject <List <SelectListItem> >(str2);
                    }
                }
            }
            List <SelectListItem> selectListItems2 = selectListItems1;
            SelectListItem        selectListItem2  = new SelectListItem()
            {
                Text     = "",
                Value    = "",
                Disabled = false
            };

            selectListItems2.Insert(0, selectListItem2);
            this.ViewData["Countries"] = selectListItems1.AsEnumerable <SelectListItem>();
            string             str3         = this.L("KeyName_CustomersRole");
            IRepository <Role> repository   = this._roleRepository;
            List <Role>        allListAsync = await repository.GetAllListAsync((Role m) => m.TenantId == (int?)((this.AbpSession.ImpersonatorTenantId.HasValue ? this.AbpSession.ImpersonatorTenantId.Value : this.AbpSession.TenantId.Value)) && m.DisplayName == str3);

            List <Role> roles = allListAsync;
            bool        count = roles.Count == 1;

            if (count)
            {
                UserManager userManager = this._userManager;
                if (this.AbpSession.ImpersonatorUserId.HasValue)
                {
                    impersonatorUserId = this.AbpSession.ImpersonatorUserId;
                    value = impersonatorUserId.Value;
                }
                else
                {
                    impersonatorUserId = this.AbpSession.UserId;
                    value = impersonatorUserId.Value;
                }
                bool flag = await userManager.IsInRoleAsync(value, roles[0].Name);

                count = flag;
            }
            if (count)
            {
                ((dynamic)this.ViewBag).IsCustomer = true;
            }
            return(this.PartialView("_CreateOrUpdateAddressModal", createOrUpdateAddressModalViewModel));
        }
Ejemplo n.º 18
0
 public PaymentsController(ICustomerAppService customerAppService, IGenericAppService genericAppService, ITitleAppService titleAppService)
 {
     this._customerAppService = customerAppService;
     this._genericAppService  = genericAppService;
     this._titleAppService    = titleAppService;
 }