Exemplo n.º 1
0
        public FrmAFILIADO(MODELO.AFILIADO miAFILIADO, string miaccion)
        {
            InitializeComponent();

            cAFILIADOS = CONTROLADORA.cAFILIADOS.Obtener_Instancia();
            oAFILIADO  = miAFILIADO;
            accion     = miaccion;

            CBPlanes.DataSource    = cAFILIADOS.Obtener_Planes();
            CBPlanes.DisplayMember = "Nombre";

            if (accion != "A")
            {
                txtNombre_Afiliado.Text   = oAFILIADO.Nombre;
                txtDirecion_Afiliado.Text = oAFILIADO.Direccion;
                txtEmail_Afiliado.Text    = oAFILIADO.Email;
                MtbFecha_Nacimiento.Text  = oAFILIADO.Fecha_Nacimiento.ToString();
                Txtsexo_Afiliado.Text     = oAFILIADO.Sexo;
                TxtContrato_Afiliado.Text = oAFILIADO.Numero_Contrato.ToString();
                mtxtDNI_Afiliado.Text     = oAFILIADO.DNI.ToString();
                mtxtTel_Afiliado.Text     = oAFILIADO.Telefono.ToString();
                CBPlanes.Text             = oAFILIADO.PLAN.ToString();
                if (oAFILIADO.Estado == true)
                {
                    ChkEstado.Checked = true;
                }
                else
                {
                    ChkEstado.Checked = false;
                }

                if (oAFILIADO.Titular == true)
                {
                    chkTitular.Checked = true;
                }
                else
                {
                    ChkAdherente.Checked = true;
                }
            }
            if (accion == "C")
            {
                ChkEstado.Enabled            = false;
                ChkAdherente.Enabled         = false;
                MtbFecha_Nacimiento.Enabled  = false;
                btnGuardar_AFILIADO.Visible  = false;
                btnCancelar.Text             = "CERRAR";
                txtNombre_Afiliado.Enabled   = false;
                txtDirecion_Afiliado.Enabled = false;
                Txtsexo_Afiliado.Enabled     = false;
                mtxtDNI_Afiliado.Enabled     = false;
                mtxtTel_Afiliado.Enabled     = false;
                chkTitular.Enabled           = false;
                ChkDebito.Enabled            = false;
                TxtContrato_Afiliado.Enabled = false;
                txtEmail_Afiliado.Enabled    = false;
                CBPlanes.Enabled             = false;
            }
        }
Exemplo n.º 2
0
        public FrmAFILIADO(MODELO.AFILIADO miAFILIADO, string miaccion)
        {
            InitializeComponent();

            cAFILIADOS = CONTROLADORA.cAFILIADOS.Obtener_Instancia();
            oAFILIADO  = miAFILIADO;
            accion     = miaccion;

            CBPlanes.DataSource    = cAFILIADOS.Obtener_Planes();
            CBPlanes.DisplayMember = "Nombre";

            if (accion != "A")
            {
                txtNombre_Afiliado.Text   = oAFILIADO.Nombre;
                txtDirecion_Afiliado.Text = oAFILIADO.Direccion;
                txtEmail_Afiliado.Text    = oAFILIADO.Email;
                MtbFecha_Nacimiento.Text  = oAFILIADO.Fecha_Nacimiento.ToString();
                Txtsexo_Afiliado.Text     = oAFILIADO.Sexo;
                TxtContrato_Afiliado.Text = oAFILIADO.Numero_Contrato.ToString();
                mtxtDNI_Afiliado.Text     = oAFILIADO.DNI.ToString();
                mtxtTel_Afiliado.Text     = oAFILIADO.Telefono.ToString();
                CBPlanes.Text             = oAFILIADO.PLAN.ToString();
                if (oAFILIADO.Forma_Pago == "Debito Automático")
                {
                    oTarjeta = oAFILIADO.TARJETAS;
                    txtNumeroTarjeta.Text      = oAFILIADO.TARJETAS.Numero.ToString();
                    mtbVencimientoTarjeta.Text = oAFILIADO.TARJETAS.Vencimiento;
                }
                if (oAFILIADO.Forma_Pago.ToString() == "Efectivo")
                {
                    RbEfectivo.Checked = true;
                }
                else
                {
                    RbDebitoAutomatico.Checked = true;
                }
                if (oAFILIADO.Estado == true)
                {
                    ChkEstado.Checked = true;
                }
                else
                {
                    ChkEstado.Checked = false;
                }
            }
            if (accion == "C")
            {
                ChkEstado.Enabled            = false;
                MtbFecha_Nacimiento.Enabled  = false;
                btnGuardar_AFILIADO.Visible  = false;
                btnCancelar.Text             = "CERRAR";
                txtNombre_Afiliado.Enabled   = false;
                txtDirecion_Afiliado.Enabled = false;
                Txtsexo_Afiliado.Enabled     = false;
                mtxtDNI_Afiliado.Enabled     = false;
                mtxtTel_Afiliado.Enabled     = false;
                GB_FormasPago.Enabled        = false;
                gbTarjeta.Enabled            = false;
                TxtContrato_Afiliado.Enabled = false;
                txtEmail_Afiliado.Enabled    = false;
                CBPlanes.Enabled             = false;
            }
        }