示例#1
0
        private void PopulateTenants(string filter = "")
        {
            TenantDA      tenantDA = new TenantDA();
            List <Tenant> tenants  = tenantDA.GetActiveTenants(filter);

            DataGridViewTenants.Rows.Clear();
            DataGridViewPaymentDetails.Rows.Clear();

            int i = 0;

            while (i < tenants.Count)
            {
                DataGridViewRow row = new DataGridViewRow();
                row.CreateCells(DataGridViewTenants);
                row.Cells[0].Value = Helper.GetNepaliNumber(i + 1);
                row.Cells[1].Value = tenants[i].Fullname;
                row.Cells[2].Value = tenants[i].Address;
                row.Cells[3].Value = tenants[i].MobileNumber;
                row.Cells[4].Value = tenants[i].Father;

                // Store tenant_id as Tag
                row.Tag = tenants[i].TenantID.ToString();

                DataGridViewTenants.Rows.Add(row);
                i++;
            }
        }
        private void PopulateTenants()
        {
            TenantDA tenantDA = new TenantDA();

            ComboBoxTenant.DataSource    = tenantDA.GetActiveTenants();
            ComboBoxTenant.DisplayMember = "Fullname";
            ComboBoxTenant.ValueMember   = "TenantID";
        }