protected void Page_Load(object sender, EventArgs e)
        {
            this.tbxNombre.Enabled            = false;
            this.tbxApellido.Enabled          = false;
            this.tbxFechaDeNacimiento.Text    = DateTime.Today.ToString("dd/MM/yyyy");
            this.tbxFechaDeNacimiento.Enabled = false;
            this.tbxMail.Enabled        = false;
            this.tbxNdeAfiliado.Enabled = false;
            this.tbxObraSocial.Enabled  = false;
            this.tbxPlan.Enabled        = false;
            this.tbxTelefono.Enabled    = false;


            this.TN = new TurnosNegocio();
            EspecialidadNegocio especilidadesN = new EspecialidadNegocio();

            this.especialidades                 = especilidadesN.Leer_Activas();
            this.ddlEspecialidad.DataSource     = this.especialidades;
            this.ddlEspecialidad.DataTextField  = this.especialidades.ElementAt(0).ToString();
            this.ddlEspecialidad.DataValueField = this.especialidades.ElementAt(0).ToString();

            // Bind the data to the control.
            this.ddlEspecialidad.DataBind();
            this.ddlEspecialidad.SelectedIndex = 0;
        }
        private void frmAltaTurno_Load(object sender, EventArgs e)
        {
            this.TN = new Negocio.TurnosNegocio();
            EspecialidadNegocio especilidades = new EspecialidadNegocio();

            cbxEspecialidad.DataSource    = especilidades.Leer_Activas();
            this.cbxEspecialidad.Enabled  = false;
            this.cbxFecha.Enabled         = false;
            this.cbxHora.Enabled          = false;
            this.cbxMedico.Enabled        = false;
            this.tbxObservaciones.Enabled = false;
            this.btnAceptar.Enabled       = false;
            this.btnBuscar.Enabled        = true;
            this.txbLeyenda.Visible       = false;
            this.txtCoseguro.Visible      = false;
            this.txtCoseguro.Enabled      = false;
            this.label15.Visible          = false;
            this.label15.Enabled          = false;


            if (cbxEspecialidad.Items.Count > 0)
            {
                cbxEspecialidad.SelectedIndex = 0;
            }
        }
