public static List<CatedraComision> GetCatedraComisionFiltered(Usuario loggedUser, BusquedaFiltro filter, int rol)
 {
     try
     {
         CatedraComisionDAO catedraComisionDAO = new CatedraComisionDAO(connectionString);
         return catedraComisionDAO.SelectAllByIdSedeAndFilters(loggedUser.IdSede, filter.IdDepartamento, filter.IdCarrera, filter.IdMateria, filter.FechaActual, rol);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #2
0
 public static List<Materia> GetMateriasBySedeAndFilters(Usuario loggedUser, BusquedaFiltro filter, int rol)
 {
     try
     {
         MateriaDAO materiasDAO = new MateriaDAO(connectionString);
         return materiasDAO.SelectAllBySedeAndFilters(loggedUser.IdSede, filter.IdDepartamento, filter.IdCarrera, filter.FechaActual, rol);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        /// <summary>
        /// Method to search the user filtered data
        /// </summary>
        private void SearchComboSelection()
        {
            try
            {
                if (comboMateria.SelectedIndex != 0)
                {
                    Session.Remove("catedras");
                    loggedUser = new Usuario();
                    loggedUser = (Usuario)Session["user"];
                    SetEstado(false);

                    rol = Session["userEmployee"] != null ? 1 : 2;

                    filtro = new BusquedaFiltro(Convert.ToInt32(comboDepartamento.SelectedValue), Convert.ToInt32(comboCarrera.SelectedValue), Convert.ToInt32(comboMateria.SelectedValue), DateTime.Now);
                    catedras = new List<CatedraComision>(CatedraComisionDTO.GetCatedraComisionFiltered(loggedUser, filtro, rol));

                    Session.Add("catedras", catedras);
                    GridResultados.DataSource = catedras;

                    if (GridResultados.DataSource != null)
                    {
                        setGridCatedrasHeaders();
                        divResultados.Visible = true;
                        GridResultados.DataBind();
                    }
                }
                else
                    SetEstado(false);
            }
            catch (Exception ex)
            {
                LogWriter log = new LogWriter();
                log.WriteLog(ex.Message, "SearchComboSelection", Path.GetFileName(Request.PhysicalPath));
                throw ex;
            }
        }
        /// <summary>
        /// Fill Combo Materia
        /// </summary>
        private void FillComboMateria()
        {
            try
            {
                loggedUser = new Usuario();
                loggedUser = (Usuario)Session["user"];
                rol = Session["userEmployee"] != null ? 1 : 2;
                filtro = new BusquedaFiltro(Convert.ToInt32(comboDepartamento.SelectedValue), Convert.ToInt32(comboCarrera.SelectedValue), DateTime.Now);

                comboMateria.DataTextField = COMBOTEXTFIELDMATERIA;
                comboMateria.DataValueField = COMBOVALUEFIELDMATERIA;
                comboMateria.DataSource = MateriaDTO.GetMateriasBySedeAndFilters(loggedUser, filtro, rol).Select(p => new { IdMateria = p.IdMateria, Descripcion = p.IdMateria.ToString() + "- " + p.Descripcion, IdDepartamento = p.IdDepartamento });
                comboMateria.DataBind();
                comboMateria.Items.Insert(0, new ListItem(ConfigurationManager.AppSettings["ContentComboMateriaDefault"], "0"));
            }
            catch (Exception ex)
            {
                LogWriter log = new LogWriter();
                log.WriteLog(ex.Message, "FillComboMateria", Path.GetFileName(Request.PhysicalPath));
                throw ex;
            }
        }