public void GetModels() { Cursor.Current = Cursors.WaitCursor; try { List <Model> modelList = MDSWrapper.ModelGet(); this.cbModel.Items.Clear(); if (modelList != null && modelList.Count > 0) { foreach (MdmDataContractOfIdentifier contractOfIdentifier in modelList) { this.cbModel.Items.Add((object)contractOfIdentifier.Identifier); } this.cbModel.DisplayMember = "Name"; } else { this.lblError.Text = "can't retrieve models or no models to display"; } } catch (Exception ex) { this.lblError.Text = ex.Message; throw ex; } finally { Cursor.Current = Cursors.Default; } }
public void GetModels() { try { List <Model> modelList = MDSWrapper.ModelGet(); this.cbModel.Items.Clear(); if (modelList != null && modelList.Count > 0) { foreach (MdmDataContractOfIdentifier contractOfIdentifier in modelList) { this.cbModel.Items.Add((object)contractOfIdentifier.Identifier); } this.cbModel.DisplayMember = "Name"; } else { statusStrip1.Text = "can't retrieve models or no models to display"; } } catch (Exception exc) { statusStrip1.Text = exc.Message; } }