public void QueryTest2() { DBObject dbObj = new DBObject() { DataBaseType = DBObject.DataBase.Oracle, ID = "CGHLABM", Password = "******", Node = "LNKA1" }; DAOFactory target = new DAOFactory(dbObj); var daoobject = target.GetDataAccessObjectFactory(); RPRSPDB rprspdb = new RPRSPDB() { CHTNO = "1234", SEX = "M" }; var queryResult = daoobject.Query(rprspdb); bool result = false; if (queryResult.ReturnDataTable.Rows.Count > 0) { result = true; } Assert.AreEqual(false, result); }
public void ExpressionQueryTest() { DBObject dbObj = new DBObject() { DataBaseType = DBObject.DataBase.Oracle, ID = "CGHLABM", Password = "******", Node = "LNKA1" }; DAOFactory target = new DAOFactory(dbObj); var daoobject = target.GetDataAccessObjectFactory(); var CHTNO = "123"; var pdb = new RPRSPDB() { CHTNO = "123" }; //var result = daoobject.Query<RPRSPDB>((x) => x.CHTNO == CHTNO); //var result = daoobject.Query<RPRSPDB>((x) => x.CHTNO.StartsWith("; insert into rlabsyslog(exeemp,exedat,exetm,jobty) values('Test','20150820','0524','TEST');")); //var result = daoobject.Query<RPRSPDB>((x) => x.IDNO == "123" && x.ONWMK == null); //var result = daoobject.Query<RPRSPDB>((x) => x.CHTNO.EndsWith( pdb.CHTNO)); var result = daoobject.Query <RPRSPDB>(x => x.CHTNO == "123").DataList as List <RPRSPDB>; var rprspdbChtnoList = (from a in result select a.CHTNO).ToList <string>(); var lisResult = daoobject.Query <RPRSPDB>(x => rprspdbChtnoList.Contains(x.CHTNO)); var startRCVDAT = "20140101"; var endRCVDAT = "20151031"; //var result = // daoobject.Query<RLABINDX>( // x => // x.CHTNO == CHTNO && // (x.RCVDAT.CompareTo(startRCVDAT) >= 0 && x.RCVDAT.CompareTo(endRCVDAT) <= 0)); //var t = (List<RPRSPDB>)result.DataList; //foreach (RPRSPDB item in result.DataList) //{ //} //Assert.Fail(); }
public void ExpressionQueryPropertiesTest() { DBObject dbObj = new DBObject() { DataBaseType = DBObject.DataBase.Oracle, ID = "CGHLABM", Password = "******", Node = "LNKA1" }; DAOFactory target = new DAOFactory(dbObj); var daoobject = target.GetDataAccessObjectFactory(); var CHTNO = "123"; var pdb = new RPRSPDB() { CHTNO = "123" }; var result = daoobject.Query <RPRSPDB>((x) => x.CHTNO.EndsWith(pdb.CHTNO)); Assert.Fail(); }
public void ExpressionQueryInCauseTest() { DBObject dbObj = new DBObject() { DataBaseType = DBObject.DataBase.Oracle, ID = "CGHLABM", Password = "******", Node = "LNKA1" }; DAOFactory target = new DAOFactory(dbObj); var daoobject = target.GetDataAccessObjectFactory(); var CHTNO = "123"; var pdb = new RPRSPDB() { CHTNO = "123" }; var result = daoobject.Query <RPRSPDB>(x => x.CHTNO == "123" || x.CHTNO == "500" || x.CHTNO == "88888888").DataList as List <RPRSPDB>; var rprspdbChtnoList = (from a in result select a.CHTNO).ToList <string>(); var lisResult = daoobject.Query <RLABINDX>(x => rprspdbChtnoList.Contains(x.CHTNO)); Assert.Fail(); }