public UIViewModel() { customersList = new List <Customer>(); CreateCustomers = new CreateCustomers(); InitializeCommands(); }
public OperationResult Create(CreateCustomers command) { var operation = new OperationResult(); var picturePath = $"Customers"; var fileName = _fileUploader.Upload(command.CustomerLogo, picturePath); var customer = new Customers(command.CustomerName, fileName, command.LogoAlt, command.LogoTitle); _customersRepository.Create(customer); _customersRepository.SaveChanges(); return(operation.Succedded()); }
public JsonResult OnPostCreate(CreateCustomers command) { var result = _customersApplication.Create(command); return(new JsonResult(result)); }
public IActionResult OnGetCreate() { var command = new CreateCustomers(); return(Partial("./Create", command)); }