Esempio n. 1
0
        private void ListCompanyBank()
        {
            try
            {
                grdList.Rows.Clear();
                CompanyBankDB      cadb   = new CompanyBankDB();
                List <companybank> caList = cadb.getCompBankList();
                //BindingSource src = new BindingSource();
                //src.DataSource = caList;
                //grdList.DataSource = caList;
                foreach (companybank ca in caList)
                {
                    //grdList.Rows.Add(ca.CompanyID, ca.CompanyName, ca.AddressType, ca.Address,
                    //     getStatusString(ca.Status), ca.CreateTime, ca.CreateUser);

                    grdList.Rows.Add();
                    grdList.Rows[grdList.RowCount - 1].Cells["ROWID"].Value       = ca.RowID;    // Stores Company Bank RowID
                    grdList.Rows[grdList.RowCount - 1].Cells["BranchID"].Value    = ca.branchID; // Stores bank Branch RowID
                    grdList.Rows[grdList.RowCount - 1].Cells["CompanyID"].Value   = ca.CompanyID;
                    grdList.Rows[grdList.RowCount - 1].Cells["Company"].Value     = ca.CompanyName;
                    grdList.Rows[grdList.RowCount - 1].Cells["Bank"].Value        = ca.BankID;
                    grdList.Rows[grdList.RowCount - 1].Cells["Branch"].Value      = ca.BranchName;
                    grdList.Rows[grdList.RowCount - 1].Cells["AccountType"].Value = ca.AccountType;
                    grdList.Rows[grdList.RowCount - 1].Cells["AccountCode"].Value = ca.AccountCode;
                    grdList.Rows[grdList.RowCount - 1].Cells["CreateTime"].Value  = ca.CreateTime;
                    grdList.Rows[grdList.RowCount - 1].Cells["CreateUser"].Value  = ca.CreateUser;
                    grdList.Rows[grdList.RowCount - 1].Cells["Status"].Value      = getStatusString(ca.Status);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Error in Company Bank listing");
            }
            enableBottomButtons();
            pnlStateList.Visible = true;
        }