Exemple #1
0
        private void displayCompanyList()
        {
            try
            {
                lvOfCompanies.Items.Clear();
                companyList = CompanyDB.GetInvoicesDue();

                if (companyList.Count > 0)
                {
                    Company company;
                    for (int i = 0; i < companyList.Count; i++)
                    {
                        company = companyList[i];
                        lvOfCompanies.Items.Add(company.CompanyId);
                        lvOfCompanies.Items[i].SubItems.Add(company.CompanyName);
                        lvOfCompanies.Items[i].SubItems.Add(company.CompanyVolatility);
                        lvOfCompanies.Items[i].SubItems.Add(company.CategoryVolatility);
                        lvOfCompanies.Items[i].SubItems.Add(company.Curprice);
                    }
                }
                lvOfCompanies.Refresh();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.GetType().ToString());
                this.Close();
            }
        }
Exemple #2
0
        private void refreshCompanyList()
        {
            if (companyList.Count > 0)
            {
                for (int i = 0; i < companyList.Count; i++)
                {
                    companyList.RemoveAt(i);
                }
            }

            try
            {
                companyList = CompanyDB.GetInvoicesDue();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.GetType().ToString());
                this.Close();
            }
        }