本文整理汇总了C#中IDBManager.ExecuteReader方法的典型用法代码示例。如果您正苦于以下问题:C# IDBManager.ExecuteReader方法的具体用法?C# IDBManager.ExecuteReader怎么用?C# IDBManager.ExecuteReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDBManager
的用法示例。
在下文中一共展示了IDBManager.ExecuteReader方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FetchCRDPowerList
private void FetchCRDPowerList(int id, IDBManager dbmgr)
{
string qryString = "SELECT * FROM viewCRDPOWERCAB cc WHERE cc.CABLE_ID = @cable_id ORDER BY cc.POWER, cc.BKRFUSE";
PSLoad item = new PSLoad();
ArrayList list = new ArrayList();
try
{
PropertyInfo[] p = item.GetType().GetProperties();
dbmgr.Open();
dbmgr.CreateParameters(1);
dbmgr.AddParameters(0, "@cable_id", id);
dbmgr.ExecuteReader(CommandType.Text, qryString);
while (dbmgr.DataReader.Read())
{
item = new PSLoad();
item = (PSLoad)FetchObject(item, p, dbmgr);
list.Add(item);
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
dbmgr.Dispose();
}
_cable.crdpowerlist = list;
}
示例2: FetchFireArea
private void FetchFireArea(int id, IDBManager dbmgr)
{
string qryLocal = "SELECT * FROM viewFALIST WHERE [email protected] ORDER BY FA";
dbmgr.CreateParameters(1);
dbmgr.AddParameters(0, "@id", id);
dbmgr.ExecuteReader(CommandType.Text, qryLocal);
if (dbmgr.DataReader.Read())
{
PropertyInfo[] p = _firearea.GetType().GetProperties();
_firearea = (FireArea)FetchObject(_firearea, p, dbmgr);
}
dbmgr.CloseReader();
}
示例3: FetchProtectionList
private void FetchProtectionList(int id, IDBManager dbmgr)
{
string qryString = "SELECT * FROM viewFZPROTECTION WHERE FA_ID = @fa_id ORDER BY FZ, SYS_CATEGORY, SYS_NAME";
FZProtection item = new FZProtection();
ArrayList list = new ArrayList();
PropertyInfo[] p = item.GetType().GetProperties();
dbmgr.CreateParameters(1);
dbmgr.AddParameters(0, "@fa_id", id);
dbmgr.ExecuteReader(CommandType.Text, qryString);
while (dbmgr.DataReader.Read())
{
item = new FZProtection();
item = (FZProtection)FetchObject(item, p, dbmgr);
list.Add(item);
}
dbmgr.CloseReader();
_firearea.protectionlist = list;
}
示例4: FetchComboList
public ArrayList FetchComboList(string initMsg, string param)
{
string qryString = "SELECT DISTINCT CABLE_ID, CABLE FROM viewFADATA_SSD WHERE FA_ID = @fa_id AND COMP_ID = @comp_id ORDER BY CABLE";
ArrayList list = new ArrayList();
string[] strTemp = ((string)param).Split(new char[] { '|' });
int fa_id = Convert.ToInt32(strTemp[0]);
int comp_id = Convert.ToInt32(strTemp[1]);
_user = (User)System.Web.HttpContext.Current.Session[Constant.session.User];
_dbmgr = new DBManager(_user.plantDBStr);
_dbmgr.ConnectionString = _user.plantDBStr;
try
{
// initialize
if (initMsg.Length > 0)
list.Add(new ComboBoxItem(initMsg, "0"));
_dbmgr.Open();
_dbmgr.CreateParameters(2);
_dbmgr.AddParameters(0, "@fa_id", fa_id);
_dbmgr.AddParameters(1, "@comp_id", comp_id);
_dbmgr.ExecuteReader(CommandType.Text, qryString);
while (_dbmgr.DataReader.Read() == true)
{
if (_dbmgr.DataReader.GetInt32(0) != 0)
list.Add(new ComboBoxItem(_dbmgr.DataReader.GetString(1), _dbmgr.DataReader.GetInt32(0).ToString())); ;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
_dbmgr.Dispose();
}
return list;
}
示例5: FetchCascPowerList
private void FetchCascPowerList(string analysis, int fa_id, IDBManager dbmgr)
{
FACascHit item = new FACascHit(); // create new object type to be able to get property info
ArrayList list = new ArrayList(); // create new ArrayList to house objects
PropertyInfo[] p = item.GetType().GetProperties(); // get property info for item
dbmgr.CreateParameters(2); // create parameters
dbmgr.AddParameters(0, "@analysis", analysis); // fire area id
dbmgr.AddParameters(1, "@fa_id", fa_id);
dbmgr.ExecuteReader(CommandType.StoredProcedure, "dbo.FACASC_POWER_s"); // execute query
while (dbmgr.DataReader.Read())
{
item = new FACascHit(); // create new item
item = (FACascHit)FetchObject(item, p, dbmgr);
list.Add(item); // add item to the ArrayList
}
dbmgr.CloseReader();
_firearea.cascpowerlist = list; // update item list
}
示例6: FetchRoutelocaList
private void FetchRoutelocaList(int id, IDBManager dbmgr)
{
string qryString;
Routeloca item = new Routeloca();
ArrayList list = new ArrayList();
PropertyInfo[] p = item.GetType().GetProperties();
switch (_user.plant)
{
case "BLN":
case "TFAC":
qryString = "SELECT * FROM viewROUTELOCA_FR rl WHERE rl.NODE_ID = @node_id ORDER BY rl.RM, rl.FZ";
break;
default:
qryString = "SELECT * FROM viewROUTELOCA rl WHERE rl.NODE_ID = @node_id ORDER BY rl.RM, rl.FZ";
break;
}
dbmgr.CreateParameters(1);
dbmgr.AddParameters(0, "@node_id", id);
dbmgr.ExecuteReader(CommandType.Text, qryString);
while (dbmgr.DataReader.Read())
{
item = new Routeloca();
item = (Routeloca)FetchObject(item, p, dbmgr);
list.Add(item);
}
dbmgr.CloseReader();
_route.routelocalist = list;
}
示例7: FetchComponent
private void FetchComponent(int id, IDBManager dbmgr)
{
string qryLocal = "SELECT * FROM viewCOMPLIST WHERE [email protected]";
dbmgr.CreateParameters(1); // create required parameters
dbmgr.AddParameters(0, "@id", id);
dbmgr.ExecuteReader(CommandType.Text, qryLocal); // execute reader
if (dbmgr.DataReader.Read())
{
// get properties of object and fetch object
PropertyInfo[] p = _comp.GetType().GetProperties();
_comp = (Component)FetchObject(_comp, p, dbmgr);
}
dbmgr.CloseReader();
}
示例8: FetchRouteList
private void FetchRouteList(int id, IDBManager dbmgr)
{
string qryString = "SELECT DISTINCT RM_ID, RM, FZ_ID, FZ, NODE_ID, NODE FROM viewFRDATA WHERE NODE IS NOT NULL AND [email protected]_id " +
"UNION " +
"SELECT DISTINCT RM_ID, RM, FZ_ID, FZ, NODE_ID, NODE FROM viewROUTELOCA_FR WHERE NODE_ID IS NOT NULL AND [email protected]_id " +
"ORDER BY NODE";
FRoute item = new FRoute();
ArrayList list = new ArrayList();
PropertyInfo[] p = item.GetType().GetProperties(); // get property info for item
dbmgr.CreateParameters(1); // create required parameters
dbmgr.AddParameters(0, "@rm_id", id); // component id
dbmgr.ExecuteReader(CommandType.Text, qryString); // execute query
while (dbmgr.DataReader.Read())
{
item = new FRoute(); // create new item
item = (FRoute)FetchObject(item, p, dbmgr);
list.Add(item); // add item to ArrayList
}
dbmgr.CloseReader();
_fireroom.routelist = list; // update object item list
}
示例9: FetchFAList
private void FetchFAList(int id, IDBManager dbmgr)
{
string qryString = "SELECT * FROM viewFADOCS d WHERE d.DOC_ID = @doc_id ORDER BY d.FA";
FADoc item = new FADoc(); // create new object type to be able to get property info
ArrayList list = new ArrayList(); // create new ArrayList to house objects
PropertyInfo[] p = item.GetType().GetProperties(); // get property info for item
dbmgr.CreateParameters(1); // create parameters
dbmgr.AddParameters(0, "@doc_id", id); // document id
dbmgr.ExecuteReader(CommandType.Text, qryString); // execute query
while (dbmgr.DataReader.Read())
{
item = new FADoc(); // create new item
item = (FADoc)FetchObject(item, p, dbmgr);
list.Add(item); // add item to the ArrayList
}
dbmgr.CloseReader();
_document.falist = list; // update object item list
}
示例10: FetchComponentList
private void FetchComponentList(int id, IDBManager dbmgr)
{
string qryString = "SELECT DISTINCT RM_ID, RM, FZ_ID, FZ, COMP_ID, COMP, dbo.IN_FR(COMP_ID, FZ_ID) AS IN_FZ FROM viewFRDATA " +
"WHERE COMP_SSD_REQ=1 AND CABLE_SSD_REQ=1 AND COMP IS NOT NULL AND [email protected]_id ORDER BY COMP";
FComp item = new FComp();
ArrayList list = new ArrayList();
PropertyInfo[] p = item.GetType().GetProperties(); // get property info for item
dbmgr.CreateParameters(1); // create required parameters
dbmgr.AddParameters(0, "@rm_id", id); // component id
dbmgr.ExecuteReader(CommandType.Text, qryString); // execute query
while (dbmgr.DataReader.Read())
{
item = new FComp(); // create new item
item = (FComp)FetchObject(item, p, dbmgr);
list.Add(item); // add item to ArrayList
}
dbmgr.CloseReader();
_fireroom.componentlist = list; // update object item list
}
示例11: FetchFireRoom
// procedure fetches fire zone information
private void FetchFireRoom(int id, IDBManager dbmgr)
{
string qryString = "SELECT * FROM viewFRLIST WHERE [email protected]";
dbmgr.CreateParameters(1);
dbmgr.AddParameters(0, "@id", id);
dbmgr.ExecuteReader(CommandType.Text, qryString);
if (dbmgr.DataReader.Read())
{
// get properties of object and fetch object
PropertyInfo[] p = _fireroom.GetType().GetProperties();
_fireroom = (FireRoom)FetchObject(_fireroom, p, dbmgr);
}
dbmgr.CloseReader();
}
示例12: FetchDrawingList
// procedure fetches drawings given a component id
private void FetchDrawingList(int id, IDBManager dbmgr)
{
string qryString = "SELECT * FROM viewCOMPDWGS cd WHERE cd.COMP_ID = @comp_id AND cd.DWGTYPE_desc = 'Other' ORDER BY cd.DWG_REF, cd.DWG_REV";
//string qryString = "SELECT * FROM viewCOMPDWGS cd WHERE cd.COMP_ID = @comp_id AND DWGTYPE_ID <= 4 ORDER BY cd.DWGTYPE_ID, cd.DWG_REF, cd.DWG_REV";
CompDwg item = new CompDwg();
ArrayList list = new ArrayList();
PropertyInfo[] p = item.GetType().GetProperties(); // get property info for item
dbmgr.CreateParameters(1); // create parameters
dbmgr.AddParameters(0, "@comp_id", id); // component id
dbmgr.ExecuteReader(CommandType.Text, qryString); // execute query
while (dbmgr.DataReader.Read())
{
item = new CompDwg(); // create new item
item = (CompDwg)FetchObject(item, p, dbmgr);
list.Add(item); // add item to the ArrayList
}
dbmgr.CloseReader();
_comp.drawinglist = list; // update object item list
}
示例13: FetchRouteList
private void FetchRouteList(int id, IDBManager dbmgr)
{
string qryString = "SELECT * FROM viewCABROUTE_PLANT cr WHERE cr.CABLE_ID = @cable_id ORDER BY cr.SEQ, cr.NODE";
CabRoute item = new CabRoute(); //create new object type to be able to get property info
ArrayList list = new ArrayList(); //create new ArrayList to house objects
try
{
PropertyInfo[] p = item.GetType().GetProperties(); //get property info for item
dbmgr.Open(); //open database manager
dbmgr.CreateParameters(1); //create parameters
dbmgr.AddParameters(0, "@cable_id", id); //cable id
dbmgr.ExecuteReader(CommandType.Text, qryString); //execute query
while (dbmgr.DataReader.Read())
{
item = new CabRoute(); //create new item
item = (CabRoute)FetchObject(item, p, dbmgr);
list.Add(item); //add item to the ArrayList
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
dbmgr.Dispose();
}
_cable.routelist = list; //update item list
}
示例14: FetchDrawingList
private void FetchDrawingList(int id, IDBManager dbmgr)
{
string qryString;
switch (_user.plant)
{
case "ANO":
qryString = "SELECT * FROM viewCOMPCABDWGS cd WHERE cd.CABLE_ID = @cable_id ORDER BY DWG_REF";
break;
default:
qryString = "SELECT * FROM viewCOMPCABDWGS cd WHERE cd.CABLE_ID = @cable_id AND cd.DWGTYPE_DESC = 'Other' ORDER BY cd.DWG_REF, cd.DWG_REV";
break;
}
CabDwg item = new CabDwg(); // create new object type to be able to get property info
ArrayList list = new ArrayList(); // create new ArrayList to house objects
try
{
PropertyInfo[] p = item.GetType().GetProperties(); // get property info for item
dbmgr.Open(); // open database manager
dbmgr.CreateParameters(1); // create parameters
dbmgr.AddParameters(0, "@cable_id", id); // cable id
dbmgr.ExecuteReader(CommandType.Text, qryString); // execute query
while (dbmgr.DataReader.Read())
{
item = new CabDwg(); // create new item
item = (CabDwg)FetchObject(item, p, dbmgr);
list.Add(item); // add item to the ArrayList
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
dbmgr.Dispose();
}
_cable.drawinglist = list; // update item list
}
示例15: FetchDrawingList
// fetches drawings for every fz_id associated with a gived node_id
// different from other fetches
private void FetchDrawingList(ArrayList localist, IDBManager dbmgr)
{
if (localist.Count == 0)
_route.drawinglist = null;
else
{
string qryString = "SELECT * FROM viewROUTELOCADWGS rd WHERE rd.NODE_ID = @node_id AND rd.FZ_ID = @fz_id ORDER BY rd.DWG_REF";
ArrayList list = new ArrayList(); // create new ArrayList to house objects
foreach (Routeloca litem in localist)
{
RoutelocaDwg item = new RoutelocaDwg(); // create new object type to be able to get property info
PropertyInfo[] p = item.GetType().GetProperties(); // get property info for item
dbmgr.CreateParameters(2); // create parameters
dbmgr.AddParameters(0, "@node_id", litem.node_id); // node id
dbmgr.AddParameters(1, "@fz_id", litem.fz_id); // loca id
dbmgr.ExecuteReader(CommandType.Text, qryString); // execute query
while (dbmgr.DataReader.Read())
{
item = new RoutelocaDwg(); // create new item
item = (RoutelocaDwg)FetchObject(item, p, dbmgr);
list.Add(item); // add item to the ArrayList
}
dbmgr.CloseReader();
}
_route.drawinglist = list; // update item list
}
}