コード例 #1
0
        private void btnAddUpdateDotation_Click(object sender, System.Windows.RoutedEventArgs e)
		{
            string dotationAmountText = txtDotationAmount.Text.Trim();
            decimal dotationAmount;

            if (AreValidFields(dotationAmountText, out dotationAmount) == false)
            {
                return;
            }

            if (_isUpdateDotation)
            {
                _dotationToUpdate.DotationDate = DateTime.Now;
                _dotationToUpdate.Amount = dotationAmount;

                UpdateDotation(_dotationToUpdate);
            }
            else
            {
                Model.Dotation dotationToAdd = new Model.Dotation()
                {
                    DotationDate = DateTime.Now,
                    Amount = dotationAmount,
                    UserId = null,
                    SignedDate = null
                };

                AddDotation(dotationToAdd);
            }
		}
コード例 #2
0
        public ViewDotationModal(Model.Dotation dotationToView)
		{
			this.InitializeComponent();

            _dotationToView = dotationToView;
            LoadDotationInfo();
		}
コード例 #3
0
        public AddEditDotationsModal(Model.Dotation dotationToUpdate)
		{
			this.InitializeComponent();

            _dotationToUpdate = dotationToUpdate;
            _isUpdateDotation = dotationToUpdate != null;

            if (_isUpdateDotation)
            {
                PrepareWindowForUpdates();
            }
		}