public void TestMethod1() { ClassDal cd = new ClassDal(); IQueryable <Class> c = cd.GetEntities(u => u.C_Id > 0); Assert.AreEqual(true, c.Count() > 0); Assert.AreEqual(true, true); }
public void getThirdClassBySecondId(int secondId) { string str = secondId.ToString(); int n; if (int.TryParse(str, out n)) { //为数字 List <THIRDCLASS> lst = ClassDal.getThirdClassByFirstId(secondId); Response.Write("{\"success\":true,\"data\":" + JsonHelper.ObjectToJson(lst) + "}"); } else { Response.Write("{\"success\":false,\"error\":\"参数错误!\"}"); } }
public ActionResult GetAllClassByPro() { ClassDal clad = new ClassDal(); string pro = Request["pro"]; IQueryable <Class> iq = clad.GetEntities(u => u.Profession.Pro_Name == pro); string str = ""; foreach (var item in iq) { str = str + item.C_Name + "-"; } // string str1 = js.Serialize(iq); Response.Write(str); Response.End(); return(View()); }
public void getAllFirstClass() { List <FIRSTCLASS> lst = ClassDal.getAllFirstClass(); Response.Write("{\"success\":true,\"data\":" + JsonHelper.ObjectToJson(lst) + "}"); }