private void btnSaveService_Click(object sender, EventArgs e) { try { if (!blnService) { service.inserts(); MessageBox.Show("Enregistrement éffectué", "Enregistrement", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (bsrcService.DataSource != null) { clsservice s = (clsservice)bsrcService.Current; new clsservice().update(s); MessageBox.Show("Modification effectuée!", "Modification", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBox.Show("Echec de la mise à jour" + ex.Message, "Mise à jour", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } this.New(); refreshService(); }
private void btnSave_Click(object sender, EventArgs e) { try { if (!bln) { service.inserts(); MessageBox.Show("Enregistrement éffectué", "Enregistrement", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (bsrc.DataSource != null) { clsservice s = (clsservice)bsrc.Current; new clsservice().update(s); MessageBox.Show("Modification effectuée!", "Modification", MessageBoxButtons.OK, MessageBoxIcon.Information); } } //Permet l'actualisation des valeur des services sur le formulair des agents clsDoTraitement.EnterForFormService = true; } catch (Exception ex) { MessageBox.Show("Echec de la mise à jour" + ex.Message, "Mise à jour", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } this.New(); refresh(); }
private void btnDeleteService_Click(object sender, EventArgs e) { try { DialogResult result = MessageBox.Show("Voulez - vous vraiment supprimer cet enregistrement ?", "Suppression", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { if (bsrcBloc.DataSource != null) { clsservice s = (clsservice)bsrc.Current; new clsservice().delete(s); MessageBox.Show("Suppression éffectuée", "Suppression", MessageBoxButtons.OK, MessageBoxIcon.Information); this.New(); refreshService(); } } } catch (Exception ex) { MessageBox.Show("Echec de la suppression " + ex.Message, "Suppression", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void btnDelete_Click(object sender, EventArgs e) { try { DialogResult result = MessageBox.Show("Voulez - vous vraiment supprimer cet enregistrement ?", "Suppression", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { if (bsrc.DataSource != null) { clsservice d = (clsservice)bsrc.Current; new clsservice().delete(d); MessageBox.Show("Suppression éffectuée", "Suppression", MessageBoxButtons.OK, MessageBoxIcon.Information); this.New(); refresh(); } } //Permet l'actualisation des valeur des services sur le formulair des agents clsDoTraitement.EnterForFormService = true; } catch (Exception ex) { MessageBox.Show("Echec de la suppression " + ex.Message, "Suppression", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void newService() { service = new clsservice(); blnService = false; bindingclsService(); }
private void New() { service = new clsservice(); bln = false; bindingcls(); }