public virtual DataTable GetByFieldToTable(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); return(Provider.ExecuteToDataTable(sql)); }
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 virtual long Insert() { string sql = RootLibrary.GetScriptInsert(this); Provider.ExecuteNonQuery(sql); if (RootLibrary.IsIdentity(this)) { return(long.Parse(Provider.ExecuteScalar("Select @@IDENTITY").ToString())); } return(-1); }
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); }
public virtual void Update() { string sql = RootLibrary.GetScriptUpdate(this); Provider.ExecuteNonQuery(sql); }
public virtual DataTable GetAllToTable() { string sql = RootLibrary.GetScriptGetAll(this); return(Provider.ExecuteToDataTable(sql)); }