コード例 #1
0
 private void btnActualizar_Click(object sender, EventArgs e)
 {
     if (dataGridView1.Rows.Count > 0)
     {
         if (dataGridView1.SelectedRows.Count > 0)
         {
             RegistrarEmpleados E = new RegistrarEmpleados();
             E.txtIdE.Text       = dataGridView1.CurrentRow.Cells[0].Value.ToString();
             Program.IdCargo     = Convert.ToInt32(dataGridView1.CurrentRow.Cells[1].Value.ToString());
             E.txtRut.Text       = dataGridView1.CurrentRow.Cells[2].Value.ToString();
             E.txtDv.Text        = dataGridView1.CurrentRow.Cells[3].Value.ToString();
             E.txtNombres.Text   = dataGridView1.CurrentRow.Cells[4].Value.ToString();
             E.txtApellidos.Text = dataGridView1.CurrentRow.Cells[5].Value.ToString();
             if (dataGridView1.CurrentRow.Cells[6].Value.ToString() == "M")
             {
                 E.rbnMasculino.Checked = true;
             }
             else
             {
                 E.rbnFemenino.Checked = true;
             }
             E.dateTimePicker1.Value = Convert.ToDateTime(dataGridView1.CurrentRow.Cells[7].Value.ToString());
             E.txtDireccion.Text     = dataGridView1.CurrentRow.Cells[8].Value.ToString();
             Program.Evento          = 1;
             E.Show();
         }
         else
         {
             MessageBoxEx.Show("Debe Seleccionar la Fila a Editar.", "Sistema de Ventas.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         dataGridView1.ClearSelection();
         timer1.Start();
     }
 }
コード例 #2
0
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            RegistrarEmpleados E = new RegistrarEmpleados();

            E.txtIdE.Text   = "0";
            Program.IdCargo = 0;
            Program.Evento  = 0;
            E.Show();
            dataGridView1.ClearSelection();
        }
コード例 #3
0
        public RegistrarCargo(RegistrarEmpleados referencia)
        {
            InitializeComponent();

            registraReferencia = referencia;
        }