Esempio n. 1
0
        private void FetchIgnitionImpactList(int fz_id, string ig, IDBManager dbmgr)
        {
            string qryString = "SELECT * FROM viewFZIGNITIONIMPACT WHERE FZ_ID = @fz_id AND IG = @ig ORDER BY ITEM";
            FZIgnitionImpact item = new FZIgnitionImpact();
            ArrayList list = new ArrayList();

            PropertyInfo[] p = item.GetType().GetProperties();
            dbmgr.CreateParameters(2);
            dbmgr.AddParameters(0, "@fz_id", fz_id);
            dbmgr.AddParameters(1, "@ig", ig);
            dbmgr.ExecuteReader(CommandType.Text, qryString);

            while (dbmgr.DataReader.Read())
            {
                item = new FZIgnitionImpact();
                item = (FZIgnitionImpact)FetchObject(item, p, dbmgr);
                list.Add(item);
            }

            dbmgr.CloseReader();
            _firezone.impactlist = list;
        }
Esempio n. 2
0
        private void FetchFireArea(int id, IDBManager dbmgr)
        {
            string qryLocal = "SELECT * FROM viewFALIST WHERE FA_ID=@id 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();
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        // procedure fetches recovery action list
        private void FetchRAList(int id, IDBManager dbmgr)
        {
            string qryString = "SELECT * FROM viewFACOMPRA AS r WHERE r.COMP_ID = @comp_id ORDER BY r.FA, r.RA_DISP";

            CompRA item = new CompRA();
            ArrayList list = new ArrayList();

            PropertyInfo[] p = item.GetType().GetProperties();					            // get property info for item
            dbmgr.CreateParameters(1);											            // create required parameters
            dbmgr.AddParameters(0, "@comp_id", id);								            // component id
            dbmgr.ExecuteReader(CommandType.Text, qryString);					            // execute query

            while (dbmgr.DataReader.Read())
            {
                item = new CompRA();											            // create new item
                item = (CompRA)FetchObject(item, p, dbmgr);
                list.Add(item);													            // add item to the ArrayList
            }

            dbmgr.CloseReader();
            _comp.ralist = list;												            // update object item list
        }
Esempio n. 5
0
        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
        }
Esempio n. 6
0
        private void FetchRoute(int id, IDBManager dbmgr)
        {
            string qryLocal = "SELECT * FROM viewROUTELIST WHERE NODE_ID=@id ORDER BY NODE";

            dbmgr.CreateParameters(1);
            dbmgr.AddParameters(0, "@id", id);
            dbmgr.ExecuteReader(CommandType.Text, qryLocal);
            if (dbmgr.DataReader.Read())
            {
                PropertyInfo[] p = _route.GetType().GetProperties();
                _route = (Route)FetchObject(_route, p, dbmgr);
            }

            dbmgr.CloseReader();
        }
Esempio n. 7
0
        private string Get_BD_ENDPT(int id, IDBManager dbmgr)
        {
            string bd_endpt = "";
            string qryString;

            switch (_user.locaType)
            {
                case Constant.type_FR:
                    qryString = "SELECT * FROM viewBDENDPOINTS_FR AS e WHERE e.NODE_ID = @node_id ORDER BY e.BD_ENDPT";
                    break;
                default:
                    qryString = "SELECT * FROM viewBDENDPOINTS AS e WHERE e.NODE_ID = @node_id ORDER BY e.BD_ENDPT";
                    break;
            }
            dbmgr.CreateParameters(1);											            // create parameters
            dbmgr.AddParameters(0, "@node_id", id);								            // node id
            dbmgr.ExecuteReader(CommandType.Text, qryString);					            // execute query

            while (dbmgr.DataReader.Read())
            {
                if (bd_endpt == "")
                    bd_endpt = "'" + dbmgr.DataReader["BD_ENDPT"].ToString() + "'";
                else
                    bd_endpt = bd_endpt + ", " + "'" + dbmgr.DataReader["BD_ENDPT"].ToString() + "'";
            }

            dbmgr.CloseReader();
            return bd_endpt;
        }
Esempio n. 8
0
        // procedure fetches fire zone information
        private void FetchFireRoom(int id, IDBManager dbmgr)
        {
            string qryString = "SELECT * FROM viewFRLIST WHERE RM_ID=@id";

            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();
        }
