예제 #1
0
        public void Editar()
        {
            Form f = new EditarCargos();

            string id;

            id = dgrprincipal.CurrentRow.Cells[0].Value.ToString();
            EditarCargos.id    = id;
            EditarCargos.nuevo = false;

            f.ShowDialog();
            Actualizar();
        }
예제 #2
0
        private void btnagregar_Click(object sender, EventArgs e)
        {
            Form f = new EditarCargos();

            string id;

            ds = oper.ConsultaConResultadods("SELECT id FROM cargo WHERE id==(SELECT max(id) FROM cargo);");
            id = ds.Tables[0].Rows[0][0].ToString();
            id = (Convert.ToInt32(id) + 1).ToString();
            EditarCargos.id    = id;
            EditarCargos.nuevo = true;

            f.ShowDialog();
            Actualizar();
        }