コード例 #1
0
        public ProgramasActualizar(ProgramaEstudio programa)
        {
            try
            {
                InitializeComponent();
                lblNombre.Content = AuthUser.nombre;
                if (programa != null)
                {
                    txtNombre.Text             = programa.nomb_programa;
                    txtDesc.Text               = programa.desc_programa;
                    txtMaxA.Text               = programa.cant_max_alumnos.ToString();
                    txtMinA.Text               = programa.cant_min_alumnos.ToString();
                    txtCEL.Text                = programa.cel.nom_centro;
                    dpFechInicio.SelectedDate  = programa.fech_inicio;
                    dpFechTermino.SelectedDate = programa.fech_termino;

                    prog = programa;
                }
            }
            catch (Exception)
            {
                Menu menu = new Menu();
                menu.Show();
                this.Close();
            }
        }
コード例 #2
0
        private bool validaciones()
        {
            try
            {
                int             value;
                ProgramaEstudio p           = new ProgramaEstudio();
                bool            nombre      = !(txtNombre.Text == null || txtNombre.Text.Equals(String.Empty));
                bool            descripcion = !(txtDesc.Text == null || txtDesc.Text.Equals(String.Empty));
                bool            numMin      = !(txtMinA.Text == null || txtMinA.Text.Equals(String.Empty) || !int.TryParse(txtMinA.Text, out value));
                bool            numMax      = !(txtMaxA.Text == null || txtMaxA.Text.Equals(String.Empty) || !int.TryParse(txtMaxA.Text, out value));
                bool            fechInicio  = (dpFechInicio.SelectedDate != null && p.validaFechaInicio((DateTime)dpFechInicio.SelectedDate));
                bool            fechTermino = (dpFechInicio.SelectedDate != null && dpFechTermino.SelectedDate != null &&
                                               p.validaFechaTermino((DateTime)dpFechInicio.SelectedDate, (DateTime)dpFechTermino.SelectedDate));

                lblNombrePost.Content  = nombre ? "" : "*";
                lblDescripcion.Content = descripcion ? "" : "*";
                lblMinNum.Content      = numMin ? "" : "*";
                lblMaxNum.Content      = numMax ? "" : "*";
                lblFechInicio.Content  = fechInicio ? "" : "*";
                lblFechTermino.Content = fechTermino ? "" : "*";

                bool valido = true && nombre && descripcion && numMin && numMax && fechInicio && fechTermino;
                return(valido);
            }
            catch (Exception)
            {
                return(false);
            }
        }
コード例 #3
0
        public CursoAgregar()
        {
            try
            {
                InitializeComponent();
                lblNombre.Content = AuthUser.nombre;

                ProgramaEstudio p            = new ProgramaEstudio();
                List <Object>   lstProgramas = p.GetProgramasEstudiosCEL();
                if (lstProgramas == null)
                {
                    lstProgramas = new List <Object>();
                    lstProgramas.Add(new List <Object>());
                    lstProgramas.Add(new List <Object>());
                }
                List <Object> vigentes = (List <Object>)lstProgramas[0];

                cbPrograma.SelectedValuePath = "Key";
                cbPrograma.DisplayMemberPath = "Value";
                foreach (ProgramaEstudio pe in vigentes)
                {
                    cbPrograma.Items.Add(new KeyValuePair <int?, string>(pe.id_programa, pe.nomb_programa));
                }
                cbPrograma.SelectedIndex = 0;
            }
            catch (Exception)
            {
                Menu menu = new Menu();
                menu.Show();
                this.Close();
            }
        }
コード例 #4
0
 private void lstVigentes_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         programa = (ProgramaEstudio)lstVigentes.SelectedItem;
     }
     catch (Exception)
     {
         programa = null;
     }
 }
コード例 #5
0
        public CursoActualizar(Cursos curso)
        {
            try
            {
                InitializeComponent();
                lblNombre.Content = AuthUser.nombre;

                ProgramaEstudio p            = new ProgramaEstudio();
                List <Object>   lstProgramas = p.GetProgramasEstudiosCEL();
                if (lstProgramas == null)
                {
                    lstProgramas = new List <Object>();
                    lstProgramas.Add(new List <Object>());
                    lstProgramas.Add(new List <Object>());
                }
                List <Object> vigentes = (List <Object>)lstProgramas[0];

                cbPrograma.SelectedValuePath = "Key";
                cbPrograma.DisplayMemberPath = "Value";
                foreach (ProgramaEstudio pe in vigentes)
                {
                    cbPrograma.Items.Add(new KeyValuePair <int?, string>(pe.id_programa, pe.nomb_programa));
                }

                if (curso != null)
                {
                    txtCupo.Text             = curso.cupos.ToString();
                    txtDesc.Text             = curso.desc_curso;
                    cbPrograma.SelectedValue = curso.id_programa;
                    cur = curso;
                }
            }
            catch (Exception)
            {
                Menu menu = new Menu();
                menu.Show();
                this.Close();
            }
        }
コード例 #6
0
        public Programas_estudio()
        {
            try
            {
                InitializeComponent();
                lblNombre.Content = AuthUser.nombre;

                ProgramaEstudio p            = new ProgramaEstudio();
                List <Object>   lstProgramas = p.GetProgramasEstudiosCEL();
                // aca se  recibe
                if (lstProgramas == null)
                {
                    lstProgramas = new List <Object>();
                    lstProgramas.Add(new List <Object>());
                    lstProgramas.Add(new List <Object>());
                }
                List <Object> vigentes    = (List <Object>)lstProgramas[0];
                List <Object> finalizados = (List <Object>)lstProgramas[1];

                foreach (ProgramaEstudio v in vigentes)
                {
                    lstVigentes.Items.Add(v);
                }

                foreach (ProgramaEstudio f in finalizados)
                {
                    lstFinalizados.Items.Add(f);
                }
            }
            catch (Exception)
            {
                Menu menu = new Menu();
                menu.Show();
                this.Close();
            }
        }