コード例 #1
0
        public ActionResult Create(MainMenu mainMenu)
        {
            if (ModelState.IsValid)
            {
                if (string.IsNullOrEmpty(mainMenu.MainMenuText))
                {
                    ModelState.AddModelError("Error", "Enter Menu Text First");
                    return(View(mainMenu));
                }

                int result = IObjMainMenu.InsertMainMenu(mainMenu);


                if (result > 0)
                {
                    TempData["Message"] = "Record Successfully Saved";
                }
                else
                {
                    TempData["Message"] = "Record Does'nt Saved";
                }
            }
            else
            {
                ModelState.AddModelError("Error", "Please Enter All Details");
            }
            return(View("Create", mainMenu));
        }