public virtual Object Get() { string sql = RootLibrary.GetScriptGet(this); DataTable dtTable = Provider.ExecuteToDataTable(sql); if (dtTable.Rows.Count > 0) { return(RootLibrary.GetObjectValue(dtTable.Rows[0], this)); } return(null); }
public static WebPage GetByPage(string page) { string sql = @"select * from QLCV_WebPage where Page='" + page + "' and Type='" + NumCode.UPWEB + "'"; DataTable dtTable = ServerProvider.ExecuteToDataTable(sql); if (dtTable.Rows.Count > 0) { WebPage cus = new WebPage(); return((WebPage)RootLibrary.GetObjectValue(dtTable.Rows[0], cus)); } return(null); }
public static WebPage Get(long ID) { string sql = @"select * from QLCV_WebPage where ID=" + ID; DataTable dtTable = ServerProvider.ExecuteToDataTable(sql); if (dtTable.Rows.Count > 0) { WebPage cus = new WebPage(); return((WebPage)RootLibrary.GetObjectValue(dtTable.Rows[0], cus)); } return(null); }
public virtual Object[] GetAll() { string sql = RootLibrary.GetScriptGetAll(this); DataTable dtTable = Provider.ExecuteToDataTable(sql); Object[] objects = new Object[dtTable.Rows.Count]; for (int i = 0; i < dtTable.Rows.Count; i++) { objects[i] = RootLibrary.GetObjectValue(dtTable.Rows[i], this); } return(objects); }
public virtual Object[] GetByField(String Field, Object Value) { String[] Fields = new String[1]; Fields[0] = Field; Object[] Values = new Object[1]; Values[0] = Value; string sql = RootLibrary.GetScriptGetByField(this, Fields, Values); DataTable dtTable = Provider.ExecuteToDataTable(sql); Object[] objects = new Object[dtTable.Rows.Count]; for (int i = 0; i < dtTable.Rows.Count; i++) { objects[i] = RootLibrary.GetObjectValue(dtTable.Rows[i], this); } return(objects); }