private async void BtnSave_Click(object sender, EventArgs e) { if (!ValidateChildren()) { return; } request.Name = txtName.Text; request.Status = Model.ReviewStatus.Approved; if (_id == 0) { entity = await _serviceArtists.Insert <Model.Artists>(request); if (entity != null) { MessageBox.Show("Artist added"); DialogResult = DialogResult.OK; } } else { entity = await _serviceArtists.Update <Model.Artists>(_id, request); if (entity != null) { MessageBox.Show("Artist updated"); DialogResult = DialogResult.OK; } } }
private async void ArtistComboBox_SelectionChanged(object sender, Syncfusion.XForms.ComboBox.SelectionChangedEventArgs e) { SfComboBox cmb = sender as SfComboBox; Model.Artists artist = cmb.SelectedValue as Model.Artists; VM.ArtistId = artist.Id; await VM.LoadAlbums(); AlbumComboBox.SelectedItem = null; AlbumComboBox.Text = ""; SongComboBox.SelectedItem = null; SongComboBox.Text = ""; }
private async void BtnReject_Click(object sender, EventArgs e) { if (!ValidateChildren()) { return; } request.Name = txtName.Text; request.Status = Model.ReviewStatus.Rejected; entity = await _serviceArtists.Update <Model.Artists>(_id, request); if (entity != null) { MessageBox.Show("Artist rejected"); DialogResult = DialogResult.OK; } }
private async void frmArtistDetails_Load(object sender, EventArgs e) { if (_id != 0) { entity = await _serviceArtists.GetById <Model.Artists>(_id); if (entity != null) { if (entity.Status == Model.ReviewStatus.Pending) { btnSave.Text = "Approve"; btnReject.Visible = true; } txtName.Text = entity.Name; } } }