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


C# IDBManager.ExecuteReader方法代码示例

本文整理汇总了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;
 }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:29,代码来源:CableManager.cs

示例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();
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:14,代码来源:FireAreaManager.cs

示例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;
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:21,代码来源:FireAreaManager.cs

示例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;
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:42,代码来源:FireAreaManager.cs

示例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
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:20,代码来源:FireAreaManager.cs

示例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;
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:32,代码来源:RouteManager.cs

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

示例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
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:25,代码来源:FireRoomManager.cs

示例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
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:21,代码来源:DocumentManager.cs

示例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
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:23,代码来源:FireRoomManager.cs

示例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();
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:17,代码来源:FireRoomManager.cs

示例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
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:24,代码来源:ComponentManager.cs

示例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
 }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:29,代码来源:CableManager.cs

示例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
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:42,代码来源:CableManager.cs

示例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
            }
        }
开发者ID:DanielSpalding,项目名称:Projects,代码行数:33,代码来源:RouteManager.cs


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