Example #1
0
        public ActionResult EditMenu(MenuViewModel model)
        {
            MenuDAL dal = new MenuDAL();
            var     db  = model.CastDB(model);

            dal.Update(db);
            dal.AcceptAllChange();
            return(Content("Success"));
        }
Example #2
0
        public ActionResult AddMenu(MenuViewModel model)
        {
            MenuDAL dal = new MenuDAL();

            model.ID = Guid.NewGuid().ToString();
            var db = model.CastDB(model);

            dal.Add(db);
            dal.AcceptAllChange();
            return(ToJsonResult("Success"));
        }