コード例 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                loClientPersonalReference.Id              = lId;
                loClientPersonalReference.ClientId        = lClientId;
                loClientPersonalReference.Name            = GlobalFunctions.replaceChar(txtName.Text);
                loClientPersonalReference.Relationship    = cboRelationship.Text;
                loClientPersonalReference.CompleteAddress = GlobalFunctions.replaceChar(txtCompleteAddress.Text);
                loClientPersonalReference.SourceOfIncome  = GlobalFunctions.replaceChar(txtSourceOfIncome.Text);
                loClientPersonalReference.CellphoneNo     = GlobalFunctions.replaceChar(txtCellphoneNo.Text);
                loClientPersonalReference.Remarks         = GlobalFunctions.replaceChar(txtRemarks.Text);
                loClientPersonalReference.UserId          = GlobalVariables.UserId;

                string _Id = loClientPersonalReference.save(lOperation);
                if (_Id != "")
                {
                    MessageBoxUI _mb = new MessageBoxUI("Personal Reference has been saved successfully!", GlobalVariables.Icons.Save, GlobalVariables.Buttons.OK);
                    _mb.showDialog();
                    lFromSave = true;
                    this.Close();
                }
                else
                {
                    MessageBoxUI _mb = new MessageBoxUI("Failure to save the record!", GlobalVariables.Icons.Error, GlobalVariables.Buttons.OK);
                    _mb.showDialog();
                    return;
                }
            }
            catch (Exception ex)
            {
                ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "btnSave_Click");
                em.ShowDialog();
                return;
            }
        }