Ejemplo n.º 1
0
        public static List <RosShopInfo> LoadShopData(string shopMallNo, string floorNo, bool allBrandInfo)
        {
            string sql = @"select a.*,h.HotspotInfo,b.ShopMallAreaID,b.ShopMallAreaName,b.ShopMallBigAreaID,b.ShopMallBigAreaName,b.ShopMallCityCode,b.ShopMallCityName,b.ShopMallProvinceCode,b.ShopMallProvinceName,b.ShopMallTownCode,b.ShopMallTownName 
from ITMall a left join A_ShopMall b on a.ShopMallNo = b.ShopMallNo
 inner join dbo.HotSpot h on h.SeatNo = a.SeatNo and h.ShopMallNo = a.ShopMallNo and h.FloorNo = a.FloorName+'_0'";

            sql += string.Format(" where a.ShopMallNo = '{0}' and FloorName = '{1}' order by a.SeatNo ", shopMallNo, floorNo.Substring(0, 2));

            DataSet ds = SqlHelper.ExecuteDataset(cnnstring, CommandType.Text, sql);

            List <RosShopInfo> shopInfos = new List <RosShopInfo>();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //loop through rows
            {
                string brand = ds.Tables[0].Rows[i]["Brand"].ToString();

                string shopType = ds.Tables[0].Rows[i]["ShopType"].ToString();

                string seatNO = ds.Tables[0].Rows[i]["SeatNO"].ToString();

                if (!allBrandInfo && (brand != "ThinkPad" || shopType != "品牌"))
                {
                    continue;
                }

                if (!shopInfos.Exists(p => (p.SeatNO.ToLower() == seatNO.ToLower())))
                {
                    RosShopInfo rosShopInfo = new RosShopInfo(ds.Tables[0].Rows[i], shopType);

                    rosShopInfo.HotSpotInfo = JsonConvert.DeserializeObject <ROSHotSpot>(ds.Tables[0].Rows[i]["HotspotInfo"].ToString());
                    ;
                    shopInfos.Add(rosShopInfo);
                }
            }

            shopInfos.Sort();

            return(shopInfos);
        }
Ejemplo n.º 2
0
        public ShopMallFloorHotspotData LoadShopMallLayoutData(string shopMallNo, string floorNo)
        {
            ShopMallFloorHotspotData shopMallFloorHotspotData = new ShopMallFloorHotspotData();

            shopMallFloorHotspotData.ShopMallNo      = shopMallNo;
            shopMallFloorHotspotData.ShopMallFloorNo = floorNo;



            shopMallFloorHotspotData.ImageUrl = GetRootUrl() + "DownloadHandler.ashx?url=" + HttpContext.Current.Server.UrlEncode(GetRootUrl() + "Images/" + string.Format("{0}_{1}-3.png", shopMallNo, floorNo));

            shopMallFloorHotspotData.Brands = BrandData.GetAllBrandInfos();

            shopMallFloorHotspotData.ShopInfos = new List <RosShopInfo>();

            string sql = "select a.*,b.ShopMallAreaID,b.ShopMallAreaName,b.ShopMallBigAreaID,b.ShopMallBigAreaName,b.ShopMallCityCode,b.ShopMallCityName,b.ShopMallProvinceCode,b.ShopMallProvinceName,b.ShopMallTownCode,b.ShopMallTownName from ITMall a left join A_ShopMall b on a.ShopMallNo = b.ShopMallNo";

            sql += string.Format(" where a.ShopMallNo = '{0}' and FloorName = '{1}' order by a.SeatNo ", shopMallNo, floorNo.Substring(0, 2));

            DataSet ds = SqlHelper.ExecuteDataset(cnnstring, CommandType.Text, sql);

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                string brand = ds.Tables[0].Rows[i]["Brand"].ToString();

                string shopType = ds.Tables[0].Rows[i]["ShopType"].ToString();

                string seatNO = ds.Tables[0].Rows[i]["SeatNO"].ToString();

                if (!shopMallFloorHotspotData.ShopInfos.Exists(p => (p.SeatNO.ToLower() == seatNO.ToLower())))
                {
                    RosShopInfo rosShopInfo = new RosShopInfo(ds.Tables[0].Rows[i], shopType);
                    ;
                    shopMallFloorHotspotData.ShopInfos.Add(rosShopInfo);
                }
            }

            return(shopMallFloorHotspotData);
        }
        public int CompareTo(object obj)
        {
            RosShopInfo shopInfo = (RosShopInfo)obj;

            return(String.Compare(this.SeatNO, shopInfo.SeatNO));
        }