public PaymentCategoryForm(Common.MFType mfType, IPaymentCategory paymentCategory)
        {
            InitializeComponent();

            _paymentCategory = paymentCategory;

            this.Text = string.Format(this.Text, Common.MFTypes[(int)mfType]);
        }
        public AddEditPaymentForm(Common.MFType mfType, IPaymentType paymentType)
        {
            InitializeComponent();

            this.Text = Common.TextAdd;

            grpPayment.Text = string.Format(grpPayment.Text, Common.MFTypes[(int)mfType]);
            lstPaymentTypes.DataSource = paymentType.GetTypes();
        }
        public AddEditPaymentForm(Common.MFType mfType, IPaymentType paymentType, IPayment payment)
            : this(mfType, paymentType)
        {
            this.Text = Common.TextEdit;

            lstPaymentTypes.Text = payment.TypeName;
            dtpPaymentDate.Value = payment.PaymentDate;
            txtAmount.Text = payment.Amount.ToString(Common.FormatMoney);
            txtComment.Text = payment.Comment;
        }
        public SearchPaymentForm(Common.MFType mfType, IPayment payment, IPaymentCategory paymentCategory, IPaymentType paymentType)
        {
            List<IPaymentCategory> paymentCategories;

            InitializeComponent();

            _MFType = mfType;
            _payment = payment;
            _paymentType = paymentType;

            if (mfType == Common.MFType.Expense)
            {
                this.Text = string.Format(this.Text, "Expenses");
            }
            else
            {
                this.Text = string.Format(this.Text, Common.MFTypes[(int)mfType]);
            }

            paymentCategories = paymentCategory.GetCategories();
            paymentCategories.Insert(0, paymentCategory.CreateCategory(_ListItemAll));

            cboCategories.DataSource = paymentCategories;
        }
        private void ShowEditPaymentForm(IPayment payment, ItemControl ucPayments, Common.MFType mfType, IPaymentType paymentType)
        {
            AddEditPaymentForm paymentForm;
            IPayment selectedPayment;

            selectedPayment = (IPayment)ucPayments.SelectedRow;

            paymentForm = new AddEditPaymentForm(mfType, paymentType, selectedPayment);

            if (paymentForm.ShowDialog() == DialogResult.OK)
            {
                payment.Edit(selectedPayment.Id, paymentForm.TypeId, paymentForm.PaymentDate, paymentForm.Amount, paymentForm.Comment);
                ucPayments.PopulateList(new SortableBindingList<IPayment>(payment.GetPayments(_year, _week)));

                _modified = true;
            }

            paymentForm.Dispose();
        }
        private void ShowAddPaymentForm(IPayment payment, Common.MFType mfType, IPaymentType paymentType, ItemControl grdPayments)
        {
            AddEditPaymentForm paymentForm;

            paymentForm = new AddEditPaymentForm(mfType, paymentType, _startDate);

            if (paymentForm.ShowDialog() == DialogResult.OK)
            {
                payment.Add(paymentForm.TypeId, paymentForm.PaymentDate, paymentForm.Amount, paymentForm.Comment);
                grdPayments.PopulateList(new SortableBindingList<IPayment>(payment.GetPayments(_year, _week)));

                _modified = true;
            }

            paymentForm.Dispose();
        }
Exemple #7
0
        private void ShowPaymentForm(IPayment payment, Common.MFType mfType, IPaymentType paymentType)
        {
            AddEditPaymentForm paymentForm;

            paymentForm = new AddEditPaymentForm(mfType, paymentType);

            if (paymentForm.ShowDialog() == DialogResult.OK)
            {
                payment.Add(paymentForm.TypeId, paymentForm.PaymentDate, paymentForm.Amount, paymentForm.Comment);

                _selectedYear = paymentForm.PaymentDate.Year;

                RefreshData();
            }

            paymentForm.Dispose();
        }
 public AddEditPaymentForm(Common.MFType mfType, IPaymentType paymentType, DateTime paymentDate)
     : this(mfType, paymentType)
 {
     dtpPaymentDate.Value = paymentDate;
 }