Esempio n. 1
0
        /// <summary>
        /// Carrega o quadro de horários
        /// </summary>
        private void CarregarQuadro()
        {
            // Recupera os dados da turma
            DataTable dtTurma = TUR_TurmaBO.SelectBY_tur_id(VS_tur_id, __SessionWEB.__UsuarioWEB.Usuario.ent_id);

            string turma      = dtTurma.Rows[0]["tur_codigo"].ToString();
            string escola     = dtTurma.Rows[0]["tur_escolaUnidade"].ToString();
            string calendario = dtTurma.Rows[0]["tur_calendario"].ToString();
            string curso      = dtTurma.Rows[0]["tur_curso"].ToString();
            string turno      = dtTurma.Rows[0]["tur_turno"].ToString();

            Type objType = typeof(eDiasSemana);

            FieldInfo[] propriedades = objType.GetFields();
            foreach (FieldInfo objField in propriedades)
            {
                DescriptionAttribute[] attributes = (DescriptionAttribute[])objField.GetCustomAttributes(typeof(DescriptionAttribute), false);

                if (attributes.Length > 0)
                {
                    hdnDiasSemana.Value += CustomResource.GetGlobalResourceObject("Enumerador", attributes[0].Description) + ";";
                }
            }

            UCComboTipoHorario.Carregar();

            UCCTurmaDisciplina.CarregarTurmaDisciplina(VS_tur_id, true);
            UCCTurmaDisciplina.PermiteEditar = false;

            VS_lstTurmaHorario = TUR_TurmaHorarioBO.SelecionaPorTurma(VS_tur_id);

            CarregarCalendario();

            lblDados.Text = string.Format(CustomResource.GetGlobalResourceObject("Turma", "Turma.QuadroHorarios.lblDados.Text"), turma, escola, calendario, curso, turno);
        }
Esempio n. 2
0
        public TUR_TurmaHorarioDTO Get(int trn_id, int trh_id, int thr_id, long tud_id)
        {
            try
            {
                TUR_TurmaHorarioDTO dto = TUR_TurmaHorarioBO.SelecionarTurmaHorarioPorId(trn_id, trh_id, thr_id, tud_id);

                if (dto != null)
                {
                    return(dto);
                }
            }
            catch (Exception e)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)
                {
                    Content = new StringContent("Erro: " + e.Message)
                });
            }

            throw new HttpResponseException(HttpStatusCode.NotFound);
        }
Esempio n. 3
0
        public List <TUR_TurmaHorarioDTO> GetAll()
        {
            try
            {
                List <TUR_TurmaHorarioDTO> dto = TUR_TurmaHorarioBO.SelecionarTurmaHorario();

                if (dto != null && dto.Count > 0)
                {
                    return(dto);
                }
            }
            catch (Exception e)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)
                {
                    Content = new StringContent("Erro: " + e.Message)
                });
            }

            throw new HttpResponseException(HttpStatusCode.NotFound);
        }