Ejemplo n.º 1
0
        private void DeletePayment(IPayment payment, ItemControl ucPayments)
        {
            string message;

            message = "Are you sure you want to delete the selected item?";

            if (MessageBox.Show(message, "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                payment.Delete(((IPayment)ucPayments.SelectedRow).Id);

                ucPayments.PopulateList(new SortableBindingList<IPayment>(payment.GetPayments(_year, _week)));

                _modified = true;
            }
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
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();
        }