private void EditHotSpot(string shopNO) { ShopHotSpot shopHotEdit = GetHotSpotByDataID(shopNO); cwShopEditor winHotSpot = new cwShopEditor(); winHotSpot.ShowEdit(shopHotEdit, this); winHotSpot.Closed += new EventHandler(winHotSpot_Closed); }
private void EditHotSpot(Guid editId) { ShopHotSpot shopHotEdit = GetHotSpotBy(editId); cwShopEditor winHotSpot = new cwShopEditor(); winHotSpot.ShowEdit(shopHotEdit, this); winHotSpot.Closed += new EventHandler(winHotSpot_Closed); }
private void winHotSpot_Closed(object sender, EventArgs e) { cwShopEditor hotSpotEditor = sender as cwShopEditor; if (hotSpotEditor == null) { btnDrawArea.IsChecked = true; return; } if (!(hotSpotEditor.DialogResult.HasValue && hotSpotEditor.DialogResult.Value)) { if (hotSpotEditor.DataMode == DataFormMode.AddNew) { btnDrawArea.IsChecked = true; } return; } if (hotSpotEditor.DataMode == DataFormMode.AddNew) { ShopHotSpot newhostSpot = hotSpotEditor.GetItem(); newhostSpot.AddHotspot(casDrawPanel, this.setting.ControlMode, this); HostSpots.Add(newhostSpot); dgHotSpot.ItemsSource = HostSpots; listNotDrawSeatNo.ItemsSource = NotAssignedShopNOs; hostSpot = new ShopHotSpot(Guid.NewGuid(), "Lenovo"); btnCancelDraw.Visibility = Visibility.Collapsed; btnDrawArea.Content = "开始绘制热点"; } else if (hotSpotEditor.DataMode == DataFormMode.Edit) { ShopHotSpot shopHotSpot = hotSpotEditor.GetItem(); shopHotSpot.UpdateHotspot(casDrawPanel, this.setting.ControlMode, this); dgHotSpot.ItemsSource = HostSpots; listNotDrawSeatNo.ItemsSource = NotAssignedShopNOs; } }
private void btnDrawArea_Click(object sender, RoutedEventArgs e) { if (btnDrawArea.IsChecked.HasValue && btnDrawArea.IsChecked.Value) { btnCancelDraw.Visibility = Visibility.Visible; btnDrawArea.Content = "绘制热点结束"; hostSpot.BeginDraw(casDrawPanel); } else { if (hostSpot.EndDraw(casDrawPanel)) { cwShopEditor cwShop = new cwShopEditor(); cwShop.ShowAdd(hostSpot, this); cwShop.Closed += new EventHandler(winHotSpot_Closed); } else { MessageBox.Show("请至少输入3个点!"); btnDrawArea.IsChecked = !btnDrawArea.IsChecked; return; } } }