コード例 #1
0
 public ActionResult EditMenuMain(MenuMain post)
 {
     try
     {
         Init("cabinet_menu");
         if (id == "")
         {
             return(RedirectToAction("MenuMain", "Cabinet"));
         }
         MenuMain menumain = new MenuMain(this.shared);
         if (id == "Add")
         {
             menumain.SetDefaults();
             menumain.Copy(post);
             menumain.Insert();
         }
         else
         {
             menumain.Select(id);
             if (shared.error.AnyError())
             {
                 return(RedirectToAction("MenuMain", "Cabinet"));
             }
             menumain.Copy(post);
             menumain.Update();
         }
         return(RedirectToAction("MenuMain", "Cabinet"));
     }
     catch (Exception ex)
     {
         return(ShowError(ex));
     }
 }