protected virtual void OnBtnNewClick( object sender, System.EventArgs e) { IBusinessObject bo; try { Cursor.Current = Cursors.WaitCursor; // KD - The second time you added a new record wasn//t clearing the combobox until there were // two calls to set the SelectIndex cboSelect.SelectedIndex = -1; cboSelect.SelectedIndex = -1; bo = (IBusinessObject)Utility.InvokeSharedMethod( this.mBusinessObjectType, "New" + this.mBusinessObjectType.Name); mObject = bo; IEditUserControl ieuc = (IEditUserControl)this.mEditUserControl; ieuc.SetupControl(bo); Cursor.Current = Cursors.Default; } catch (Exception ex) { Cursor.Current = Cursors.Default; MessageBox.Show(ex.ToString()); } SetState(); this.mEditUserControl.Focus(); }
private void DisplayForEdits(System.EventArgs e, object pk) { IBusinessObject bo; System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor; bo = (IBusinessObject)Utility.InvokeSharedMethod( this.mBusinessObjectType, "Get" + this.mBusinessObjectType.Name, pk); mObject = bo; IEditUserControl ieuc = (IEditUserControl)this.mEditUserControl; ieuc.SetupControl((BusinessObjectSupport.IBusinessObject)bo); System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default; }