Esempio n. 9
0
        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 RM_ID=@rm_id " +
                "UNION " +
                "SELECT DISTINCT RM_ID, RM, FZ_ID, FZ, NODE_ID, NODE FROM viewROUTELOCA_FR WHERE NODE_ID IS NOT NULL AND RM_ID=@rm_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
        }
Esempio n. 10
0
        // 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
        }
Esempio n. 11
0
        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 RM_ID=@rm_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
        }
Esempio n. 12
0
        // fetches user information
        private void FetchUser(object obj, IDBManager dbmgr)
        {
            string qryLocal = "SELECT * FROM USERLIST WHERE NAME=@name";
            _user = (User)obj;

            dbmgr.CreateParameters(1);
            dbmgr.AddParameters(0, "@name", _user.name);
            dbmgr.ExecuteReader(CommandType.Text, qryLocal);

            if (dbmgr.DataReader.Read())
            {
                // get properties of object and fetch object
                PropertyInfo[] p = _user.GetType().GetProperties();
                _user = (User)FetchObject(_user, p, dbmgr);
            }
            else
            {
                _user.initial = "";
                _user.password = null;
            }

            dbmgr.CloseReader();
        }
Esempio n. 13
0
        // fetches user access list
        private void FetchAccessList(IDBManager dbmgr)
        {
            string qryString = "SELECT * FROM USERLIST ORDER BY NAME";

            User item = new User();
            ArrayList list = new ArrayList();

            PropertyInfo[] p = item.GetType().GetProperties();
            dbmgr.ExecuteReader(CommandType.Text, qryString);

            while (dbmgr.DataReader.Read())
            {
                item = new User();
                item = (User)FetchObject(item, p, dbmgr);
                list.Add(item);
            }

            dbmgr.CloseReader();
            _accesslist = list;
        }
Esempio n. 14
0
        private void FetchIgnitionList(int id, IDBManager dbmgr)
        {
            string qryString = "SELECT * FROM viewFZIGNITION WHERE FZ_ID = @fz_id ORDER BY IG";
            FZIgnition item = new FZIgnition();
            ArrayList list = new ArrayList();

            PropertyInfo[] p = item.GetType().GetProperties();
            dbmgr.CreateParameters(1);
            dbmgr.AddParameters(0, "@fz_id", id);
            dbmgr.ExecuteReader(CommandType.Text, qryString);

            while (dbmgr.DataReader.Read())
            {
                item = new FZIgnition();
                item = (FZIgnition)FetchObject(item, p, dbmgr);
                list.Add(item);
            }

            dbmgr.CloseReader();
            _firezone.ignitionlist = list;
        }
Esempio n. 15
0
        private void FetchCableList(int id, IDBManager dbmgr)
        {
            string qryString = "SELECT * FROM viewCABROUTE_CHKD c WHERE c.NODE_ID = @node_id ORDER BY c.CABLE";
            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
            PropertyInfo[] p = item.GetType().GetProperties();					            // get property info for item

            dbmgr.CreateParameters(1);											            // create parameters
            dbmgr.AddParameters(0, "@node_id", id);								            // node 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
            }

            dbmgr.CloseReader();
            _route.cablelist = list;										                // update item list
        }
Esempio n. 16
0
        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
        }
Esempio n. 17
0
        // 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
            }
        }
Esempio n. 18
0
        // procedure fetches incoming interlocks
        private void FetchIncomingIntlkList(int id, IDBManager dbmgr)
        {
            string qryString = "SELECT * FROM viewCOMPINTLKS ci WHERE ci.COMP_ID = @comp_id ORDER BY ci.INTLK, ci.DEVICE, ci.CONTACTS";

            CompIntlk item = new CompIntlk();
            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 CompIntlk();											            // create new item
                item = (CompIntlk)FetchObject(item, p, dbmgr);
                list.Add(item);													            // add item to the ArrayList
            }

            dbmgr.CloseReader();
            _comp.incomingintlklist = list;												    // update component item list
        }
Esempio n. 19
0
        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;
        }
