Exemplo n.º 1
0
        public PaymentCategoryForm(Common.MFType mfType, IPaymentCategory paymentCategory)
        {
            InitializeComponent();

            _paymentCategory = paymentCategory;

            this.Text = string.Format(this.Text, Common.MFTypes[(int)mfType]);
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
0
        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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 8
0
 public AddEditPaymentForm(Common.MFType mfType, IPaymentType paymentType, DateTime paymentDate)
     : this(mfType, paymentType)
 {
     dtpPaymentDate.Value = paymentDate;
 }