public JsonResult JsonMobileGetMenuItem(string username) { IEnumerable <ListModel> items = null; string Msg = null; bool IsSuccess = false; using (tsmc14BDataContext db = new tsmc14BDataContext()) { try { var temp = from row in db.MobileLogin where row.login_name == username select row; if (temp.Any()) { items = ListModel.GetDepartmentTitleList(); if (items.Count() > 0) { IsSuccess = true; } } else { IsSuccess = false; } } catch (Exception ex) { IsSuccess = false; Msg = ex.Message; } } return(this.Json(new { IsSuccess = IsSuccess, Msg = Msg, data = items }, JsonRequestBehavior.AllowGet)); }