Exemplo n.º 1
0
        public List <Workorder> GetWO(string value1 = null, string value2 = null, string value3 = null)
        {
            AV_SitesDL       sd    = new AV_SitesDL();
            List <Workorder> wolst = new List <Workorder>();

            DataSet ds = sd.GetDataSet("SiteWithSectors", value1);

            if (ds.Tables.Count > 0)
            {
                DataTable Sit = ds.Tables[0];

                AV_Site s = new AV_Site();

                var rec = Sit.ToList <AV_Site>();
                if (rec.Count > 0)
                {
                    s = rec.FirstOrDefault();
                }

                DataTable sec = ds.Tables[1];
                Workorder wo;
                for (int i = 0; i < sec.Rows.Count; i++)
                {
                    wo               = new Workorder();
                    wo.SiteId        = s.SiteId;
                    wo.siteCode      = s.SiteCode;
                    wo.siteLatitude  = s.Latitude.ToString();
                    wo.siteLongitude = s.Longitude.ToString();
                    wo.Client        = s.ClientId.ToString();
                    wo.Scope         = s.ScopeId.ToString();
                    wo.SiteAddress   = s.SiteAddress;
                    wo.SiteName      = s.SiteName;
                    wo.SiteTypeId    = s.SiteTypeId.ToString();
                    wo.SiteClassId   = s.SiteClassId;
                    wo.Description   = s.Description;
                    wo.clusterCode   = "-";
                    wo.sectorCode    = sec.Rows[i]["SectorCode"].ToString();
                    wo.networkMode   = sec.Rows[i]["NetworkModeId"].ToString();
                    wo.Band          = sec.Rows[i]["BandId"].ToString();
                    wo.Carrier       = sec.Rows[i]["CarrierId"].ToString();
                    wo.BandWidth     = (!string.IsNullOrEmpty(sec.Rows[i]["BandWidth"].ToString())) ? sec.Rows[i]["BandWidth"].ToString() : "0";
                    wo.Antenna       = sec.Rows[i]["Antenna"].ToString();
                    wo.BeamWidth     = sec.Rows[i]["BeamWidth"].ToString();
                    wo.Azimuth       = sec.Rows[i]["Azimuth"].ToString();
                    wo.PCI           = sec.Rows[i]["PCI"].ToString();
                    wo.MRBTS         = sec.Rows[i]["MRBTS"].ToString();
                    wo.RFHeight      = DataType.ToInt32(sec.Rows[i]["RFHeight"].ToString());
                    wo.MTilt         = DataType.ToInt32(sec.Rows[i]["MTilt"].ToString());
                    wo.ETilt         = DataType.ToInt32(sec.Rows[i]["ETilt"].ToString());
                    wo.CellId        = sec.Rows[i]["CellId"].ToString();

                    wolst.Add(wo);
                }
            }

            return(wolst);
        }