public override void DoDelete() { if (_current == null) { return; } try { if (XtraMessageBox.Show("L'elemento sarà eliminato solamente se nel sistema non ci sono altri riferimenti all'elemento oppure se non è un elemento predefinito. Sicuro di voler procedere? ", "Elimina elemento", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Nested_CheckSecurityForDeletion(); BedTypeHandler h = new BedTypeHandler(); h.Delete(_current); _mainForm.NavigatorUtility.NavigateToPrevious(); } } catch (AccessDeniedException) { XtraMessageBox.Show("Impossibile accedere alla funzionalità richiesta. Accesso negato", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex) { ErrorHandler.Show(ex); } }
private void LoadGrid() { BedTypeHandler h = new BedTypeHandler(); IList l = h.GetAll(); gridControl1.DataSource = l; }
private void SaveOrUpdate() { _current.Descrizione = txtDescrizione.Text; _current.NumeroLetti = Convert.ToInt32(spinEdit1.Value); BedTypeHandler h = new BedTypeHandler(); h.SaveOrUpdate(_current); }
protected override void Nested_LoadDataFromDataSource() { BedTypeHandler h = new BedTypeHandler(); _current = h.GetElementById(m_IdShowedObject.ToString()) as WIN.SCHEDULING_APPLICATION.DOMAIN.Booking.BedType; if (_current == null) { throw new Exception("Elemento non trovato"); } }
private void LoadBedTypesCombo() { //preparo la combo delle zone cboLetti.Properties.Items.Clear(); BedTypeHandler h = new BedTypeHandler(); //la riempio cboLetti.Properties.Items.AddRange(h.GetAll()); //seleziono quella iniziale cboLetti.SelectedIndex = 0; }