コード例 #1
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     try
     {
         _customerPresenter.Save();
     }
     catch (Exception ex)
     {
         showException(ex);
     }
 }
コード例 #2
0
        protected override int SaveData()
        {
            switch (AccountingObjectCategoryId)
            {
            case 0:
                IdResult = _vendorPresenter.Save();
                break;

            case 2:
                IdResult = _accountingObjectPresenter.Save();
                break;

            case 3:
                IdResult = _customerPresenter.Save();
                break;

            default:
                IdResult = 0;
                break;
            }
            return(IdResult);
        }
コード例 #3
0
ファイル: FormCustomer.cs プロジェクト: sidiqahmed/GoF
        /// <summary>
        /// Validates user input and, if valid, closes window.
        /// </summary>
        private void buttonSave_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(CompanyName) ||
                String.IsNullOrEmpty(City) ||
                String.IsNullOrEmpty(Country))
            {
                // Do not close the dialog
                MessageBox.Show("All fields are required");
                return;
            }

            try
            {
                _customerPresenter.Save();
                this.Close();
            }
            catch (ApplicationException ex)
            {
                MessageBox.Show(ex.Message, "Save failed");
                _cancelClose = true;
            }
        }
コード例 #4
0
 /// <summary>
 /// Saves the data.
 /// </summary>
 /// <returns></returns>
 protected override int SaveData()
 {
     return(_customerPresenter.Save());
 }