本文整理汇总了C#中IDBManager类的典型用法代码示例。如果您正苦于以下问题:C# IDBManager类的具体用法?C# IDBManager怎么用?C# IDBManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDBManager类属于命名空间,在下文中一共展示了IDBManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ColumnExists
// function determines if a given column exists in database
// returns -1 if column does not exist otherwise returns ordinal of existing column
public static bool ColumnExists(string colName, IDBManager dbmgr)
{
bool exists = true;
try
{
// get ordinal of given column from database
int col = dbmgr.DataReader.GetOrdinal(colName);
}
catch
{
// if ordinal does not exist exception occurs
exists = false;
}
return exists;
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:18,代码来源:TotalManager.cs
示例2: UpdatePG
private void UpdatePG(object obj, IDBManager dbmgr)
{
FAPG item = (FAPG)obj;
try
{
dbmgr.Open();
dbmgr.CreateParameters(4);
dbmgr.AddParameters(0, "@fa_id", item.fa_id);
dbmgr.AddParameters(1, "@pg", item.pg);
dbmgr.AddParameters(2, "@method", item.method);
dbmgr.AddParameters(3, "@comment", item.comment);
dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FAPG_u");
}
catch (Exception ex)
{
throw ex;
}
finally
{
dbmgr.Dispose();
}
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:23,代码来源:FireAreaManager.cs
示例3: UpdateFireArea
private void UpdateFireArea(object obj, IDBManager dbmgr)
{
FireArea item = (FireArea)obj;
System.Data.Common.DbParameter param;
try
{
dbmgr.Open();
dbmgr.BeginTransaction();
// check to see if new object
if (item.fa_id == 0)
{
dbmgr.CreateParameters(3);
dbmgr.AddParameters(0, "@id", 0, true);
dbmgr.AddParameters(1, "@fa", item.fa);
dbmgr.AddParameters(2, "@fa_desc", item.fa_desc);
dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FALIST_i");
// get item id
param = (System.Data.Common.DbParameter)dbmgr.Parameters.GetValue(0);
item.fa_id = (int)param.Value;
}
// otherwise update existing object
else
{
dbmgr.CreateParameters(14);
dbmgr.AddParameters(0, "@fa_id", item.fa_id);
dbmgr.AddParameters(1, "@fa", item.fa);
dbmgr.AddParameters(2, "@fa_desc", item.fa_desc);
dbmgr.AddParameters(3, "@bldg", item.bldg);
dbmgr.AddParameters(4, "@elev", item.elev);
dbmgr.AddParameters(5, "@ssd_path", item.ssd_path);
dbmgr.AddParameters(6, "@req", item.req);
dbmgr.AddParameters(7, "@supp", item.supp);
dbmgr.AddParameters(8, "@det", item.det);
dbmgr.AddParameters(9, "@comment", item.comment);
dbmgr.AddParameters(10, "@dwg_id", item.dwg_id);
dbmgr.AddParameters(11, "@dwg_rev", item.dwg_rev);
dbmgr.AddParameters(12, "@risk_summary", item.risk_summary);
dbmgr.AddParameters(13, "@reg_basis", item.reg_basis);
dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FALIST_u"); // execute the stored procedure
//update status
UpdateStatus(dbmgr, item, 1, item.prep_by, item.prep_date);
UpdateStatus(dbmgr, item, 5, item.chkd_by, item.chkd_date);
}
dbmgr.CommitTransaction();
}
catch (Exception ex)
{
dbmgr.RollbackTransaction();
throw ex;
}
finally
{
dbmgr.Dispose();
}
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:59,代码来源:FireAreaManager.cs
示例4: UpdateDocument
private void UpdateDocument(object obj, IDBManager dbmgr)
{
FADoc item = (FADoc)obj;
try
{
dbmgr.Open();
dbmgr.CreateParameters(3);
dbmgr.AddParameters(0, "@fa_id", item.fa_id);
dbmgr.AddParameters(1, "@doc_id", item.doc_id);
dbmgr.AddParameters(2, "@comment", item.comment);
dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FADOC_u");
}
catch (Exception ex)
{
throw ex;
}
finally
{
dbmgr.Dispose();
}
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:22,代码来源:FireAreaManager.cs
示例5: UpdateCompDisp
private void UpdateCompDisp(object obj, IDBManager dbmgr)
{
FACompDisp item = (FACompDisp)obj; // cast object to proper item type
try
{
dbmgr.Open();
dbmgr.CreateParameters(5); // create required paramaters
dbmgr.AddParameters(0, "@fa_id", item.fa_id);
dbmgr.AddParameters(1, "@comp_id", item.comp_id);
dbmgr.AddParameters(2, "@old_disp_id", item.old_disp_id);
dbmgr.AddParameters(3, "@disp_id", item.disp_id);
dbmgr.AddParameters(4, "@status", item.status);
dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FACOMPDISP_u"); // execute stored procedure
}
catch (Exception ex)
{
throw ex;
}
finally
{
dbmgr.Dispose();
}
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:24,代码来源:FireAreaManager.cs
示例6: UpdateStatus
private void UpdateStatus(IDBManager dbmgr, FireArea item, int statustype_id, string user_id, DateTime status_date)
{
if ((user_id == "N/A") || (user_id == ""))
{
// delete status
dbmgr.CreateParameters(2);
dbmgr.AddParameters(0, "@fa_id", item.fa_id);
dbmgr.AddParameters(1, "@statustype_id", statustype_id);
dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FASTATUS_d");
}
else
{
// update status
dbmgr.CreateParameters(4);
dbmgr.AddParameters(0, "@fa_id", item.fa_id);
dbmgr.AddParameters(1, "@statustype_id", statustype_id);
dbmgr.AddParameters(2, "@user_id", user_id);
if (status_date == Convert.ToDateTime(null))
// set date to null
dbmgr.AddParameters(3, "@status_date", null);
else
// update date
dbmgr.AddParameters(3, "@status_date", status_date);
dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FASTATUS_u");
}
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:26,代码来源:FireAreaManager.cs
示例7: UpdateVFDR
private void UpdateVFDR(object obj, IDBManager dbmgr)
{
FAVFDR item = (FAVFDR)obj;
try
{
dbmgr.Open();
dbmgr.CreateParameters(6);
dbmgr.AddParameters(0, "@fa_id", item.fa_id);
dbmgr.AddParameters(1, "@vfdr_id", item.vfdr_id);
dbmgr.AddParameters(2, "@vfdr", item.vfdr);
dbmgr.AddParameters(3, "@vfdr_disp", item.vfdr_disp);
dbmgr.AddParameters(4, "@status", item.status);
dbmgr.AddParameters(5, "@fre_ref", item.fre_ref);
dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FAVFDR_u");
}
catch (Exception ex)
{
throw ex;
}
finally
{
dbmgr.Dispose();
}
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:25,代码来源:FireAreaManager.cs
示例8: 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;
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:21,代码来源:FireAreaManager.cs
示例9: FetchVFDRList
private void FetchVFDRList(int id, IDBManager dbmgr)
{
string qryString = "SELECT f.FA, v.* FROM FAVFDR v INNER JOIN FALIST f ON f.FA_ID = v.FA_ID WHERE v.FA_ID = @fa_id ORDER BY v.VFDR_ID";
FAVFDR item = new FAVFDR();
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 FAVFDR();
item = (FAVFDR)FetchObject(item, p, dbmgr);
list.Add(item);
}
dbmgr.CloseReader();
_firearea.vfdrlist = list;
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:21,代码来源:FireAreaManager.cs
示例10: ComponentManager
public ComponentManager()
{
loadAssembly();
_user = (User)System.Web.HttpContext.Current.Session[Constant.session.User];
_dbmgr = new DBManager(_user.plantDBStr);
_dbmgr.ConnectionString = _user.plantDBStr;
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:7,代码来源:ComponentManager.cs
示例11: Fetch
// fetches object and object items
// user has option of passing object itself OR a string with id and type delimited by '|'
public object Fetch(object obj)
{
int id = ((CableBlock)obj).comp_id;
// create new object and database connection
_cabBlock = new CableBlock();
_user = (User)System.Web.HttpContext.Current.Session[Constant.session.User];
_dbmgr = new DBManager(_user.plantDBStr);
_dbmgr.ConnectionString = _user.plantDBStr;
try
{
_dbmgr.Open();
FetchComponent(id, _dbmgr);
FetchCableBlock(id, _dbmgr);
FetchVertexList(id, _dbmgr);
return _cabBlock;
}
catch (Exception ex)
{
throw ex;
}
finally
{
_dbmgr.Dispose();
}
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:30,代码来源:BlockDiagramManager.cs
示例12: Fetch
public object Fetch(object obj)
{
int id;
id = ((FireRoom)obj).rm_id;
// initialize
_fireroom = new FireRoom();
_user = (User)System.Web.HttpContext.Current.Session[Constant.session.User];
_dbmgr = new DBManager(_user.plantDBStr);
_dbmgr.ConnectionString = _user.plantDBStr;
try
{
_dbmgr.Open();
// fetch object information
FetchFireRoom(id, _dbmgr);
FetchComponentList(id, _dbmgr);
FetchCableList(id, _dbmgr);
FetchRouteList(id, _dbmgr);
}
catch (Exception ex)
{
throw ex;
}
finally
{
_dbmgr.Dispose();
}
return _fireroom;
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:31,代码来源:FireRoomManager.cs
示例13: Fetch
public object Fetch(object obj)
{
int id;
string type; //type of object passed
string objtype = obj.GetType().ToString(); //get object type
if (objtype == "System.String")
{
string[] strTemp = ((string)obj).Split(new char[] { '|' }); //if the object type is a string then extract the id and type
id = Convert.ToInt32(strTemp[0]);
type = strTemp[1];
}
else
{
id = ((Disposition)obj).disp_id;
type = "all"; //object is a cable and get all information
}
_disp = new Disposition(); //create new instance of object
_user = (User)System.Web.HttpContext.Current.Session[Constant.session.User];
_dbmgr = new DBManager(_user.plantDBStr);
_dbmgr.ConnectionString = _user.plantDBStr;
switch (type)
{
case "facompcabdisp":
FetchFACompCabList(id, _dbmgr);
return _disp.facompcablist;
case "all":
FetchDisposition(id, _dbmgr);
FetchFACompCabList(id, _dbmgr);
return _disp;
}
return _disp;
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:34,代码来源:DispositionManager.cs
示例14: Delete
public void Delete(object obj)
{
_user = (User)System.Web.HttpContext.Current.Session[Constant.session.User];
_dbmgr = new DBManager(_user.plantDBStr);
_dbmgr.ConnectionString = _user.plantDBStr;
DeleteDisposition(obj, _dbmgr);
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:7,代码来源:DispositionManager.cs
示例15: Delete
public void Delete(object obj)
{
// get connection
_user = (User)System.Web.HttpContext.Current.Session[Constant.session.User];
_dbmgr = new DBManager(_user.plantDBStr);
_dbmgr.ConnectionString = _user.plantDBStr;
string type = obj.GetType().ToString();
// delete from database
switch (type)
{
case "FRIAS.Common.Entity.FireZone":
DeleteFireZone(obj, _dbmgr);
break;
case "FRIAS.Common.Entity.FZProtection":
DeleteProtection(obj, _dbmgr);
break;
case "FRIAS.Common.Entity.FZIgnition":
DeleteIgnition(obj, _dbmgr);
break;
case "FRIAS.Common.Entity.FZIgnitionImpact":
DeleteIgnitionImpact(obj, _dbmgr);
break;
}
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:26,代码来源:FireZoneManager.cs
示例16: Delete
public void Delete(object obj)
{
_user = (User)System.Web.HttpContext.Current.Session[Constant.session.User];
_dbmgr = new DBManager(_user.plantDBStr);
_dbmgr.ConnectionString = _user.plantDBStr;
string type = obj.GetType().ToString();
switch (type)
{
case "FRIAS.Common.Entity.FireArea":
DeleteFireArea(obj, _dbmgr);
break;
case "FRIAS.Common.Entity.FACompDisp":
DeleteCompDisp(obj, _dbmgr);
break;
case "FRIAS.Common.Entity.FACabDisp":
DeleteCabDisp(obj, _dbmgr);
break;
case "FRIAS.Common.Entity.FAVFDR":
DeleteVFDR(obj, _dbmgr);
break;
case "FRIAS.Common.Entity.FADOC":
DeleteDocument(obj, _dbmgr);
break;
}
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:27,代码来源:FireAreaManager.cs
示例17: Delete
// deletes given object or object item
public void Delete(object obj)
{
// create database connection
_user = (User)System.Web.HttpContext.Current.Session[Constant.session.User];
_dbmgr = new DBManager(_user.plantDBStr);
_dbmgr.ConnectionString = _user.plantDBStr;
// determine type of object
string type = obj.GetType().ToString();
switch (type)
{
case "FRIAS.Common.Entity.Component":
DeleteComponent(obj, _dbmgr);
break;
case "FRIAS.Common.Entity.CompDwg":
DeleteDrawing(obj, _dbmgr);
break;
case "FRIAS.Common.Entity.Subcomp":
DeleteSubcomp(obj, _dbmgr);
break;
case "FRIAS.Common.Entity.CompPwr":
DeletePower(obj, _dbmgr);
break;
case "FRIAS.Common.Entity.CompIntlk":
DeleteInterlock(obj, _dbmgr);
break;
case "FRIAS.Common.Entity.CompCab":
DeleteCable(obj, _dbmgr);
break;
}
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:32,代码来源:ComponentManager.cs
示例18: Delete
public void Delete(object obj)
{
// create database connection
_dbmgr = new DBManager(DBHelper.getProvider(Config.getValue("DBStr", "")));
_dbmgr.ConnectionString = Config.getValue("DBStr", "");
DeleteUser(obj, _dbmgr);
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:8,代码来源:UserManager.cs
示例19: Fetch
public object Fetch(object obj)
{
int id;
string type; // type of object passed
string objtype = obj.GetType().ToString(); // get object type
if (objtype == "System.String")
{
string[] strTemp = ((string)obj).Split(new char[] { '|' }); // if the object type is a string then extract the id and type
id = Convert.ToInt32(strTemp[0]);
type = strTemp[1];
}
else
{
id = ((Route)obj).node_id;
type = "all"; // object is a cable and get all information
}
_route = new Route(); // create new instance of object
_user = (User)System.Web.HttpContext.Current.Session[Constant.session.User];
_dbmgr = new DBManager(_user.plantDBStr);
_dbmgr.ConnectionString = _user.plantDBStr;
try
{
_dbmgr.Open();
switch (type)
{
case "routeloca":
FetchRoutelocaList(id, _dbmgr);
return _route.routelocalist;
case "routelocadwg":
FetchRoutelocaList(id, _dbmgr);
FetchDrawingList(_route.routelocalist, _dbmgr);
return _route.drawinglist;
case "bdendpoint":
FetchBDEndpointList(id, _dbmgr);
return _route.bdendpointlist;
case "cable":
FetchCableList(id, _dbmgr);
return _route.cablelist;
default:
FetchRoute(id, _dbmgr);
FetchRoutelocaList(id, _dbmgr);
FetchBDEndpointList(id, _dbmgr);
FetchDrawingList(_route.routelocalist, _dbmgr);
FetchCableList(id, _dbmgr);
return _route;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
_dbmgr.Dispose();
}
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:58,代码来源:RouteManager.cs
示例20: Fetch
public object Fetch(object obj)
{
int id;
string type; // type of object passed
string objtype = obj.GetType().ToString(); // get object type
if (objtype == "System.String")
{
string[] strTemp = ((string)obj).Split(new char[] { '|' }); // if object type is a string then extract the id and type
id = Convert.ToInt32(strTemp[0]);
type = strTemp[1];
}
else
{
id = ((Power)obj).power_id;
type = "all"; // object is drawing and get all information
}
_power = new Power();
_user = (User)System.Web.HttpContext.Current.Session[Constant.session.User];
_dbmgr = new DBManager(_user.plantDBStr);
_dbmgr.ConnectionString = _user.plantDBStr;
try
{
_dbmgr.Open();
switch (type)
{
case "component":
FetchComponentList(id, _dbmgr);
return _power.componentlist;
case "psload":
FetchPSLoadList(id, _dbmgr);
return _power.psloadlist;
case "psbkrcab":
FetchPSBkrCabList(id, _dbmgr);
return _power.psbkrcablist;
case "cabroutelist":
FetchCabRoutelist(id, _dbmgr);
return _power.cabroutelist;
default:
FetchPower(id, _dbmgr);
FetchComponentList(id, _dbmgr);
FetchPSLoadList(id, _dbmgr);
return _power;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
_dbmgr.Dispose();
}
}
开发者ID:DanielSpalding,项目名称:Projects,代码行数:57,代码来源:PowerManager.cs
注:本文中的IDBManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论