Exemplo n.º 1
0
        public async Task <ActionResult> EditCustomerModal(int customerId)
        {
            var customer = await _customerAppService.Get(new EntityDto <int>(customerId));

            //CreateUpdateCustomerDto cuCustomer = AutoMapper.Mapper.Map<CreateUpdateCustomerDto>(customer);
            var model = new EditCustomerModalViewModel
            {
                Customer = customer
            };

            return(View("_EditCustomerModal", model));
        }
        public async Task <ActionResult> EditCustomerModal(int customerId)
        {
            var output = await _customerService.GetCustomerForEdit(new EntityDto(customerId));

            var salesmans  = (await _salesmanService.GetSalesman()).Items;
            var retailenvs = (await _retailEnvService.GetRetailEnvironment()).Items;
            var model      = new EditCustomerModalViewModel
            {
                CustomerEdit           = output,
                Salesmen               = salesmans,
                RetailEnvironmentLists = retailenvs
            };

            return(View("_EditCustomerModal", model));
        }