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; } }
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)); }
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(); }