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; }
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; }
private void EditTicketType(TicketTypesVM tickettypevm) { tickettypevm.ShowEdit = "Hidden"; tickettypevm.ShowCancel = "Visible"; tickettypevm.ShowSave = "Visible"; tickettypevm.Enabled = true; }
private void DeleteTicketType(TicketTypesVM tickettypevm) { if (SelectedType == null) return; TicketType.DeleteTicketType(SelectedType); SelectedType = new TicketType(); Enabled = true; ShowEdit = "Hidden"; ShowCancel = "Hidden"; ShowSave = "Visible"; }
private void CancelUpdateTicketType(TicketTypesVM tickettypevm) { // Reset person _changeNotify = false; SelectedType = _oldType; tickettypevm.ShowEdit = "Visible"; tickettypevm.ShowCancel = "Hidden"; tickettypevm.ShowSave = "Hidden"; Enabled = false; }
private void AddTicketType(TicketTypesVM tickettypevm) { SelectedType = new TicketType(); _oldType = null; tickettypevm.ShowEdit = "Hidden"; tickettypevm.ShowCancel = "Visible"; tickettypevm.ShowSave = "Visible"; tickettypevm.Enabled = true; }