Ejemplo n.º 1
0
 public RoutelocaDwg(RoutelocaDwg obj)
 {
     PropertyInfo[] p = obj.GetType().GetProperties();                               // get entity properties
     for (int i = 0; i < (p.Length); i++)
     {
         if (!p[i].PropertyType.Name.Contains("list") && !p[i].Name.Contains("arg"))
             p[i].SetValue(this, p[i].GetValue(obj, null), null);                    // set entity's property values to obj properties
     }
 }
Ejemplo n.º 2
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
            }
        }
Ejemplo n.º 3
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
        }