private void btnSaveHotSpot_Click(object sender, RoutedEventArgs e)
        {
            HotSpotWebServiceSoapClient serviceClient = App.GetHotSpotWebServiceSoapClient(setting);

            ShopMallFloorHotspotData shopMallFloorHotspot = new ShopMallFloorHotspotData();

            shopMallFloorHotspot.ShopMallNo      = shopMallFloorData.ShopMallNo;
            shopMallFloorHotspot.ShopMallFloorNo = shopMallFloorData.ShopMallFloorNo;


            serviceClient.SaveShopMallFloorHotspotDataAsync(shopMallFloorHotspot, SLHotSpot.ROSHotSpot.HotSpotsToList(HostSpots, this.imgBg.Width, this.imgBg.Height));
            serviceClient.SaveShopMallFloorHotspotDataCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(serviceClient_SaveShopMallFloorHotspotDataCompleted);
        }
예제 #2
0
        void serviceClient_LoadShopMallLayoutDataCompleted(object sender, LoadShopMallLayoutDataCompletedEventArgs e)
        {
            ShopMallFloorHotspotData shopMallFloorData = e.Result as ShopMallFloorHotspotData;

            if (shopMallFloorData == null)
            {
                return;
            }



            this.RootVisual = new MainPage(setting, shopMallFloorData);
        }
        public MainPage(SLHotSpotSetting _hotSpotSetting, ShopMallFloorHotspotData _shopMallFloorData)
        {
            shopMallFloorData = _shopMallFloorData;

            InitializeComponent();

            BrandInfo.SetBrandData(shopMallFloorData);

            hostSpot = new ShopHotSpot(Guid.NewGuid(), "Thinkpad");


            casDrawPanel.MouseLeftButtonUp   += ssvDrawOnMouseLeftButtonUp;
            casDrawPanel.MouseMove           += ssvDrawOnMouseMove;
            casDrawPanel.MouseLeftButtonDown += ssvDrawOnMouseLeftButtonDown;

            imgBg.MouseEnter += new MouseEventHandler(imgBg_MouseEnter);

            setting = _hotSpotSetting;

            switch (setting.ControlMode)
            {
            case Mode.View:
            case Mode.Change:
                LayoutRoot.ColumnDefinitions[0].Width = new GridLength(100, GridUnitType.Star);
                LayoutRoot.ColumnDefinitions[1].Width = new GridLength(0, GridUnitType.Star);
                this.pnlManage.Visibility             = Visibility.Collapsed;
                break;

            case Mode.Design:
                LayoutRoot.ColumnDefinitions[0].Width = new GridLength(75, GridUnitType.Star);
                LayoutRoot.ColumnDefinitions[1].Width = new GridLength(25, GridUnitType.Star);
                this.pnlManage.Visibility             = Visibility.Visible;
                break;
            }

            if (!String.IsNullOrEmpty(shopMallFloorData.ImageUrl))
            {
                biLoadingImage.IsBusy = true;

                //MessageBox.Show(shopMallFloorData.ImageUrl);

                Uri imageuri = new Uri(shopMallFloorData.ImageUrl);

                WebClient webClient = new WebClient();

                webClient.OpenReadCompleted       += new OpenReadCompletedEventHandler(webClient_OpenReadCompleted);
                webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(webClient_DownloadProgressChanged);

                webClient.OpenReadAsync(imageuri);
            }
        }
예제 #4
0
        public static List <ROSHotSpot> GetFromShopMallFloorHotspotData(ShopMallFloorHotspotData shopMallFloorData)
        {
            List <ROSHotSpot> spots = new List <ROSHotSpot>();

            for (int i = 0; i < shopMallFloorData.ShopInfos.Count; i++)
            {
                if (shopMallFloorData.ShopInfos[i].HotSpotInfo != null)
                {
                    ROSHotSpot rosHot = new ROSHotSpot(shopMallFloorData.ShopInfos[i].HotSpotInfo);
                    spots.Add(rosHot);
                }
            }
            return(spots);
        }
        public static void SetBrandData(ShopMallFloorHotspotData shopMallFloorHotspotData)
        {
            brandInfos = new List <BrandInfo>();

            foreach (BrandData brandData in shopMallFloorHotspotData.Brands)
            {
                brandInfos.Add(new BrandInfo()
                {
                    Name          = brandData.Name,
                    FillColor     = ColorFromString.ToColor(brandData.FillColor),
                    BorderColor   = ColorFromString.ToColor(brandData.BorderColor),
                    FontColor     = ColorFromString.ToColor(brandData.FontColor),
                    FillOverColor = ColorFromString.ToColor(brandData.FillOverColor)
                });
            }
        }
예제 #6
0
        public static ObservableCollection <CPData> GetAllData(ShopMallFloorHotspotData shopMallFloorData)
        {
            cpDatas.Clear();

            foreach (BrandData brandInfo in shopMallFloorData.Brands)
            {
                CPData cpData = new CPData();
                cpData.Name       = brandInfo.Name;
                cpData.BrandColor = new SolidColorBrush(ColorFromString.ToColor(brandInfo.FillColor));
                Random random = new Random(cpData.GetHashCode());
                cpData.OCP    = random.Next(20, 100);
                cpData.NCP    = cpData.OCP;
                cpData.CPText = string.Format("原有竞争力 : {0}", cpData.OCP);
                cpDatas.Add(cpData);
            }

            return(cpDatas);
        }
예제 #7
0
        public static void SetBrandData(ShopMallFloorHotspotData shopMallFloorHotspotData)
        {
            brandInfos = new List<BrandInfo>();

            foreach (BrandData brandData in shopMallFloorHotspotData.Brands)
            {
                brandInfos.Add(new BrandInfo() { Name = brandData.Name,
                    FillColor = ColorFromString.ToColor(brandData.FillColor),
                    BorderColor =ColorFromString.ToColor(brandData.BorderColor),
                    FontColor = ColorFromString.ToColor(brandData.FontColor),
                    FillOverColor = ColorFromString.ToColor(brandData.FillOverColor)
                });
            }
        }