private void btnEditar_Click(object sender, RoutedEventArgs e) { DataRowView Rows = this.vorganigrama.DgvPlantilla.SelectedItem as DataRowView; VISTA.VDialog_Organigrama vdialog = new VISTA.VDialog_Organigrama(); C_DialogOrganigrama cdialog = new C_DialogOrganigrama(vdialog); vdialog.txtIdOrganigrama.Text = Rows.Row[0].ToString(); vdialog.cmbPersonal.SelectedValuePath = Rows.Row[1].ToString(); vdialog.txtPuesto.Text = Rows.Row[2].ToString(); vdialog.txtNivel.Text = Rows.Row[3].ToString(); vdialog.txtDependencia.Text = Rows.Row[4].ToString(); cdialog.FormLoad(); if (vdialog.DialogResult == true) { getDatos(vdialog, true); if (daoorganigrama.Editar().Equals(1)) { MessageBox.Show(":)"); Reload(); } else { MessageBox.Show(":("); } } }
private void btnNuevo_Click(object sender, RoutedEventArgs e) { VISTA.VDialog_Organigrama vdialog = new VISTA.VDialog_Organigrama(); C_DialogOrganigrama cdialog = new C_DialogOrganigrama(vdialog); cdialog.FormLoad(); if (vdialog.DialogResult == true) { getDatos(vdialog, false); if (daoorganigrama.Insertar().Equals(1)) { MessageBox.Show(":)"); Reload(); } else { MessageBox.Show(":("); } } }