示例#1
0
        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);
            }
        }
示例#2
0
        private void LoadGrid()
        {
            BedTypeHandler h = new BedTypeHandler();

            IList l = h.GetAll();

            gridControl1.DataSource = l;
        }
示例#3
0
        private void SaveOrUpdate()
        {
            _current.Descrizione = txtDescrizione.Text;
            _current.NumeroLetti = Convert.ToInt32(spinEdit1.Value);

            BedTypeHandler h = new BedTypeHandler();

            h.SaveOrUpdate(_current);
        }
示例#4
0
        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");
            }
        }
示例#5
0
        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;
        }