示例#1
0
 static void ListCustomer(CompanyCustomerModel customer)
 {
     Console.WriteLine($"Id: {customer.Id}");
     Console.WriteLine($"CompanyId: {customer.CompanyId}");
     Console.WriteLine($"CustomerName: {customer.CustomerName}");
     Console.WriteLine($"CustomerValue: {customer.CustomerValue}");
     Console.WriteLine("");
 }
        public virtual async Task <IActionResult> CustomerUpdate(CompanyCustomerModel model)
        {
            if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageCategories))
            {
                return(AccessDeniedView());
            }

            //try to get a product Company with the specified id
            var companyCustomer = await _companyService.GetCompanyCustomersByIdAsync(model.Id)
                                  ?? throw new ArgumentException("No product Company mapping found with the specified id");

            //fill entity from product
            companyCustomer = model.ToEntity(companyCustomer);
            await _companyService.UpdateCompanyCustomerAsync(companyCustomer);

            return(new NullJsonResult());
        }