public async Task <IActionResult> CreateInventoryItem(InventoryItemsCreatViewModel model)
        {
            if (ModelState.IsValid)
            {
                if (await _repository.InventoryItemExistsAsync(model.InventoryItem.Name))
                {
                    ModelState.AddModelError("Item Exists", _stringLocalizer["An item with that name exists in Inventory"].ToString());
                }
                else
                {
                    model.InventoryItem.LastModifiedByName = User.Identity.Name;
                    int result = await _repository.AddInventoryItemAsync(model.InventoryItem);

                    if (result < 1)
                    {
                        TempData["InventoryItemsMessage"] = _stringLocalizer["Nothing added"].ToString();
                    }
                    else
                    {
                        TempData["InventoryItemsMessage"] = _stringLocalizer["New item added to Inventory"].ToString();
                    }
                    return(RedirectToAction(nameof(Index)));
                }
            }
            model.MeasurmentUnits = await _repository.GetAllMeasurmentUnitsAsync();

            model.Suppliers = await _repository.GetSuppliersAsync(SelectionOptions.Active, SelectionOptions.All);

            ViewBag.Title = _stringLocalizer["Create Inventory Item"].ToString();
            return(View(model));
        }