当前位置: 首页>>代码示例>>C#>>正文


C# IDBManager类代码示例

本文整理汇总了C#中IDBManager的典型用法代码示例。如果您正苦于以下问题:C# IDBManager类的具体用法?C# IDBManager怎么用?C# IDBManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IDBManager类属于命名空间,在下文中一共展示了IDBManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例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 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

示例14: 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;

            DeleteRA(obj, _dbmgr);
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:10,代码来源:NSCAManager.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;

            // delete from database
            DeleteFireRoom(obj, _dbmgr);
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:10,代码来源:FireRoomManager.cs


注:本文中的IDBManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。