Пример #1
0
        private void SelectionChanged(TicketTypesVM tickettypevm)
        {
            if (SelectedType == null) return;
            if (ShowCancel == "Visible") CancelUpdateTicketType(this);

            _oldType = SelectedType.Copy();

            tickettypevm.ShowEdit = "Visible";
            tickettypevm.ShowCancel = "Hidden";
            tickettypevm.ShowSave = "Hidden";
            Enabled = false;
        }
Пример #2
0
        private void SaveUpdateTicketType(TicketTypesVM tickettypevm)
        {
            if (!SelectedType.IsValid())
                return;
            // Save Changes
            if (_oldType == null)
            {
                // Insert into db
                SelectedType.ID = TicketType.AddTicketType(SelectedType);
            }
            else
            {
                // Update db
                TicketType.UpdateTicketType(SelectedType);
            }

            // Update GUI
            tickettypevm.ShowEdit = "Visible";
            tickettypevm.ShowCancel = "Hidden";
            tickettypevm.ShowSave = "Hidden";
            Enabled = false;
        }
Пример #3
0
 private void EditTicketType(TicketTypesVM tickettypevm)
 {
     tickettypevm.ShowEdit = "Hidden";
     tickettypevm.ShowCancel = "Visible";
     tickettypevm.ShowSave = "Visible";
     tickettypevm.Enabled = true;
 }
Пример #4
0
        private void DeleteTicketType(TicketTypesVM tickettypevm)
        {
            if (SelectedType == null) return;

            TicketType.DeleteTicketType(SelectedType);

            SelectedType = new TicketType();
            Enabled = true;
            ShowEdit = "Hidden";
            ShowCancel = "Hidden";
            ShowSave = "Visible";
        }
Пример #5
0
        private void CancelUpdateTicketType(TicketTypesVM tickettypevm)
        {
            // Reset person
            _changeNotify = false;
            SelectedType = _oldType;

            tickettypevm.ShowEdit = "Visible";
            tickettypevm.ShowCancel = "Hidden";
            tickettypevm.ShowSave = "Hidden";
            Enabled = false;
        }
Пример #6
0
 private void AddTicketType(TicketTypesVM tickettypevm)
 {
     SelectedType = new TicketType();
     _oldType = null;
     tickettypevm.ShowEdit = "Hidden";
     tickettypevm.ShowCancel = "Visible";
     tickettypevm.ShowSave = "Visible";
     tickettypevm.Enabled = true;
 }