Example #1
0
 private void PersonView_Load(object sender, EventArgs e)
 {
     PersonCtrl perconCtrl = new PersonCtrl();
     grdPerson.DataSource = perconCtrl.Consultar();
     grdPerson.Columns["PersonID"].Visible = false;
     grdPerson.Columns["OfficeAssignment"].Visible = false;
     grdPerson.Columns["StudentGrades"].Visible = false;
     grdPerson.Columns["Courses"].Visible = false;
 }
Example #2
0
 private void btnExcluir_Click(object sender, EventArgs e)
 {
     PersonCtrl personCtrl = new PersonCtrl();
     ArrayList arrPerson = new ArrayList();
     arrPerson.Add(grdPerson.CurrentRow.Cells[0].Value);
     arrPerson.Add(grdPerson.CurrentRow.Cells[1].Value);
     arrPerson.Add(grdPerson.CurrentRow.Cells[2].Value);
     arrPerson.Add(grdPerson.CurrentRow.Cells[3].Value);
     arrPerson.Add(grdPerson.CurrentRow.Cells[4].Value);
     personCtrl.Salvar(arrPerson, "excluir");
 }
Example #3
0
 private void btnSalvar_Click(object sender, EventArgs e)
 {
     PersonCtrl personCtrl = new PersonCtrl();
     if (this.operacao == "incluir")
     {
         ArrayList arrPerson = new ArrayList();
         arrPerson.Add(txtFirstName.Text);
         arrPerson.Add(txtLastName.Text);
         arrPerson.Add(Convert.ToString(dtpHireDate.Value));
         arrPerson.Add(Convert.ToString(dtpEnrollmentDate.Value));
         personCtrl.Salvar(arrPerson, this.operacao);
     }
     else
     {
         this.arrPerson[1] = txtFirstName.Text;
         this.arrPerson[2] = txtLastName.Text;
         this.arrPerson[3] = Convert.ToString(dtpHireDate.Value);
         this.arrPerson[4] = Convert.ToString(dtpEnrollmentDate.Value);
         personCtrl.Salvar(this.arrPerson, this.operacao);
     }
 }