示例#1
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();
        }