예제 #1
0
 private void tlbMenu_NewClick()
 {
     try
     {
         frmManTipoDescansoMedicoEdit objManTipoDescansoMedico = new frmManTipoDescansoMedicoEdit();
         objManTipoDescansoMedico.lstTipoDescansoMedico = mLista;
         objManTipoDescansoMedico.pOperacion            = frmManTipoDescansoMedicoEdit.Operacion.Nuevo;
         objManTipoDescansoMedico.IdTipoDescansoMedico  = 0;
         objManTipoDescansoMedico.StartPosition         = FormStartPosition.CenterParent;
         objManTipoDescansoMedico.ShowDialog();
         Cargar();
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #2
0
        public void InicializarModificar()
        {
            if (gvTipoDescansoMedico.RowCount > 0)
            {
                TipoDescansoMedicoBE objTipoDescansoMedico = new TipoDescansoMedicoBE();
                objTipoDescansoMedico.IdTipoDescansoMedico   = int.Parse(gvTipoDescansoMedico.GetFocusedRowCellValue("IdTipoDescansoMedico").ToString());
                objTipoDescansoMedico.DescTipoDescansoMedico = gvTipoDescansoMedico.GetFocusedRowCellValue("DescTipoDescansoMedico").ToString();
                objTipoDescansoMedico.FlagEstado             = Convert.ToBoolean(gvTipoDescansoMedico.GetFocusedRowCellValue("FlagEstado").ToString());

                frmManTipoDescansoMedicoEdit objManTipoDescansoMedicoEdit = new frmManTipoDescansoMedicoEdit();
                objManTipoDescansoMedicoEdit.pOperacion            = frmManTipoDescansoMedicoEdit.Operacion.Modificar;
                objManTipoDescansoMedicoEdit.IdTipoDescansoMedico  = objTipoDescansoMedico.IdTipoDescansoMedico;
                objManTipoDescansoMedicoEdit.pTipoDescansoMedicoBE = objTipoDescansoMedico;
                objManTipoDescansoMedicoEdit.StartPosition         = FormStartPosition.CenterParent;
                objManTipoDescansoMedicoEdit.ShowDialog();

                Cargar();
            }
            else
            {
                MessageBox.Show("No se pudo editar");
            }
        }