예제 #1
0
        public ActionResult Select()
        {
            string mode = Request.QueryString["Grid-mode"];

            if (!string.IsNullOrEmpty(mode))
            {
                return(this.RedirectToAction("Create"));
            }
            else
            {
                List <FeeHeadVM> viewModels           = new List <FeeHeadVM>();
                FeeHeadBAL       balObject            = new FeeHeadBAL();
                IQueryable <Entities.FeeHead> entites = balObject.GetAll();

                foreach (Entities.FeeHead entity in entites)
                {
                    FeeHeadVM viewModel = new FeeHeadVM();
                    viewModel.FeeHeadId   = entity.FeeHeadId;
                    viewModel.FeeHeadName = entity.FeeHeadName;
                    viewModel.Status      = entity.Status;
                    viewModel.Remark      = entity.Remark;
                    viewModels.Add(viewModel);
                }
                return(this.View("Index", new GridModel <FeeHeadVM> {
                    Data = viewModels
                }));
            }
        }
예제 #2
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));
        }
예제 #3
0
        public ActionResult Create(FeeClassDivisionVM viewModel)
        {
            try
            {
                //Set default value
                viewModel.PeriodInMonthly = 12;
                viewModel.AmountInMonthly = viewModel.AmountInYearly;

                // TODO: Add insert logic here
                if (ModelState.IsValid)
                {
                    Entities.FeeClassDivision entity = new Entities.FeeClassDivision();
                    entity.FeeClassDivisionId = viewModel.FeeClassDivisionId;
                    entity.FeeHeadId          = viewModel.FeeHeadId;
                    ClassDivisionBAL classDivisionBAL = new ClassDivisionBAL();
                    entity.ClassDivisionId = classDivisionBAL.FindBy(cd => cd.ClassId == viewModel.ClassId && cd.DivisionId == viewModel.DivisionId).FirstOrDefault().ClassDivisionId;
                    entity.PeriodInMonthly = viewModel.PeriodInMonthly;
                    entity.AmountInMonthly = viewModel.AmountInMonthly;
                    entity.AmountInYearly  = viewModel.AmountInYearly;
                    entity.Status          = viewModel.Status;
                    entity.Remark          = viewModel.Remark;

                    FeeClassDivisionBAL balObject = new FeeClassDivisionBAL();
                    balObject.Add(entity);
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ClassBAL classBAL = new ClassBAL();
                    viewModel.Classes = from obj in classBAL.GetAll().Where(c => c.Status == true) select new SelectListItem()
                    {
                        Text = obj.ClassName, Value = obj.ClassId.ToString()
                    };

                    FeeHeadBAL balObject = new FeeHeadBAL();
                    viewModel.Fees = from obj in balObject.GetAll() select new SelectListItem()
                    {
                        Text = obj.FeeHeadName, Value = obj.FeeHeadId.ToString()
                    };

                    return(View(viewModel));
                }
            }
            catch
            {
                ClassBAL classBAL = new ClassBAL();
                viewModel.Classes = from obj in classBAL.GetAll().Where(c => c.Status == true) select new SelectListItem()
                {
                    Text = obj.ClassName, Value = obj.ClassId.ToString()
                };

                FeeHeadBAL balObject = new FeeHeadBAL();
                viewModel.Fees = from obj in balObject.GetAll() select new SelectListItem()
                {
                    Text = obj.FeeHeadName, Value = obj.FeeHeadId.ToString()
                };

                return(View(viewModel));
            }
        }
예제 #4
0
        public JsonResult GetFeeHeadList()
        {
            FeeHeadBAL balObject   = new FeeHeadBAL();
            var        feeHeadList = from obj in balObject.GetAll().Where(c => c.Status == true) select new SelectListItem()
            {
                Text = obj.FeeHeadName, Value = obj.FeeHeadId.ToString()
            };

            return(this.Json(feeHeadList, JsonRequestBehavior.AllowGet));
        }
예제 #5
0
        public ActionResult Index()
        {
            List <FeeHeadVM> viewModels           = new List <FeeHeadVM>();
            FeeHeadBAL       balObject            = new FeeHeadBAL();
            IQueryable <Entities.FeeHead> entites = balObject.GetAll();

            foreach (Entities.FeeHead entity in entites)
            {
                FeeHeadVM viewModel = new FeeHeadVM();
                viewModel.FeeHeadId   = entity.FeeHeadId;
                viewModel.FeeHeadName = entity.FeeHeadName;
                viewModel.Status      = entity.Status;
                viewModel.Remark      = entity.Remark;
                viewModels.Add(viewModel);
            }
            return(View(new GridModel <FeeHeadVM> {
                Data = viewModels
            }));
        }
예제 #6
0
        public ActionResult StudentLedger()
        {
            StudentLedgerBAL studentLedgerBAL            = new StudentLedgerBAL();
            IQueryable <Entities.StudentLedger> entities = studentLedgerBAL.GetAll();

            FeeHeadBAL feeHeadBAL = new FeeHeadBAL();
            IQueryable <Entities.FeeHead> feeHeads = feeHeadBAL.GetAll();

            List <StudentLedgerVM> studentLedgerVMs = new List <StudentLedgerVM>();

            foreach (Entities.StudentLedger entity in entities)
            {
                StudentLedgerVM studentLedgerVM = new StudentLedgerVM();
                studentLedgerVM.StudentLedgerId = entity.StudentLedgerId;
                studentLedgerVM.StudentId       = entity.StudentId;
                StudentBAL       studentObject = new StudentBAL();
                Entities.Student student       = studentObject.FindBy(s => s.StudentId == entity.StudentId).FirstOrDefault();
                if (student != null)
                {
                    studentLedgerVM.StudentFullNameWithTitle = string.Concat(student.Title, " ", student.FirstName, " ", student.MiddleName, " ", student.LastName).Trim();
                }
                studentLedgerVM.TransactionDate = entity.TransactionDate;
                studentLedgerVM.FeeHeadId       = entity.FeeHeadId;
                studentLedgerVM.FeeHeadName     = feeHeads.Where(fh => fh.FeeHeadId == entity.FeeHeadId).FirstOrDefault().FeeHeadName;
                studentLedgerVM.Cr           = entity.Cr;
                studentLedgerVM.Dr           = entity.Dr;
                studentLedgerVM.HeadBalance  = entity.HeadBalance;
                studentLedgerVM.Balance      = entity.Balance;
                studentLedgerVM.ReceiptNo    = entity.ReceiptNo;
                studentLedgerVM.BankName     = entity.BankName;
                studentLedgerVM.ChequeNumber = entity.ChequeNumber;
                studentLedgerVM.Status       = entity.Status;
                studentLedgerVM.Remark       = entity.Remark;
                //studentLedgerVM.CreatedBy = Convert.ToInt32(dr["CreatedBy"]);
                //studentLedgerVM.CreatedDate = Convert.ToDateTime(dr["CreatedDate"]);
                //studentLedgerVM.ModifiedBy = Convert.ToInt32(dr["ModifiedBy"]);
                //studentLedgerVM.ModifiedDate = Convert.ToDateTime(dr["ModifiedDate"]);
                studentLedgerVMs.Add(studentLedgerVM);
            }
            return(View(new GridModel <StudentLedgerVM> {
                Data = studentLedgerVMs
            }));
        }