private void BindFormElements() { //Bind the Region Lookup (Zone and Woredas will be bind after selection Region) lkRegion.Properties.DataSource = BLL.Region.GetAllRegions().DefaultView; lkRegion.EditValue = regionId; //Bind the Receiving units Types Lookup InstitutionType institutionsTypes = new InstitutionType(); institutionsTypes.LoadAll(); institutionsTypes.Sort = "Name ASC"; lkType.Properties.DataSource = institutionsTypes.DefaultView; lkType.EditValue = ruType; //Bind the Ownership Type Lookup OwnershipType ownershipTypes = new OwnershipType(); ownershipTypes.LoadAll(); ownershipTypes.Sort = "Name ASC"; lkOwnership.Properties.DataSource = ownershipTypes.DefaultView; lkOwnership.EditValue = OwnershipType.Constants.Public; //Bind the Active lookup lkActive.Properties.ValueMember = lkActive.Properties.DisplayMember = "Column"; lkActive.Properties.DataSource = new string[3] { "All", "Active", "InActive" }; lkActive.ItemIndex = 0; //Bind the others LoadZones(); lkZone.EditValue = zoneID; LoadWoredas(); lkWoreda.EditValue = woredaID; LoadReceivingUnits(); }
private void LoadReceivingUnits() { BLL.Region reg = new BLL.Region(); reg.LoadAll(); lkRegion.Properties.DataSource = reg.DefaultView; BLL.InstitutionType ruType = new InstitutionType(); ruType.Where.IsActive.Value = 1; ruType.Query.Load(); lkRUType.Properties.DataSource = ruType.DefaultView; BLL.OwnershipType ownershipType = new OwnershipType(); ownershipType.LoadAll(); lkOwnership.Properties.DataSource = ownershipType.DefaultView; Route r = new Route(); r.LoadAll(); lkRoute.Properties.DataSource = r.DefaultView; }