public ActionResult Create(ApplicationInformationVM viewModel) { try { var UserProfile = (UserProfileSessionData)this.Session["UserProfile"]; if (UserProfile != null) { if (ModelState.IsValid) { tbl_ApplicationInformation item = new tbl_ApplicationInformation() { Platform = viewModel.Platform.Trim(), GroupName = viewModel.GroupName.Trim(), AppName = viewModel.AppName.Trim(), ShortName = viewModel.ShortName.Trim(), Author = viewModel.Author, Price = viewModel.Price, Point = viewModel.Price, NetUsage = viewModel.NetUsage, InsertDate = DateTime.Now, InsertUser = UserProfile.UserId }; CRUDOperation dataOperations = new CRUDOperation(); tbl_ApplicationInformation dbItem = dataOperations.AddApplicationInformation(item); if (dbItem != null) { TempData["success"] = "Ok"; TempData["message"] = "Məlumatlar uğurla əlavə olundu"; return(RedirectToAction("Index")); } else { TempData["success"] = "notOk"; TempData["message"] = "Məlumatlar əlavə olunarkən xəta baş verdi"; return(RedirectToAction("Index")); } } } throw new ApplicationException("Invalid model"); } catch (ApplicationException ex) { viewModel = poulateDropDownList(viewModel); return(View(viewModel)); } }