Exemplo n.º 1
0
 public async Task <ActionResult <List <WarehouseViewModel> > > Put([FromBody] WarehouseAddOrUpdateModel model)
 {
     if (model.Id == 0)
     {
         return(BadRequest("id is missing"));
     }
     return(Ok(await _warehouseService.Edit(model)));
 }
Exemplo n.º 2
0
        public async Task <Response> Edit(WarehouseAddOrUpdateModel model)
        {
            var exiting = await _wareHouseRepository.GetByIdAsync(model.Id);

            _mapper.Map(model, exiting);
            await _wareHouseRepository.UpdateAsync(exiting);

            return(Response.Success());
        }
Exemplo n.º 3
0
        public async Task <Response> Add(WarehouseAddOrUpdateModel model)
        {
            await _wareHouseRepository.AddAsync(_mapper.Map <WareHouse.Core.Entities.Warehouse>(model));

            return(Response.Success());
        }
Exemplo n.º 4
0
 public async Task <ActionResult <Response> > Post([FromBody] WarehouseAddOrUpdateModel model)
 {
     return(Ok(await _warehouseService.Add(model)));
 }