Exemple #1
0
        public ActionResult UpdateCountry(HttpPostedFileBase uploadIcon, HttpPostedFileBase uploadImage, CountryViewModel model)
        {
            try
            {
                if (uploadImage != null)
                {
                    model.Image = savefile(uploadImage, model.Name + "_image");
                }
                if (uploadIcon != null)
                {
                    model.Icon = savefile(uploadIcon, model.Name + "_icon");
                }
                bool result = model.Update();
                if (result)
                {
                    return RedirectToAction("countries");
                }
            }
            catch (Exception)
            {
            }

            return View(model);
        }