Esempio n. 1
0
        private async void listSeries(SerieQueryParameters filters)
        {
            try
            {
                var apiPath = RestService.For <ApiService>(Routes.baseUrl);
                if (filters == null)
                {
                    var dataResponse = await apiPath.GetSeriesAsync();

                    series = JsonConvert.DeserializeObject <SeriesApiResponse[]>(dataResponse.ToString());
                }
                else
                {
                    var dataResponse = await apiPath.GetSeriesFilteredAsync(filters);

                    series = JsonConvert.DeserializeObject <SeriesApiResponse[]>(dataResponse.ToString());
                }

                loadingText.Visible    = false;
                loadingCircle1.Visible = false;


                if (series.Length == 0)
                {
                    Label noSeries = new Label();
                    noSeries.Name     = "noSeries";
                    noSeries.Text     = "Não há séries cadastradas!";
                    noSeries.Font     = new Font(Styles.defaultFont.FontFamily, Convert.ToInt32(Styles.defaultFont.SizeInPoints));
                    noSeries.AutoSize = true;
                    noSeries.Location = new Point(20, 20);
                    centralPanel.Controls.Add(noSeries);
                }
                else
                {
                    int i;
                    for (i = 0; i < series.Length; i++)
                    {
                        SeriesApiResponse serieData = series[i];

                        Series serie = new Series(serieData.Id, serieData.Curso, serieData.Tipo, serieData.Ano, serieData.Periodo, serieData.Sigla, serieData._count.Turmas, i);
                        centralPanel.Controls.Add(serie.getSeriePanel());
                    }
                    Panel panel = new Panel();
                    panel.Size     = new Size(1, 20);
                    panel.Location = new Point(20, (20 + Styles.seriesSize.Height) * (i));
                    centralPanel.Controls.Add(panel);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ocorreu um erro durante a conexão com a base de dados. " + ex.Message);
            }
        }
Esempio n. 2
0
 private void comboBox01_Serie_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox01_Serie.SelectedItem.Equals(""))
     {
         filterSelectedSerie = null;
         return;
     }
     foreach (SeriesApiResponse serie in series)
     {
         if (serie.Sigla == comboBox01_Serie.SelectedItem.ToString())
         {
             filterSelectedSerie = serie;
         }
     }
 }
Esempio n. 3
0
        public Form5(Form1 parentForm)
        {
            InitializeComponent();

            this.ControlBox = false; //Ocultar barra superior
            this.BackColor  = Styles.darkGray;
            this.ForeColor  = Styles.white;
            this.parentForm = parentForm;

            filterSelectedSerie   = null;
            filterSelectedTeacher = null;

            siglaSerieList = new List <string>();
            idSerieList    = new List <int>();

            siglaTeacherList = new List <string>();
            rgTeacherList    = new List <string>();
        }