Esempio 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;
            }
        }
Esempio n. 2
0
        public ViewResult Details(int id)
        {
            List <Guarantor> guard = _guarantorRepo.GetGuarantor(id).ToList();
            List <Payment>   pay   = _payment.GetPayments(id).ToList();

            HomeDetailsViewModel viewmodel = new HomeDetailsViewModel()
            {
                student    = _er.GetStudent(id),
                guarantors = guard,
                payment    = pay,
                PageTitle  = "Student Details"
            };

            return(View(viewmodel));
        }
Esempio n. 3
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();
        }
Esempio n. 4
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();
        }