Beispiel #1
0
        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(":(");
                }
            }
        }
        public C_DialogOrganigrama(VISTA.VDialog_Organigrama vdl_organigrama)
        {
            this.vdl_organigrama = vdl_organigrama;
            daoorganigrama       = new MODELO.DAO_Organigrama();
            daoorganigrama.abrirConexion();
            this.vdl_organigrama.cmbPersonal.Items.Clear();
            var items2 = (daoorganigrama.consultaPersonal() as IListSource).GetList();

            this.vdl_organigrama.cmbPersonal.ItemsSource       = items2;
            this.vdl_organigrama.cmbPersonal.DisplayMemberPath = "vchPersonal";
            this.vdl_organigrama.cmbPersonal.SelectedValuePath = "intIdPersonal";
        }
Beispiel #3
0
        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(":(");
                }
            }
        }
Beispiel #4
0
        private void getDatos(VISTA.VDialog_Organigrama vdialog, bool edit)
        {
            DataRowView Rows = vdialog.cmbPersonal.SelectedItem as DataRowView;
            var         id   = Rows.Row[0].ToString();

            vdialog.cmbPersonal.SelectedValuePath = id;

            if (edit == false)
            {
                this.voorganigrama.IDORGANIGRAMA = 0;
            }
            else
            {
                this.voorganigrama.IDORGANIGRAMA = int.Parse(vdialog.txtIdOrganigrama.Text);
            }
            this.voorganigrama.IDPERSONAL  = int.Parse(vdialog.cmbPersonal.SelectedValuePath);
            this.voorganigrama.PUESTO      = vdialog.txtPuesto.Text;
            this.voorganigrama.NIVEL       = vdialog.txtNivel.Text;
            this.voorganigrama.DEPENDENCIA = vdialog.txtDependencia.Text;
            this.daoorganigrama            = new MODELO.DAO_Organigrama(voorganigrama);
        }