public ActionResult UpdateHienThi1(string mID, string sHIEULUC) { int smID = int.Parse(mID); wMenu1 mn = db.wMenu1.SingleOrDefault(r => r.mID == smID); if (mn != null) { mn.Effect = sHIEULUC == "true" ? true : false; } db.SaveChanges(); return(Json("1", JsonRequestBehavior.AllowGet)); }
public ActionResult Update_Name_Menu1(string mID, string sNAME) { int smID = int.Parse(mID); wMenu1 mn = db.wMenu1.SingleOrDefault(r => r.mID == smID); if (mn != null) { mn.Name = sNAME; } db.SaveChanges(); return(Json("1", JsonRequestBehavior.AllowGet)); }
public ActionResult UpdateSTT_Menu1(string mID, string sSTT) { int smID = int.Parse(mID); int stt = int.Parse(sSTT); wMenu1 mn = db.wMenu1.SingleOrDefault(r => r.mID == smID); if (mn != null) { mn.STT = stt; } db.SaveChanges(); return(Json("1", JsonRequestBehavior.AllowGet)); }
public ActionResult INSERT_MENU1(string sNAME) { wMenu1 m1 = new wMenu1(); int mID = db.wMenu1.Select(x => x.mID).DefaultIfEmpty(0).Max() + 1; int? stt = db.wMenu1.Select(x => x.STT).DefaultIfEmpty(0).Max() + 1; m1.mID = mID; m1.Name = sNAME; m1.Effect = true; m1.STT = stt; db.wMenu1.Add(m1); db.SaveChanges(); return(Json("1", JsonRequestBehavior.AllowGet)); }