Esempio n. 1
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);
        }
Esempio n. 2
0
        public void SaveShopMallFloorHotspotData(ShopMallFloorHotspotData shopMallFloorHotspot, List <ROSHotSpot> rosHotSpots)
        {
            DataSet dsDataSet = GetHotSpotInfoByFloorNo(shopMallFloorHotspot.ShopMallNo,
                                                        shopMallFloorHotspot.ShopMallFloorNo);

            //List<string> delHotspots = new List<string>();

            foreach (DataRow dr in dsDataSet.Tables[0].Rows)
            {
                string seatNo = dr["SeatNo"].ToString();

                if (!rosHotSpots.Exists(p => (p.SeatNO.ToLower() == seatNo.ToLower())))
                {
                    DelHotspots(shopMallFloorHotspot.ShopMallNo,
                                shopMallFloorHotspot.ShopMallFloorNo, seatNo);
                }
            }


            foreach (ROSHotSpot rosHotSpot in rosHotSpots)
            {
                DataSet dsHotspotdata = GetHotSpotInfoByNo(shopMallFloorHotspot.ShopMallNo,
                                                           shopMallFloorHotspot.ShopMallFloorNo, rosHotSpot.SeatNO);

                if (dsHotspotdata.Tables[0].Rows.Count > 0)
                {
                    UpdateHotSpot(shopMallFloorHotspot.ShopMallNo,
                                  shopMallFloorHotspot.ShopMallFloorNo, rosHotSpot.SeatNO, rosHotSpot);
                }
                else
                {
                    InsertHotSpot(shopMallFloorHotspot.ShopMallNo,
                                  shopMallFloorHotspot.ShopMallFloorNo, rosHotSpot.SeatNO, rosHotSpot);
                }
            }
        }