/// <summary> /// Ajax form: Create Group Menu /// </summary> /// <param name="SysMenuID"></param> /// <param name="SysGroupID"></param> /// <returns></returns> public JsonResult CreateGroupMenu(string SysMenuID, string SysGroupID) { string result; string Count = "0"; try { SysGroupMenu_RelModels objGroupMenu = new SysGroupMenu_RelModels(); DataSet ds = new DataSet(); int MenuID = string.IsNullOrEmpty(SysMenuID) ? 0 : Int32.Parse(SysMenuID.ToString()); int GroupID = string.IsNullOrEmpty(SysGroupID) ? 0 : Int32.Parse(SysGroupID.ToString()); int UserID = Session[CConfig.SESSION_USERID].ToString() == "" ? 1 : Convert.ToInt32(Session[CConfig.SESSION_USERID]); objGroupMenu.SysMenuID = MenuID; objGroupMenu.SysGroupID = GroupID; objGroupMenu.UserID = UserID; ds = data.CreateGroupMenuRel(objGroupMenu); if (ds.Tables[1].Rows.Count > 0) { Count = ds.Tables[1].Rows[0][0].ToString(); var row = ds.Tables[1].Rows[0]; List <SysGroupMenu_RelModels> list = new List <SysGroupMenu_RelModels>(); list.Add(new SysGroupMenu_RelModels { ID = Convert.ToInt32(row["ID"].ToString().Trim()), SysGroupID = Convert.ToInt32(row["SysGroupID"].ToString().Trim()), Name = row["Name"].ToString().Trim(), Level = Convert.ToInt32(row["Level"].ToString().Trim()) }); ViewData["ListGroupMenu"] = list;// ds.Tables[1]; } result = ds.Tables[0].Rows[0][0].ToString(); } catch (Exception ex) { result = "Error: Không thêm được menu vào group"; Count = null; CLog.LogError(CBase.GetDeepCaller(), CBase.GetDetailError(ex)); } return(Json(new { mess = result, Count = Count, data = ViewData["ListGroupMenu"] == null ? null : ViewData["ListGroupMenu"] }, JsonRequestBehavior.AllowGet)); }