Exemplo n.º 1
0
        private void OnMenuClick(object sender, System.EventArgs e)
        {
            //Event handler fo menu item clicked
            try {
                ToolStripDropDownItem menu = (ToolStripDropDownItem)sender;
                switch (menu.Text)
                {
                case MNU_NEW: break;

                case MNU_OPEN:
                    dlgContact dlg = new dlgContact(this.mContact);
                    dlg.Font = this.Font;
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        if (CustomerProxy.UpdateContact(this.mContact))
                        {
                            this.ctxRefresh.PerformClick();
                        }
                    }
                    break;

                case MNU_REFRESH:
                    this.Cursor = Cursors.WaitCursor;
                    this.mContactDS.Clear();
                    this.mContactDS.Merge(CustomerProxy.GetContacts());
                    break;
                }
            }
            catch (Exception ex) { reportError(ex); }
            finally { setUserServices(); this.Cursor = Cursors.Default; }
        }
Exemplo n.º 2
0
 private void OnFormLoad(object sender, EventArgs e)
 {
     //Event handler for form laod event
     this.Cursor = Cursors.WaitCursor;
     try {
         this.mContactDS.Merge(CustomerProxy.GetContacts());
         this.grdContacts.DataBind();
     }
     catch (Exception ex) { reportError(ex); }
     finally { setUserServices(); this.Cursor = Cursors.Default; }
 }
Exemplo n.º 3
0
 private void OnAfterContactCreated(object source, ContactEventArgs e)
 {
     //Event handler for new contact created
     this.Cursor = Cursors.WaitCursor;
     try {
         //Persist the new contact
         int id = CustomerProxy.CreateContact(e.Contact);
         this.mContacts.Clear();
         this.mContacts.Merge(CustomerProxy.GetContacts());
         this.ctlContact.SelectedValue = id;
     }
     catch (Exception ex) { reportError(ex); }
     finally { this.Cursor = Cursors.Default; }
 }
Exemplo n.º 4
0
 private void OnFormLoad(object sender, EventArgs e)
 {
     //Event handler for form load event
     this.Cursor = Cursors.WaitCursor;
     try {
         this.mToolTip            = new System.Windows.Forms.ToolTip();
         this.mToolTip.ShowAlways = true;
         this.mToolTip.SetToolTip(this.cboIssueType, "Select an issue type.");
         this.cboIssueCategory.DataSource    = this.mIssueCategorys;
         this.cboIssueCategory.DisplayMember = "IssueTypeTable.Category";
         this.cboIssueCategory.ValueMember   = "IssueTypeTable.Category";
         this.mIssueCategorys.Merge(CustomerProxy.GetIssueCategorys());
         this.cboIssueType.DataSource        = this.mIssueTypes;
         this.cboIssueType.DisplayMember     = "IssueTypeTable.Type";
         this.cboIssueType.ValueMember       = "IssueTypeTable.ID";
         this.cboIssueCategory.SelectedIndex = 0;
         OnIssueCategorySelected(this.cboIssueCategory, EventArgs.Empty);
         this.ctlContact.DataSource = this.mContacts;
         this.mContacts.Merge(CustomerProxy.GetContacts());
         this.txtTitle.Text = this.mIssue.Subject;
     }
     catch (Exception ex) { reportError(ex); }
     finally { this.btnOk.Enabled = false; this.Cursor = Cursors.Default; }
 }
Exemplo n.º 5
0
 private void refreshContacts()
 {
     //
     this.mContactDS.Clear();
     this.mContactDS.Merge(CustomerProxy.GetContacts());
 }