Beispiel #1
0
 private void loadDistricts()
 {
     //Load a list of district selections
     try {
         LocationDS locationDS = new LocationDS();
         LocationDS _ds        = CustomerProxy.GetDistricts(this.cboCompany.SelectedValue.ToString().PadLeft(6, '0').Substring(3, 3));
         for (int i = 0; i < _ds.LocationTable.Rows.Count; i++)
         {
             _ds.LocationTable[i].Location     = _ds.LocationTable[i].Location.ToString().Trim();
             _ds.LocationTable[i].LocationName = _ds.LocationTable[i].LocationName.ToString().Trim();
         }
         locationDS.Merge(_ds, true);
         this.cboLocation.DisplayMember = "LocationTable.LocationName";
         this.cboLocation.ValueMember   = "LocationTable.Location";
         this.cboLocation.DataSource    = locationDS;
     }
     catch (Exception ex) { throw new ControlException("Unexpected error while loading company districts.", ex); }
 }