public ActionResult Create(SchoolFeesAccount model) { try { // model.Amount = theFeetoBeApproved.Paid; model.ApprovedBy = User.Identity.Name; model.BankDraftNumber = ""; model.ChequeNumber = ""; model.DateApproved = DateTime.Now; model.EnteredBy = User.Identity.Name; model.PaidDate = DateTime.Now; model.POSTransactionNumber = ""; model.StudentID = 0; model.TellerNumber = ""; model.TransactionMethod = ""; model.TransactionType = "Credit"; model.Session = ""; work.SchoolFeesAccountRepository.Insert(model); work.Save(); // TODO: Add insert logic here return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit2(int id) { try { SchoolFeePayment theFeetoBeApproved = work.SchoolFeePaymentRepository.GetByID(id); theFeetoBeApproved.Approved = true; work.SchoolFeePaymentRepository.Update(theFeetoBeApproved); SchoolFeesAccount thePayment = new SchoolFeesAccount(); thePayment.Amount = theFeetoBeApproved.Paid; thePayment.ApprovedBy = User.Identity.Name; thePayment.BankDraftNumber = theFeetoBeApproved.BankDraftNumber; thePayment.ChequeNumber = theFeetoBeApproved.ChequeNumber; thePayment.DateApproved = DateTime.Now; thePayment.EnteredBy = theFeetoBeApproved.EnteredBy; thePayment.PaidDate = theFeetoBeApproved.DatePaid; thePayment.POSTransactionNumber = theFeetoBeApproved.POSTransactionNumber; thePayment.StudentID = theFeetoBeApproved.StudentID; thePayment.TellerNumber = theFeetoBeApproved.TellerNumber; thePayment.TransactionMethod = theFeetoBeApproved.PaymentMethod; thePayment.TransactionType = "Credit"; thePayment.Session = theFeetoBeApproved.Session; thePayment.Level = theFeetoBeApproved.Level; work.SchoolFeesAccountRepository.Insert(thePayment); SchoolAccount thePayment1 = new SchoolAccount(); thePayment1.Amount = theFeetoBeApproved.Paid; thePayment1.ApprovedBy = User.Identity.Name; thePayment1.BankDraftNumber = theFeetoBeApproved.BankDraftNumber; thePayment1.ChequeNumber = theFeetoBeApproved.ChequeNumber; thePayment1.DateApproved = DateTime.Now; thePayment1.EnteredBy = theFeetoBeApproved.EnteredBy; thePayment1.PaidDate = theFeetoBeApproved.DatePaid; thePayment1.POSTransactionNumber = theFeetoBeApproved.POSTransactionNumber; thePayment1.StudentID = theFeetoBeApproved.StudentID; thePayment1.TellerNumber = theFeetoBeApproved.TellerNumber; thePayment1.TransactionMethod = theFeetoBeApproved.PaymentMethod; thePayment1.TransactionType = "Credit"; thePayment1.Session = theFeetoBeApproved.Session; thePayment1.Level = theFeetoBeApproved.Level; thePayment1.Balance = new SchoolAccountBalanceHelper().getSchoolAccountBalance(thePayment1.Amount); work.SchoolAccountRepository.Insert(thePayment1); work.Save(); // TODO: Add update logic here return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(SchoolFeesAccount model) { try { // TODO: Add update logic here return(RedirectToAction("Index")); } catch { return(View()); } }