Esempio n. 20
0
        // procedure fetches subcomponent list
        private void FetchSubcompList(int id, IDBManager dbmgr)
        {
            string qryString = "SELECT * FROM viewSUBCOMPS s WHERE s.COMP_ID = @comp_id ORDER BY s.SUBCOMP";

            Subcomp item = new Subcomp();
            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 Subcomp();											            // create new item
                item = (Subcomp)FetchObject(item, p, dbmgr);
                list.Add(item);													            // add item to the ArrayList
            }

            dbmgr.CloseReader();
            _comp.subcomplist = list;												        // update component item list
        }
Esempio n. 21
0
        private void FetchComponent(int id, IDBManager dbmgr)
        {
            string qryLocal = "SELECT * FROM viewCOMPLIST WHERE COMP_ID=@id";

            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();
        }
Esempio n. 22
0
        private void FetchCableList(int id, IDBManager dbmgr)
        {
            string qryString;

            switch (_user.plant)
            {
                case "ANO":
                    qryString = "SELECT cd.COMP_ID,  " +
                        " COMP = CASE WHEN c.CHKD_DATE IS NULL AND c.CABLE_CODE LIKE '%YES%' THEN 'R' ELSE '-' END, " +
                        " cd.CABLE_ID, cd.CABLE, cd.DWG_ID, cd.DWG_REF, cd.DWG_REV, cd.DWGTYPE_ID " +
                        " FROM viewCOMPCABDWGS AS cd " +
                        " LEFT OUTER JOIN viewCABLIST c ON c.CABLE_ID = cd.CABLE_ID " +
                        " WHERE cd.DWG_ID = @dwg_id " +
                        " ORDER BY cd.CABLE";
                    break;
                default:
                    qryString = "SELECT cd.*, '' AS COMP FROM viewCABDWGS AS cd " +
                        "INNER JOIN viewCABLIST_USED AS c ON c.CABLE_ID = cd.CABLE_ID " +
                        "WHERE cd.DWG_ID = @dwg_id ORDER BY cd.CABLE";
                    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
            PropertyInfo[] p = item.GetType().GetProperties();					            // get property info for item

            dbmgr.CreateParameters(1);											            // create parameters
            dbmgr.AddParameters(0, "@dwg_id", id);							                // drawing 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
            }

            dbmgr.CloseReader();
            _drawing.cablelist = list;												        // update object item list
        }
Esempio n. 23
0
        private void FetchCabDispList(int fa_id, int comp_id, IDBManager dbmgr)
        {
            string qryString = "SELECT * FROM viewFACABDISP_LIVE WHERE FA_ID = @fa_id AND COMP_ID = @comp_id ORDER BY COMP, CABLE, DISP";
            FACabDisp item = new FACabDisp();									            // 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, "@fa_id", fa_id);							            // fire area id
            dbmgr.AddParameters(1, "@comp_id", comp_id);
            dbmgr.ExecuteReader(CommandType.Text, qryString);					            // execute query

            while (dbmgr.DataReader.Read())
            {
                item = new FACabDisp();
                item = (FACabDisp)FetchObject(item, p, dbmgr);
                list.Add(item);													            // add item to the ArrayList
            }
            dbmgr.CloseReader();
            _firearea.cabdisplist = list;											        // update item list
        }
Esempio n. 24
0
        private void FetchDrawing(int id, IDBManager dbmgr)
        {
            string qryLocal = "SELECT * FROM viewDWGLIST WHERE DWG_ID=@id";

            dbmgr.CreateParameters(1);
            dbmgr.AddParameters(0, "@id", id);
            dbmgr.ExecuteReader(CommandType.Text, qryLocal);
            if (dbmgr.DataReader.Read())
            {
                // get properties of object and fetch object
                PropertyInfo[] p = _drawing.GetType().GetProperties();
                _drawing = (Drawing)FetchObject(_drawing, p, dbmgr);
            }

            dbmgr.CloseReader();
        }
Esempio n. 25
0
        private void FetchCompDispList(int id, IDBManager dbmgr)
        {
            string qryString = "SELECT * FROM viewFACOMPDISP_LIVE WHERE FA_ID = @fa_id ORDER BY COMP, DISP";
            FACompDisp item = new FACompDisp();											    // 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, "@fa_id", id);							                // fire area id
            dbmgr.ExecuteReader(CommandType.Text, qryString);					            // execute query

            while (dbmgr.DataReader.Read())
            {
                item = new FACompDisp();
                item = (FACompDisp)FetchObject(item, p, dbmgr);
                item.in_fa = Convert.ToBoolean(dbmgr.DataReader["in_fa"]);
                list.Add(item);
            }

            dbmgr.CloseReader();
            _firearea.compdisplist = list;
        }
