Пример #1
0
        private void Form_PublisherRetrieve_Load(object sender, EventArgs e)
        {
            countryList = db_country.SearchAllCountries(Conn.Connection);
            foreach (Country c in countryList)
            {
                if (c.ShowCountry.Equals("Yes"))
                {
                    box_country.Items.Add(c.CountryName);
                }
            }
            box_country.Items.Add("Show All");

            int count = db_publusher.Count(Conn.Connection);

            if (count > 1)
            {
                label_publishersCount.Text = "There are " + count + " publishers registered.";
            }
            else if (count == 1)
            {
                label_publishersCount.Text = "There is " + count + " publisher registered.";
            }
            else
            {
                label_publishersCount.Text = "There are no registered publisher.";
            }
        }
Пример #2
0
        public void UpdateCountryBox()
        {
            CountryList.Clear();
            CountryList = DB_Country.SearchAllCountries(Conn.Connection);

            Box_Country.DataSource    = CountryList;
            Box_Country.ValueMember   = "Country_Id";
            Box_Country.DisplayMember = "CountryName";
        }
Пример #3
0
 private void Form_PublisherInsert_Load(object sender, EventArgs e)
 {
     countryList = db_country.SearchAllCountries(conn.Connection);
     foreach (Country c in countryList)
     {
         if (c.ShowCountry.Equals("Yes"))
         {
             box_country.Items.Add(c.CountryName);
         }
     }
     box_country.Items.Add("Show All");
 }
Пример #4
0
        private void button_retrieveAll_Click(object sender, EventArgs e)
        {
            table_countries.Rows.Clear();

            countryList.Clear();
            countryList = db_country.SearchAllCountries(conn.Connection);

            foreach (Country c in countryList)
            {
                table_countries.Rows.Add(c.Country_Id, c.CountryName, c.ShowCountry);
            }

            if (countryList.Count != 0)
            {
                button_edit.Enabled   = true;
                button_delete.Enabled = true;
            }
        }
Пример #5
0
        private void Form_AuthorRetrieve_Load(object sender, EventArgs e)
        {
            countryList = db_country.SearchAllCountries(Conn.Connection);
            foreach (Country c in countryList)
            {
                if (c.ShowCountry.Equals("Yes"))
                {
                    box_country.Items.Add(c.CountryName);
                }
            }
            box_country.Items.Add("Show All");

            languageList = db_language.SearchAllLanguages(Conn.Connection);
            foreach (Language l in languageList)
            {
                if (l.ShowLanguage.Equals("Yes"))
                {
                    box_language.Items.Add(l.LanguageName);
                }
            }
            box_language.Items.Add("Show All");

            int count = db_author.Count(Conn.Connection);

            if (count > 1)
            {
                label_authorCount.Text = "There are " + count + " authors registered.";
            }
            else if (count == 1)
            {
                label_authorCount.Text = "There is " + count + " author registered.";
            }
            else
            {
                label_authorCount.Text = "There are no registered authors.";
            }
        }