Exemplo n.º 1
0
        /// <summary>
        /// 菜单导航
        /// </summary>
        protected void GetAllMenus()
        {
            YogaMenusServiceClient menusclient = new YogaMenusServiceClient();
            List <ViewYogaMenus>   menus       = menusclient.GetMenusList();

            ViewBag.Menus = menus;
        }
Exemplo n.º 2
0
        //
        // GET: /Manage/Menus/Delete/5

        public ActionResult Delete(int id)
        {
            using (YogaMenusServiceClient client = new YogaMenusServiceClient())
            {
                client.DelByid(id);
            }
            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
        //
        // GET: /Manage/Menus/Edit/5

        public ActionResult Edit(int id)
        {
            ViewYogaMenus menu = new ViewYogaMenus();

            using (YogaMenusServiceClient client = new YogaMenusServiceClient())
            {
                menu = client.GetMenusByid(id);
            }
            return(View(menu));
        }
Exemplo n.º 4
0
        //
        // GET: /Manage/Menus/

        public ActionResult Index(int page = 1)
        {
            List <ViewYogaMenus> list = new List <ViewYogaMenus>();
            int count = 0;

            using (YogaMenusServiceClient client = new YogaMenusServiceClient())
            {
                list = client.GetMenusList(page, 10, out count);
            }
            PagedList <ViewYogaMenus> pagelist = new PagedList <ViewYogaMenus>(list, page, 10, count);

            return(View(pagelist));
        }
Exemplo n.º 5
0
 public ActionResult Create(ViewYogaMenus model)
 {
     try
     {
         // TODO: Add insert logic here
         using (YogaMenusServiceClient client = new YogaMenusServiceClient())
         {
             client.Add(model);
         }
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 6
0
 public ActionResult Edit(int id, ViewYogaMenus menus)
 {
     try
     {
         // TODO: Add update logic here
         ViewYogaMenus menu = new ViewYogaMenus();
         using (YogaMenusServiceClient client = new YogaMenusServiceClient())
         {
             menu      = client.GetMenusByid(id);
             menu.name = menus.name;
             client.Update(menu);
         }
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }