private IEnumerable <fees_payment> GetFeesPaidByReg(int reg, string session) { List <fees_payment> payment = new List <fees_payment>(); fees_receiptMain outrect = new fees_receiptMain(); IEnumerable <fees_receipt> rect = new List <fees_receipt>(); rect = outrect.AllPaidFeesReg(reg, session); foreach (fees_receipt val in rect) { payment.Add(new fees_payment { sr_num = reg, mode_flag = val.mode_flag, session = val.session, receipt_no = val.receipt_no, receipt_date = val.receipt_date, Fees_type = val.fees_name, amount_to_be_paid = val.amount, fine = val.dc_fine, discount = val.dc_discount, Narration = val.narration, acc_id = val.acc_id, chq_reject = val.chq_reject }); } return(payment); }
public ActionResult submit_fees(List <fees_payment> fees) { List <fees_receipt> rec = new List <fees_receipt>(); fees_receiptMain main = new fees_receiptMain(); foreach (fees_payment fee in fees) { if (fee.check) { if (fee.serial == 0) { out_standing out_std = new out_standing(); out_standingMain out_stdMain = new out_standingMain(); out_std.outstd_amount = fee.due_amount; out_std.rmt_amount = fee.due_amount; out_std.sr_number = fee.sr_num; out_std.acc_id = fee.acc_id; out_std.month_no = fee.month_no; out_std.month_name = fee.month_name; out_std.clear_flag = fee.clear_flag; out_std.session = fee.session; out_stdMain.AddOutStanding(out_std); rec.Add(new fees_receipt { acc_id = fee.acc_id, amount = fee.amount_to_be_paid, fees_name = fee.Fees_type, sr_number = fee.sr_num, dc_fine = fee.fine, dc_discount = fee.discount, narration = fee.Narration, serial = out_std.serial, clear_flag = fee.clear_flag, bnk_name = fee.Bank_name, chq_no = fee.cheque_no, chq_date = fee.cheque_date, mode_flag = fee.mode_flag, month_no = fee.month_no, session = fee.session, due_amount = fee.due_amount, user_id = Int32.Parse(Request.Cookies["loginUserId"].Value.ToString()) }); } else { rec.Add(new fees_receipt { acc_id = fee.acc_id, amount = fee.amount_to_be_paid, fees_name = fee.Fees_type, sr_number = fee.sr_num, dc_fine = fee.fine, dc_discount = fee.discount, narration = fee.Narration, serial = fee.serial, dt_date = fee.dt_date, reg_no = fee.reg_num, reg_date = fee.reg_date, clear_flag = fee.clear_flag, bnk_name = fee.Bank_name, chq_no = fee.cheque_no, chq_date = fee.cheque_date, mode_flag = fee.mode_flag, session = fee.session, due_amount = fee.due_amount, user_id = Int32.Parse(Request.Cookies["loginUserId"].Value.ToString()) }); } } } int rcpt_no = main.AddReceipt(rec); return(RedirectToAction("fees_collect", new { rcpt_no = rcpt_no })); }