Exemple #1
0
 public PersonaDesktop()
 {
     InitializeComponent();
     LogicaPlan lpa = new LogicaPlan();
     cbPlan.DataSource = lpa.GetAll();
     cbPlan.DisplayMember = "descripcion";
     cbTipoPersona.DataSource = Entidades.TiposPersonas.obtenerTiposDePersona();
 }
Exemple #2
0
 //CONSTRUCTOR PARA MODIFICACION, BAJA Y CONSULTA
 public FormularioPlan(int ID, ModosFormulario modo) : this()
 {
     this.Modo = modo;
     Negocio.LogicaPlan plan = new Negocio.LogicaPlan();
     PlanActual = plan.TraerUno(ID);
     MapearDeDatos();
     this.txtID.ReadOnly = true;
     if (this.Modo == ModosFormulario.Baja)
     {
         this.txtDescripcion.ReadOnly = true;
         this.txtID.ReadOnly          = true;
         //combobox especialidad en readonly (crear un controlador durante el proceso?)
     }
 }
Exemple #3
0
 public override void MapearDeDatos()
 {
     switch (modo)
     {
         case modoForm.Alta:
             this.txtID.Enabled = false;
             this.btnAceptar.Text = "Guardar";
             break;
         case modoForm.Modificacion:
             this.txtID.Enabled = false;
             this.btnAceptar.Text = "Guardar";
             break;
         case modoForm.Baja:
             this.btnAceptar.Text = "Eliminar";
             this.txtNombre.Enabled = false;
             this.txtApellido.Enabled = false;
             this.txtEmail.Enabled = false;
             this.txtDireccion.Enabled = false;
             this.txtLegajo.Enabled = false;
             this.txtTelefono.Enabled = false;
             this.cbPlan.Enabled = false;
             this.cbTipoPersona.Enabled = false;
             this.dtFechaNacimiento.Enabled = false;
             break;
         case modoForm.Consulta:
             this.btnAceptar.Text = "Aceptar";
             break;
         }
     if (this.modo != modoForm.Alta)
     {
         this.txtApellido.Text = personaActual.apellido;
         this.txtDireccion.Text = personaActual.direccion;
         this.txtEmail.Text = personaActual.email;
         this.txtID.Text = personaActual.ID.ToString();
         this.txtLegajo.Text = personaActual.legajo.ToString();
         this.txtNombre.Text = personaActual.nombre;
         this.txtTelefono.Text = personaActual.telefono;
         LogicaPlan lp = new LogicaPlan();
         this.cbPlan.SelectedIndex = lp.GetAll().FindIndex(p => p.ID == personaActual.idPlan);
         this.cbTipoPersona.SelectedIndex = personaActual.tipoPersona - 1;
     }
 }