Exemplo n.º 1
0
 public JsonResult del(Cs_Menu_item menuItem)
 {
     db = new DataContext();
     menuItem.Enable          = false;
     db.Entry(menuItem).State = System.Data.Entity.EntityState.Modified;
     db.SaveChanges();
     return(Json(menuItem));
 }
Exemplo n.º 2
0
        public JsonResult getDetails(int Id)
        {
            db = new DataContext();
            Cs_Menu_item menu = new Cs_Menu_item();

            menu = db.Cs_Menu_item.Find(Id);
            return(Json(menu, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
 public ActionResult Edit(Cs_Menu_item menu)
 {
     menu.Item_Type       = "DV".ToString();
     menu.Language        = Request.Form["Language"];
     menu.Meta_Desc       = Request.Form["MetaDesc"];
     menu.Meta_Key        = Request.Form["MetaKey"];
     menu.Item_Content    = Request.Unvalidated["Item_Content"];
     db.Entry(menu).State = EntityState.Modified;
     db.SaveChanges();
     return(Redirect("Index"));
 }
Exemplo n.º 4
0
        public JsonResult Edit(Cs_Menu_item csitem)
        {
            //String Rs = "";
            //    if (csitem.Item_Id> 0)
            //    {

            //        db.Entry(csitem);
            //        db.SaveChanges();
            //    }
            //return Json(Rs);

            db.Entry(csitem).State = EntityState.Modified;

            db.SaveChanges();
            return(Json(csitem));
        }
Exemplo n.º 5
0
        public JsonResult addNewProduct(Cs_Menu_item Obj)
        {
            Cs_Menu_item newObj = new Cs_Menu_item();
            int          id     = new App_Auto_NumberController().GenID("Cs_Menu_item.Item_Id");

            newObj.Item_Id      = id;
            newObj.Item_Name    = Obj.Item_Name;
            newObj.Enable       = true;
            newObj.Item_Type    = "SP";
            newObj.Meta_Desc    = Obj.Meta_Desc;
            newObj.Meta_Key     = Obj.Meta_Key;
            newObj.Language     = Obj.Language;
            newObj.Item_Content = Obj.Item_Content;
            db.Cs_Menu_item.Add(newObj);
            db.SaveChanges();
            return(Json(newObj));
        }
Exemplo n.º 6
0
        public ActionResult Create(Cs_Menu_item Obj)
        {
            Cs_Menu_item newObj = new Cs_Menu_item();
            int          id     = new App_Auto_NumberController().GenID("Cs_Menu_item.Item_Id");

            newObj.Item_Id      = id;
            newObj.Item_Name    = Obj.Item_Name;
            newObj.Enable       = true;
            newObj.Item_Type    = Request.Form["Type"];
            newObj.Language     = Request.Form["Language"];
            newObj.Meta_Desc    = Request.Form["MetaDesc"];
            newObj.Meta_Key     = Request.Form["MetaKey"];
            newObj.Item_Content = Request.Unvalidated["Item_Content"];
            db.Cs_Menu_item.Add(newObj);
            db.SaveChanges();
            return(View(newObj));
        }
Exemplo n.º 7
0
        public JsonResult update(Cs_Menu_item Menu)
        {
            string str = "";

            try
            {
                db = new DataContext();
                db.Entry(Menu).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
                str = "success";
                return(Json(str));
            }
            catch (Exception e)
            {
                str = "error " + e;
                return(Json(str));
            }
        }