Example #1
0
        public List <YY_RTU_ITEM> GetElementsForLocation(STCDParameter Loca)
        {
            List <YY_RTU_BI>   itemlist = dt.Select <YY_RTU_BI>("YY_RTU_BI", new string[] { "*" }, " where STCD='" + Loca.STCD + "'").ToList();
            List <YY_RTU_ITEM> Item     = GetAllElements();
            var item = Item.Where(i => itemlist.Exists(il => i.ItemID.Contains(il.ItemID))).ToList();

            return(item);
        }
Example #2
0
        public List <LocationInfo> GetLocationInfo(STCDParameter Loca)
        {
            string where = "";
            if (Loca.STCD != "")
            {
                where = " where STCD='" + Loca.STCD + "'";
            }
            List <LocationInfo> info = new List <LocationInfo>();
            List <YY_RTU_Basic> rtu  = dt.Select <YY_RTU_Basic>("YY_RTU_Basic", new string[] { "*" }, where).ToList();
            List <LocaInfo_Tab> loca = dt.Select <LocaInfo_Tab>("LocaInfo_Tab", new string[] { "*" }, where).ToList();
            List <Image_Tab>    img  = dt.Select <Image_Tab>("Image_Tab", new string[] { "*" }, where).ToList();

            foreach (var item in rtu)
            {
                var L = loca.Find(l => l.STCD == item.STCD);

                List <Image_Tab> Img = (from i in img where item.STCD == i.STCD select i).ToList();
                info.Add(new LocationInfo {
                    STCD = item.STCD, Latitude = item.Latitude, Longitude = item.Longitude, NiceName = item.NiceName, PassWord = item.PassWord, Image = Img, LocaInfo = L
                });
            }

            return(info);
        }