예제 #1
0
        /*
        private void AfterDraw(string position)
        {
            Snf.Silver.Main.GisService.Polygon region = new Snf.Silver.Main.GisService.Polygon
            {
                Caption = "",
                Description = ""
            };
            region.Points = new System.Collections.ObjectModel.ObservableCollection<GisService.Point>();
            string[] splits = position.Split(new char[] { ',' });


            foreach (string split in splits)
            {
                string[] coords = split.Split(new char[] { ' ' });
                region.Points.Add(new Snf.Silver.Main.GisService.Point { X = Convert.ToDouble(coords[0]), Y = Convert.ToDouble(coords[1]) });
            }

            //_gisService.CreateRegionAsync(1, region);
        }*/

        void MapPolygon_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            ChangeDeselectedPolygonsColorToOriginalColor();

            var selectedPolygon = (sender as BIT.AVL.Silver.Map.Geometry.Polygon);

            _selectedRegoinOrginalColor = selectedPolygon.FillColor;
            _selectedRegionsOpacity = new Dictionary<int, double>();

            _selectedRegionMapId = GetRegionMapId(selectedPolygon.TempID);

            foreach (BIT.AVL.Silver.Map.Geometry.Polygon p in DrawControl.DrawLayer.Children)
            {
                if (GetRegionGroupId(p.TempID) == GetRegionGroupId(selectedPolygon.TempID))
                {
                    _selectedRegionsOpacity.Add(GetRegionMapId(p.TempID), p.Opacity);
                    ChangeSelectedPolygonsColorToOrange(p);
                }
            }

            SetMenusButton(DBUtils.GetGroupRegionName(_selectedRegionMapId, (SanofiProductBrands) _selected_Product));
            if (_selected_RegionType == SanofiRegionTypes.Tehran)
            {
                ShowShowLocations();
                if (DistrictDSIDs.ContainsKey(DBUtils.GetDistrictId(_selectedRegionMapId)))
                {
                    EnableShowLocations();
                }
                else
                {
                    DisableShowLocations();
                    CD_DomainContext context = new CD_DomainContext();
                    context.Load(context.GetDSID_PerDistrictQuery(DBUtils.GetDistrictId(_selectedRegionMapId) + ""), DSID_PerDistrict_ResultCallback, null);
                }
            }
        }
예제 #2
0
 private void LoadTehranResult(SanofiProductBrands product, int startM, int startY, int endM, int endY)
 {
     object[] state = { product, startM, startY, endM, endY };
     CD_DomainContext context = new CD_DomainContext();
     context.Load(context.GetDSID_PerDistrictQuery(""), DSID_PerDistrict_ResultCallback, state);
 }