private void LocationChoose() { Location [] selected; if (BusinessDomain.RestrictionTree.GetRestriction("mnuEditObjects") == UserRestrictionState.Allowed) { using (ChooseEditLocation dialog = new ChooseEditLocation(true, string.Empty)) { if (dialog.Run() != ResponseType.Ok) { txtExchangeLocation.GrabFocus(); return; } selected = dialog.SelectedItems; } } else { selected = new Location [0]; } if (selected.Length <= 0) { txtExchangeLocation.GrabFocus(); return; } SetLocation(selected [0]); }
private void btnLocation_Clicked(object sender, EventArgs e) { long?selectedLocation = location != null ? location.Id : (long?)null; using (ChooseEditLocation chooseEditLocation = new ChooseEditLocation(true, selectedLocation)) { if (chooseEditLocation.Run() == ResponseType.Ok && chooseEditLocation.SelectedItems.Length > 0) { location = chooseEditLocation.SelectedItems [0]; } else { location = null; } ShowLocationAvailability(); ReinitializeGrid(false, null); } }
private void ChangeLocation() { using (ChooseEditLocation dialog = new ChooseEditLocation(true, lockedLocation != null ? lockedLocation.Id : (long?)null)) { if (dialog.Run() != ResponseType.Ok) { return; } Location [] locations = dialog.SelectedItems; if (locations.Length == 0) { return; } EvaluateLocation(locations [0]); } txtLocation.GrabFocus(); }