Esempio n. 26
0
        private void FetchRoutelocaList(int id, IDBManager dbmgr)
        {
            string qryString = "SELECT * FROM viewROUTELOCADWGS_ALL rd WHERE rd.DWG_ID = @dwg_id ORDER BY rd.NODE";
            RoutelocaDwg item = new RoutelocaDwg();											// 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, "@dwg_id", id);							                // drawing 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();
            _drawing.routelocalist = list;												    // update object item list
        }
Esempio n. 27
0
        private void FetchLICdocList(int id, IDBManager dbmgr)
        {
            string qryString = "SELECT * FROM viewFADOCS WHERE FA_ID = @fa_id AND DOC_TYPE = @doc_type ORDER BY DOC";
            FADoc item = new FADoc();
            ArrayList list = new ArrayList();

            PropertyInfo[] p = item.GetType().GetProperties();
            dbmgr.CreateParameters(2);
            dbmgr.AddParameters(0, "@fa_id", id);
            dbmgr.AddParameters(1, "@doc_type", "LIC");
            dbmgr.ExecuteReader(CommandType.Text, qryString);

            while (dbmgr.DataReader.Read())
            {
                item = new FADoc();
                item = (FADoc)FetchObject(item, p, dbmgr);
                list.Add(item);
            }

            dbmgr.CloseReader();
            _firearea.licdoclist = list;
        }
Esempio n. 28
0
        private void FetchBDEndpointList(int id, IDBManager dbmgr)
        {
            string bd_endpt = Get_BD_ENDPT(id, dbmgr);
            _route.bd_endpt = bd_endpt.Replace("'", "");

            if (_route.bd_endpt=="")
                _route.bdendpointlist=null;
            else
            {
                string qryString = "SELECT * FROM viewBDENDPOINTS e WHERE e.BD_ENDPT IN (" + bd_endpt + ") ORDER BY e.ENDPT";
                RouteBDEndpoint item = new RouteBDEndpoint();							    // 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.ExecuteReader(CommandType.Text, qryString);					        // execute query

                while (dbmgr.DataReader.Read())
                {
                    item = new RouteBDEndpoint();										    // create new item
                    item = (RouteBDEndpoint)FetchObject(item, p, dbmgr);
                    list.Add(item);													        // add item to the ArrayList
                }

                dbmgr.CloseReader();
                _route.bdendpointlist = list;										        //update item list
            }
        }
Esempio n. 29
0
        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;
        }
Esempio n. 30
0
        private void FetchCableList(int id, IDBManager dbmgr)
        {
            string qryString;

            switch (_user.locaType)
            {
                case Constant.type_FR:
                    qryString = "SELECT DISTINCT FZ_ID, FZ, COMP_ID, COMP, CABLE_ID, CABLE FROM viewFRDATA " +
                        "WHERE COMP_SSD_REQ=1 AND CABLE_SSD_REQ=1 AND CABLE IS NOT NULL AND FZ_ID=@fz_id ORDER BY COMP, CABLE";
                    break;
                default:
                    qryString = "SELECT DISTINCT FZ_ID, FZ, COMP_ID, COMP, CABLE_ID, CABLE FROM viewFZDATA " +
                        "WHERE COMP_SSD_REQ=1 AND CABLE_SSD_REQ=1 AND CABLE IS NOT NULL AND FZ_ID=@fz_id ORDER BY COMP, CABLE";
                    break;
            }

            FCab item = new FCab();
            ArrayList list = new ArrayList();

            PropertyInfo[] p = item.GetType().GetProperties();					            // get property info for item

            dbmgr.CreateParameters(1);											            // create required parameters
            dbmgr.AddParameters(0, "@fz_id", id);								            // component id
            dbmgr.ExecuteReader(CommandType.Text, qryString);					            // execute query

            while (dbmgr.DataReader.Read())
            {
                item = new FCab();											                // create new item
                item = (FCab)FetchObject(item, p, dbmgr);
                list.Add(item);													            // add item to ArrayList
            }

            dbmgr.CloseReader();
            _firezone.cablelist = list;												        // update object item list
        }