private void btnStergePersoana_Click(object sender, System.EventArgs e) { try { int id = int.Parse(persID.Value); Salaries.Business.PersoanaInIntretinere pers = new Salaries.Business.PersoanaInIntretinere(id); pers.Delete(); } catch (Exception ex) { litError.Text = "The following error occurred: <br>"; litError.Text += ex.Message; } LoadPersoaneList(); }
private void btnAdaugaPersInIntretinere_Click(object sender, System.EventArgs e) { try { Salaries.Business.PersoanaInIntretinere pers = new Salaries.Business.PersoanaInIntretinere(); string Nume = this.txtNume.Text; string Prenume = this.txtPrenume.Text; long CNP = long.Parse(this.txtCNP.Text); short Calitate = short.Parse(ddlCalitate.SelectedValue); short Invaliditate = short.Parse(ddlInvaliditate.SelectedValue); pers.Create((int)AngajatID, Nume, Prenume, CNP, Calitate, Invaliditate); } catch (Exception ex) { litError.Text = "The following error occurred: <br>"; litError.Text += ex.Message; } LoadPersoaneList(); }
private void btnModificaPersoana_Click(object sender, System.EventArgs e) { try { int id = int.Parse(persID.Value); Salaries.Business.PersoanaInIntretinere pers = new Salaries.Business.PersoanaInIntretinere(id); pers.Nume = this.txtNume.Text; pers.Prenume = this.txtPrenume.Text; pers.CNP = long.Parse(this.txtCNP.Text); pers.Calitate = short.Parse(ddlCalitate.SelectedValue); pers.Invaliditate = short.Parse(ddlInvaliditate.SelectedValue); pers.Update(); } catch (Exception ex) { litError.Text = "The following error occurred: <br>"; litError.Text += ex.Message; } LoadPersoaneList(); }