Beispiel #1
0
        public async Task <ActionResult> AddBrand(BrandModel brandModel)
        {
            if (brandModel != null)
            {
                try
                {
                    await _modelManager.AddBrand(brandModel);

                    TempData["message"] = "Brand Added!!!";
                    return(RedirectToAction("AddBrand"));
                }
                catch (BrandNameAlreadyPresent e)
                {
                    TempData["message"] = e.Message;
                    return(View("AddBrand"));
                }
            }
            else
            {
                return(View("Null"));
            }
        }