Exemplo n.º 1
0
 private void cbDisp_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
 {
     lab = (Laboratorio)cbDisp.SelectedValue;
     if (lab != null)
     {
         txtNomBL.Text = lab.Nombre;
         txtResB.Text = lab.Responsable;
     }
 }
Exemplo n.º 2
0
 private void AgregarLab(object sender, RoutedEventArgs e)
 {
     if (Utilidades.Validar(txtNomL,txtRes))
     {
         LaboratorioBLL labs = new LaboratorioBLL();
         lab = new Laboratorio()
         {
             Nombre = txtNomL.Text,
             Responsable = txtRes.Text
         };
         if (labs.Agregar(lab) != -1)
         {
             MessageBox.Show(this,"Laboratorio Agregado, OK ", appInfo.AssemblyProduct,
                 MessageBoxButton.OK, MessageBoxImage.Information);
             this.CargaLabs();
             Utilidades.Limpiar(txtNomL, txtRes);
         }
         else
             MessageBox.Show(this,"Se produjo un Error, Fail", appInfo.AssemblyProduct,
                 MessageBoxButton.OK, MessageBoxImage.Information);
     }
     else MessageBox.Show(this,"No debe de haber campos vacios", appInfo.AssemblyProduct,
                 MessageBoxButton.OK, MessageBoxImage.Information);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Escribe los datos del laboratorio en un archivo xml
        /// </summary>
        /// <param name="l">Fabrica a escribir</param>
        /// <param name="ruta">Ruta del archivo</param>
        /// <returns>True si fue exitoso, false si no</returns>
        public static bool Escribir(Laboratorio l, string ruta)
        {
            Xml <Laboratorio> escritor = new Xml <Laboratorio>();

            return(escritor.Escribir(ruta, l));
        }
Exemplo n.º 4
0
        private void FixupLaboratorio(Laboratorio previousValue)
        {
            if (previousValue != null && previousValue.Horario.Contains(this))
            {
                previousValue.Horario.Remove(this);
            }

            if (Laboratorio != null)
            {
                if (!Laboratorio.Horario.Contains(this))
                {
                    Laboratorio.Horario.Add(this);
                }
                if (IDLab != Laboratorio.ID)
                {
                    IDLab = Laboratorio.ID;
                }
            }
        }