- multiformity_data.zip
- RASP.LDF
- RASP.MDF
- multiformity_images.zip
- images
- 1.gif
- 10.gif
- 10sm.gif
- 1sm.gif
- 2.gif
- 2sm.gif
- 3.gif
- 3sm.gif
- 4.gif
- 4sm.gif
- 5.gif
- 5sm.gif
- 6.gif
- 6sm.gif
- 7.gif
- 7sm.gif
- 8.gif
- 8sm.gif
- 9.gif
- 9sm.gif
- address.gif
- ascending.gif
- calendar.gif
- cancel.gif
- cb_checked.gif
- cb_other.gif
- cb_unchecked.gif
- delete.gif
- descending.gif
- edit.gif
- elipse.gif
- filter.gif
- google.gif
- help.gif
- junk.PSD
- loggedin.gif
- loggedout.gif
- maintab.gif
- minus.gif
- new.gif
- notes.gif
- options.gif
- plus.gif
- rib.gif
- save.gif
- saveandadd.gif
- SupportNet.gif
- tools.gif
- treeview.gif
- users.gif
- multiformity_src.zip
- rasp
- RaspDocs
- intro.doc
- Multiformity.chm
- Process Automation.rtf
- processOverview.bmp
- processOverviewjpg.jpg
- Rasp Overview.rtf
- Rasp todos.doc
|
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SqlClient;
namespace rasp.SQL.DBInfo
{
/// <summary>
/// Summary description for TabInfoCollection.
/// </summary>
public class TabInfoCollection :IEnumerator, IEnumerable {
private ArrayList _Data = new ArrayList();
private string _Table = "";
private int _Position = -1;
public int Count {
get { return _Data.Count; }
}
public TabInfoCollection(TabInfoCollection tabs) {
foreach(TabInfo ti in tabs) {
this._Data.Add(ti);
}
}
public TabInfoCollection(TableInfo tableinfo) {
//TODO: Fix this up, it seems like really screwey logic, I mean, if there is a DBNull for the _Tabs_IDs or if it is -1 then we need a new TabInfo with the main tab
// SELECT DISTINCT _TABS_ID fROM _FIELDS WHERE (_TABLES_ID = 65)
string select = "select distinct _Tabs_ID from _Fields where _Tables_ID = " + tableinfo.ID;
DataSet ds = SQLUtilities.SelectData(select);
string ids = "";
if(ds.Tables[0].Rows.Count == 0) {
this._Data.Add(new TabInfo(1));
} else {
foreach(DataRow dr in ds.Tables[0].Rows) {
try {
string id = ((int)dr["_Tabs_ID"]).ToString();
ids += id + ",";
} catch {}
}
try {
ids = ids.Substring(0, ids.Length-1);
} catch {
ids = "-1";
}
if (!ids.Equals("-1")) {
// SELECT * FROM _TABS WHERE ID IN (1, 2, 3) ORDER BY _Tabs.DisplayOrder
select = "select * from _Tabs where id in (" + ids + ") order by _Tabs.DisplayOrder";
ds = SQLUtilities.SelectData(select);
foreach(DataRow dr in ds.Tables[0].Rows) {
this._Data.Add(new TabInfo(dr));
}
} else {
this._Data.Add(new TabInfo(1));
}
}
}
#region Enumerator methods
/// <summary>
/// Implentation of the GetEnumerator method for the IEnumerable interface.
/// </summary>
/// <returns></returns>
public IEnumerator GetEnumerator() {
return (TabInfoCollection)MemberwiseClone();
}
/// <summary>
/// Returns the "current" FieldInfo object.
/// </summary>
public object Current {
get {
try {
TabInfo ti = (TabInfo)_Data[_Position];
return ti;
} catch {
throw new Exception("There is not a tab at the position at " + _Position);
}
}
}
/// <summary>
/// Resets the collections enumerator.
/// </summary>
public void Reset() {
_Position = -1;
}
/// <summary>
/// Moves to the next position in the collection.
/// </summary>
/// <returns>A boolean valud indicating if we have moved past the bounds of the collection.</returns>
public bool MoveNext() {
bool ret = false;
if(_Position + 1 < _Data.Count) {
ret = true;
++_Position;
}
return ret;
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.