Пример #1
0
        private void ListButton_Click(object sender, EventArgs e)
        {
            if (Navigate == true)
            {
                Dictionary <string, string> siteinfo = Functions.ReturnSiteInfo();
                var songlist = Functions.ReturnSongList(siteinfo);

                //Check if empty
                if (songlist.ToArray().Length == 0)
                {
                    //Nothing there. Failed Request.
                }
                else
                {
                    ShowBrowser();
                    Browser.Hide();
                    ListInfo.Show();
                    Download.Show();
                    DownloadAll.Show();
                    ProgressDisplay.Show();
                    label1.Text = "Music List";

                    ListInfo.DataSource = songlist;
                }
            }
        }
Пример #2
0
        private void InitFields()
        {
            var context = new PSOConnect();
            var team    = context.team.FirstOrDefault(teams => teams.idTeam == Login.CurrentUser.idTeam);

            foreach (var disaster in context.disaster)
            {
                SelectDisasterField.Items.Add($"{ disaster.idDisaster}-СТРАНА: { disaster.country} ГОРОД: { disaster.city} ДАТА: { disaster.date.Value.ToLongDateString()}");

                if (team.idDisaster == null || team.idDisaster != disaster.idDisaster)
                {
                    continue;
                }

                SelectDisasterField.SelectedItem = SelectDisasterField.Items[SelectDisasterField.Items.Count - 1];

                _disaster = disaster;

                CountyResultText.Text = disaster.country.ToString();
                CityResultText.Text   = disaster.city.ToString();
                DateResultText.Text   = disaster.date.Value.ToShortDateString();
                ReasonText.Text       = disaster.reason.Count > 1 ? "Причины" : "Причина";

                foreach (var reason in disaster.reason)
                {
                    ListInfo.Items.Add($"ТИП: {reason.typeReason} ПРИЧИНА: {reason.reason1}");
                }
            }

            NoFoundDisasterText.Hide();

            if (team.idDisaster == null)
            {
                ListInfo.Hide();
                ReasonText.Hide();
                DateResultText.Hide();
                DateText.Hide();
                CountryText.Hide();
                CountyResultText.Hide();
                CityResultText.Hide();
                CityText.Hide();

                SelectDisasterField.Show();
                SelectDisasterText.Show();

                SelectedButton.Show();
                CompletedButton.Hide();

                if (SelectDisasterField.Items.Count > 0)
                {
                    SelectDisasterField.SelectedIndex = 0;
                }
                else
                {
                    SelectedButton.Hide();
                    NoFoundDisasterText.Show();
                    SelectDisasterField.Hide();
                }
            }
            else
            {
                ListInfo.Show();
                ReasonText.Show();
                DateResultText.Show();
                DateText.Show();
                CountryText.Show();
                CountyResultText.Show();
                CityResultText.Show();
                CityText.Show();

                SelectDisasterField.Hide();
                SelectDisasterText.Hide();

                SelectedButton.Hide();
                CompletedButton.Show();
            }

            if (SelectDisasterField.Items.Count == 0)
            {
                SelectDisasterField.Hide();
                NoFoundDisasterText.Show();
                CompletedButton.Hide();
            }
        }