示例#1
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            try
            {
                string         newID     = Guid.NewGuid().ToString();
                FrmRegBusiness frmRegDlg = new FrmRegBusiness(newID, true);
                if (frmRegDlg.ShowDialog() == DialogResult.OK)
                {
                    businessDataSet.GetBusinessRegByID(newID);
                    int i = tW_BusinessRegBindingSource.Find("TW_BusinessRegID", newID);
                    tW_BusinessRegBindingSource.Position = i;
                }

                businessDataSet.DBHelper.WangDaSer.UpdateCUserID();
            }
            catch (Exception ex)
            {
                UserMessages.ShowInfoBox(ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
示例#2
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     try
     {
         DataRowView rv = tW_BusinessRegBindingSource.Current as DataRowView;
         if (rv != null)
         {
             string         newID     = rv["TW_BusinessRegID"].ToString();
             FrmRegBusiness frmRegDlg = new FrmRegBusiness(newID, false);
             if (frmRegDlg.ShowDialog() == DialogResult.OK)
             {
                 businessDataSet.GetBusinessRegByID(newID);
                 int i = tW_BusinessRegBindingSource.Find("TW_BusinessRegID", newID);
                 tW_BusinessRegBindingSource.Position = i;
             }
         }
     }
     catch (Exception ex)
     {
         UserMessages.ShowInfoBox(ex.Message);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }