Exemple #1
0
        public ActionResult GetStudentTransactionSub(int StudentId)
        {
            List <StudentTransactionSubVM> studentTransactionSubVMs = new List <StudentTransactionSubVM>();
            StudentLedgerBAL studentLedgerBAL = new StudentLedgerBAL();
            IQueryable <Entities.StudentLedger> studentLedgers = studentLedgerBAL.GetAll().Where(a => a.StudentId == StudentId).OrderBy(a => a.StudentLedgerId);

            if (studentLedgers != null && studentLedgers.Count() > 0)
            {
                IEnumerable <IGrouping <int, Entities.StudentLedger> > studentLedgersGroupByFeeId = studentLedgers.GroupBy(a => a.FeeHeadId);
                if (studentLedgersGroupByFeeId != null && studentLedgersGroupByFeeId.Count() > 0)
                {
                    foreach (IGrouping <int, Entities.StudentLedger> studentLedgersGroupItem in studentLedgersGroupByFeeId)
                    {
                        Entities.StudentLedger  studentLedger           = studentLedgersGroupItem.LastOrDefault();
                        StudentTransactionSubVM studentTransactionSubVM = new StudentTransactionSubVM();
                        studentTransactionSubVM.StudentTransactionSubId = 0;
                        studentTransactionSubVM.FeeHeadId = studentLedgersGroupItem.Key;
                        FeeHeadBAL feeHeadBAL = new FeeHeadBAL();
                        studentTransactionSubVM.FeeHeadName = feeHeadBAL.FindBy(f => f.FeeHeadId == studentLedgersGroupItem.Key).FirstOrDefault().FeeHeadName;
                        studentTransactionSubVM.Cr          = 0;
                        studentTransactionSubVM.Dr          = 0;
                        studentTransactionSubVM.Balance     = studentLedger.HeadBalance;
                        FeeHeadBAL balObject = new FeeHeadBAL();
                        studentTransactionSubVM.Fees = from obj in balObject.GetAll() select new SelectListItem()
                        {
                            Text = obj.FeeHeadName, Value = obj.FeeHeadId.ToString()
                        };
                        studentTransactionSubVMs.Add(studentTransactionSubVM);
                    }
                }
            }
            return(PartialView("_GetStudentTransactionSub", studentTransactionSubVMs));
        }
Exemple #2
0
        public ActionResult GetStudentTransactionSubDeails(int StudentId)
        {
            List <StudentTransactionSubVM> studentTransactionSubVMs = new List <StudentTransactionSubVM>();
            StudentLedgerBAL studentLedgerBAL = new StudentLedgerBAL();
            IQueryable <Entities.StudentLedger> studentLedgers = studentLedgerBAL.GetAll().Where(a => a.StudentId == StudentId).OrderBy(a => a.StudentLedgerId);

            if (studentLedgers != null && studentLedgers.Count() > 0)
            {
                IEnumerable <IGrouping <int, Entities.StudentLedger> > studentLedgersGroupByFeeId = studentLedgers.GroupBy(a => a.FeeHeadId);
                if (studentLedgersGroupByFeeId != null && studentLedgersGroupByFeeId.Count() > 0)
                {
                    foreach (IGrouping <int, Entities.StudentLedger> studentLedgersGroupItem in studentLedgersGroupByFeeId)
                    {
                        Entities.StudentLedger  studentLedger           = studentLedgersGroupItem.LastOrDefault();
                        StudentTransactionSubVM studentTransactionSubVM = new StudentTransactionSubVM();
                        studentTransactionSubVM.StudentTransactionSubId = 0;
                        studentTransactionSubVM.FeeHeadId = studentLedgersGroupItem.Key;
                        FeeHeadBAL feeHeadBAL = new FeeHeadBAL();
                        studentTransactionSubVM.FeeHeadName = feeHeadBAL.FindBy(f => f.FeeHeadId == studentLedgersGroupItem.Key).FirstOrDefault().FeeHeadName;
                        studentTransactionSubVM.Cr          = 0;
                        studentTransactionSubVM.Dr          = 0;
                        studentTransactionSubVM.Balance     = studentLedger.HeadBalance;
                        studentTransactionSubVMs.Add(studentTransactionSubVM);
                    }
                }
            }
            return(PartialView("_StudentTransactionSub", new GridModel <StudentTransactionSubVM> {
                Data = studentTransactionSubVMs
            }));
        }
Exemple #3
0
        //
        // GET: /SysAdmin/FeeHead/Details/5
        public ActionResult Details(int id)
        {
            FeeHeadVM  viewModel = new FeeHeadVM();
            FeeHeadBAL balObject = new FeeHeadBAL();
            IQueryable <Entities.FeeHead> entites = balObject.FindBy(a => a.FeeHeadId == id);

            if (entites != null && entites.Count() > 0)
            {
                Entities.FeeHead entity = entites.FirstOrDefault();
                viewModel.FeeHeadId   = entity.FeeHeadId;
                viewModel.FeeHeadName = entity.FeeHeadName;
                viewModel.Status      = entity.Status;
                viewModel.Remark      = entity.Remark;
            }
            return(View(viewModel));
        }