Example #3
0
        private void AltaMedico_Load(object sender, EventArgs e)
        {
            EspecialidadNegocio SpecialidadNegocio = new EspecialidadNegocio();

            try
            {
                cbxEspecialidad.DataSource = SpecialidadNegocio.listarEspecialidades();

                if (medicolocal != null)
                {
                    txbNombre.Text                = medicolocal.Nombre;
                    txbApellido.Text              = medicolocal.Apellido;
                    txtDNI.Text                   = medicolocal.DNI;
                    txbTelefono.Text              = medicolocal.Telephone;
                    txbMatricula.Text             = medicolocal.matricula;
                    txbEmail.Text                 = medicolocal.Email;
                    comboBoxTipoTel.SelectedIndex = comboBoxTipoTel.FindString(medicolocal.TipoTel);
                    //comboBoxPROV.SelectedIndex = comboBoxPROV.FindString(medicolocal.Direcc.Provincia);
                    //ckbCapa.Checked = medicolocal.UsaCapa;
                    //ckbVuela.Checked = medicolocal.Volador;
                    //cboUniverso.SelectedIndex = cboUniverso.FindString(heroeLocal.Universo.Nombre);
                    cbxEspecialidad.SelectedIndex = cbxEspecialidad.FindString(medicolocal.Especialidad.descripcion);
                    //alternativa al retomar una modificacion. Si tenes configurado Display y Value Member
                    //cboUniverso.SelectedValue = heroeLocal.Universo.Id;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
        public void Agregar(string nuevo)
        {
            if (this.Existe(nuevo) == true)
            {
                MessageBox.Show("Especialidad Existente");
                return;
            }
            EspecialidadNegocio especialidadNegocio = new EspecialidadNegocio();

            E.nombre = nuevo.ToUpper();
            if (especialidadNegocio.Agregar(E) == false)
            {
                MessageBox.Show("Error al agregar");
                return;
            }
            this.lstEspecialidades.DataSource = especialidadNegocio.Leer_Todas();

            for (int i = 0; i < this.lstEspecialidades.Items.Count; i++)
            {
                Especialidad aux = (Especialidad)this.lstEspecialidades.Items[i];
                if (aux.nombre.CompareTo(nuevo.ToUpper()) == 0)
                {
                    this.lstEspecialidades.SelectedIndex = i;
                    break;
                }
            }
        }
        public override void GuardarCambios()
        {
            this.MapearADatos();
            EspecialidadNegocio espNeg = new EspecialidadNegocio();

            espNeg.Save(_EspActual);
        }
        private void button3_Click(object sender, EventArgs e)
        {
            EspecialidadNegocio especialidadNegocio = new EspecialidadNegocio();

            string nombreaux;

            nombreaux = E.nombre;
            if (especialidadNegocio.Eliminar(E) == false)
            {
                MessageBox.Show("Error al eliminar");
                return;
            }
            MessageBox.Show("Especialidad dada de baja");
            this.lstEspecialidades.DataSource = especialidadNegocio.Leer_Todas();


            for (int i = 0; i < this.lstEspecialidades.Items.Count; i++)
            {
                Especialidad aux = (Especialidad)this.lstEspecialidades.Items[i];

                if (aux.nombre.CompareTo(nombreaux) == 0)
                {
                    this.lstEspecialidades.SelectedIndex = i;
                    break;
                }
            }
            // if(this.lstEspecialidades.Items.Count>0) this.lstEspecialidades.SelectedIndex = 0;
        }
Example #7
0
        private void cargarCbEspecialidades()
        {
            EspecialidadNegocio en = new EspecialidadNegocio();

            cbEspecialidades.DataSource    = en.GetAll();
            cbEspecialidades.DisplayMember = "DescripcionEspecialidad";
            cbEspecialidades.ValueMember   = "Id";
        }
Example #8
0
        private void frmElegirEspecialidadMedico_Load(object sender, EventArgs e)
        {
            EspecialidadNegocio especialidadNegocio = new EspecialidadNegocio();


            this.lstEspecialidades.DataSource    = especialidadNegocio.Leer_Activas();
            this.lstEspecialidades.SelectedIndex = 0;
        }
        public EspecialidadEscritorio_(int ID, ModoForm modo) : this()
        {
            Modo = modo;
            EspecialidadNegocio esp = new EspecialidadNegocio();

            EspActual = esp.GetOne(ID);
            this.MapearDeDatos();
        }
Example #10
0
        public void CargaDropDownListEspecialidades()
        {
            EspecialidadNegocio en = new EspecialidadNegocio();

            this.EspecialidadesDropDownList.DataSource     = en.GetAll();
            this.EspecialidadesDropDownList.DataValueField = "Id";
            this.EspecialidadesDropDownList.DataTextField  = "DescripcionEspecialidad";
            this.EspecialidadesDropDownList.DataBind();
            this.EspecialidadesDropDownList.Items.Insert(0, new ListItem("Seleccione Especialidad.", "0"));
        }
        private void frmAbmEspecialidades_Load(object sender, EventArgs e)
        {
            EspecialidadNegocio especialidadNegocio = new EspecialidadNegocio();

            this.chbBaja.Visible = false;

            this.lstEspecialidades.DataSource    = especialidadNegocio.Leer_Todas();
            this.lstEspecialidades.SelectedIndex = 0;

            int id = Convert.ToInt32(Usuario.TipoUser.especialidades);

            if (id == 1)
            {
                this.btnAgregar.Enabled   = false;
                this.btnModificar.Enabled = false;
                this.button3.Enabled      = false;
            }
        }
Example #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            paciente = (Paciente)this.Session["paciente"];

            if (paciente == null)
            {
                Response.Redirect("~/Index.aspx");
            }

            if (this.ddlEspecialidad.Items.Count == 0)
            {
                if (this.Session["espe"] == null)
                {
                    this.Session.Add("espe", false);
                }
                else
                {
                    this.Session["espe"] = false;
                }
            }
            this.TN = new TurnosNegocio();
            EspecialidadNegocio especilidadesN = new EspecialidadNegocio();

            this.especialidades = especilidadesN.Leer_Activas();

            try
            {
                if (this.Session["espe"].Equals(false))
                {
                    this.ddlEspecialidad.DataSource     = this.especialidades;
                    this.ddlEspecialidad.DataTextField  = "nombre";
                    this.ddlEspecialidad.DataValueField = "id";
                    this.ddlEspecialidad.DataBind();

                    this.ddlEspecialidad.SelectedIndex = 0;
                    this.LlenarMedicos(this.especialidades.ElementAt(0).id);

                    this.Session["espe"] = true;
                }
            }
            catch (Exception ex)
            {
            }
        }
        private bool Existe(string nombre)
        {
            EspecialidadNegocio especialidadN = new EspecialidadNegocio();

            List <Especialidad> aux = especialidadN.Leer_Todas();

            for (int i = 0; i < aux.Count; i++)
            {
                Especialidad aux2 = (Especialidad)aux.ElementAt(i);
                if (aux2.nombre.CompareTo(nombre.ToUpper()) == 0)
                {
                    if (aux2.id != this.E.id)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Example #14
0
        public void Listar()
        {
            EspecialidadNegocio en = new EspecialidadNegocio();

            this.dgvEspecialidades.DataSource = en.GetAll();
        }