public async Task Save() { try { await unitOfWork.ItemsRepository.SaveItems(SelectedObject); GridCollection.Insert(0, SelectedObject); MessageBoxService.Show("Category record saved"); } catch (Exception ex) { MessageBoxService.Show(ex.InnerException.Message); } finally { SelectedObject = new Item() { }; } }
public async Task Save() { try { await client.AddCategoryAsync(new CategoryModel { Name = SelectedObject.Name, Description = SelectedObject.Description }); GridCollection.Insert(0, SelectedObject); MessageBoxService.Show("Category record saved"); } catch (Exception ex) { MessageBoxService.Show(ex.InnerException.Message); } finally { SelectedObject = new ItemCategory() { }; } }
public async Task Save() { try { await unitOfWork.UOMRepository.Insert(SelectedObject); await unitOfWork.SaveAsync(); GridCollection.Insert(0, SelectedObject); MessageBoxService.Show("Category record saved"); } catch (Exception ex) { MessageBoxService.Show(ex.InnerException.Message); } finally { SelectedObject = new UnitOfMeasurement() { }; } }
public async Task Save() { try { await unitOfWork.InventoryRepository.Insert(SelectedObject); await unitOfWork.SaveAsync(); GridCollection.Insert(0, SelectedObject); MessageBoxService.Show("Category record saved"); } catch (Exception ex) { MessageBoxService.Show(ex.Message); } finally { SelectedObject = new ItemInventory() { InventoryId = new Guid(), ItemId = ItemsData.FirstOrDefault().ItemId, CostCenterId = SalesOutletData.FirstOrDefault().SalesOutletId, Reference = "Opening stock", OtherDetails = "Remarks" }; } }
public async Task Save() { try { await unitOfWork.InventoryRepository.AdjustInventory(SelectedObject); await unitOfWork.SaveAsync(); GridCollection.Insert(0, SelectedObject); MessageBoxService.Show("Inventory updated successfully."); } catch (Exception ex) { MessageBoxService.Show(ex.InnerException.Message); } finally { SelectedObject = new InventoryAdjustment() { ID = new Guid(), ItemId = ItemsData.FirstOrDefault().ItemId, CostCenterId = SalesOutletData.FirstOrDefault().SalesOutletId }; } }