Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            db = (DBPruebas)Session["db"];
            TextNombre.Focus();
            if (!IsPostBack)
            {
                // Dias
                for (int i=31; i > 0; i--){
                    DropDownListDias.Items.Insert(0, new ListItem(i.ToString(), (i > 9) ? i.ToString() : "0" + i));
                }
                DropDownListDias.SelectedIndex = 0;

                // Meses
                DropDownListMeses.Items.Insert(0, new ListItem("Diciembre", "12"));
                DropDownListMeses.Items.Insert(0, new ListItem("Noviembre", "11"));
                DropDownListMeses.Items.Insert(0, new ListItem("Octubre", "10"));
                DropDownListMeses.Items.Insert(0, new ListItem("Septiembre", "09"));
                DropDownListMeses.Items.Insert(0, new ListItem("Agosto", "08"));
                DropDownListMeses.Items.Insert(0, new ListItem("Julio", "07"));
                DropDownListMeses.Items.Insert(0, new ListItem("Junio", "06"));
                DropDownListMeses.Items.Insert(0, new ListItem("Mayo", "05"));
                DropDownListMeses.Items.Insert(0, new ListItem("Abril", "04"));
                DropDownListMeses.Items.Insert(0, new ListItem("Marzo", "03"));
                DropDownListMeses.Items.Insert(0, new ListItem("Febrero", "02"));
                DropDownListMeses.Items.Insert(0, new ListItem("Enero", "01"));
                DropDownListMeses.SelectedIndex = 0;

                for (int i = 1900; i <= DateTime.Now.Year; i++)
                {
                    DropDownListAnios.Items.Insert(0, new ListItem(i.ToString(), i.ToString()));
                }
                DropDownListAnios.SelectedIndex = 0;
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     db = (DBPruebas)Session["db"];
     TextBuscar.Focus();
     if (!IsPostBack)
     {
         ListBoxEncontrados.Items.Insert(0, new ListItem("Expediente a mostrar", "0"));
         ListBoxEncontrados.SelectedIndex = 0;
     }
 }
Beispiel #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["basededatos"] == null)
     {
         basededatos = new DBPruebas();
         basededatos.cargaDatosIniciales();
         Session["basededatos"] = basededatos;
     }
     else
     {
         basededatos = (ICapaDatos)Session["basededatos"];
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            db = (DBPruebas)Session["db"];
            int nexp = 0;
            int.TryParse((String)Session["nexp"], out nexp);
            exp = db.selectExpediente(nexp);
            box = db.selectBox(exp);
            if (box != null) DropDownListTipoDiagnostico.Focus();
            else DropDownListEspecialidad.Focus();

            if (!IsPostBack)
            {
                TextBoxNExp.Text = "" + exp.NExpediente;
                TextBoxNombreYApellidos.Text = exp.Nombre + " " + exp.Apellido;
                TextBoxSexo.Text = exp.Sexo.ToString();
                string edad = (new DateTime(DateTime.Now.Subtract(exp.FechaNac).Ticks).Year - 1).ToString();
                TextBoxEdad.Text = (edad != "0") ? edad + " años" : (new DateTime(DateTime.Now.Subtract(exp.FechaNac).Ticks).Month - 1).ToString() + " meses";
                rellenarDiagnostico();

                if(box != null)
                {
                    TextBoxBox.Text = "" + box.IdBox;
                    DropDownListEspecialidad.Items.Insert(0, new ListItem(exp.Especialidad.Nombre, "0"));
                    DropDownListEspecialidad.Enabled = false;
                    DropDownListMedico.Items.Insert(0, new ListItem(exp.Medico.Nombre + " " + exp.Medico.Apellido, "0"));
                    DropDownListMedico.Enabled = false;
                    if(exp.TipoDiagnostico != null)
                    {
                        DropDownListTipoDiagnostico.SelectedValue = exp.TipoDiagnostico;
                        TextBoxDiagnostico.Text = exp.Diagnostico;
                        TextBoxTratamiento.Text = exp.Tratamiento;
                    }
                }
                else
                {
                    foreach (Especialidad esp in db.selectAllEspecialidades())
                    {
                        DropDownListEspecialidad.Items.Insert(DropDownListEspecialidad.Items.Count, new ListItem(esp.Nombre, esp.Nombre));
                    }
                    if(exp.Especialidad != null)
                        DropDownListEspecialidad.SelectedValue = "" + exp.Especialidad.Nombre;
                    TextBoxBox.Text = "Ninguno";
                    rellenarMedicos(db.selectEspecialidad(DropDownListEspecialidad.SelectedItem.Text));
                    if (exp.Medico != null)
                        DropDownListMedico.SelectedValue = "" + exp.Medico.DniMedico;
                    DropDownListTipoDiagnostico.Enabled = false;
                    TextBoxDiagnostico.Enabled = false;
                    TextBoxTratamiento.Enabled = false;
                }
            }
        }
Beispiel #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     db = (DBPruebas)Session["db"];
     ListBoxBoxesLibres.Focus();
     if (!IsPostBack)
     {
         IList<Box> boxes = (IList<Box>)db.selectAllBoxes();
         Expediente exp;
         for (int i=0; i < boxes.Count; i++)
         {
             exp = db.selectExpediente(boxes[i]);
             if(exp != null)
             {
                 String text = "IDBOX " + boxes[i].IdBox + ",   EXP " + exp.NExpediente + ", "+ exp.Nombre + " " + exp.Apellido;
                 ListBoxBoxesOcupados.Items.Add(text);
             } else
             {
                 String text = "" + boxes[i].IdBox;
                 ListBoxBoxesLibres.Items.Insert(0, new ListItem(text, "" + boxes[i].IdBox));
             }
         }
     }
 }
Beispiel #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     db = (DBPruebas)Session["db"];
     TextDni.Focus();
 }