Exemplo n.º 1
0
        public ActionResult Create(FeeHeadVM viewModel)
        {
            try
            {
                // TODO: Add insert logic here
                if (ModelState.IsValid)
                {
                    Entities.FeeHead entity = new Entities.FeeHead();
                    entity.FeeHeadId   = viewModel.FeeHeadId;
                    entity.FeeHeadName = viewModel.FeeHeadName;
                    entity.Status      = viewModel.Status;
                    entity.Remark      = viewModel.Remark;

                    FeeHeadBAL balObject = new FeeHeadBAL();
                    balObject.Add(entity);
                    return(RedirectToAction("Index"));
                }
                else
                {
                    //AcademicYearBAL academicYearBAL = new AcademicYearBAL();
                    // viewModel.AcademicYears = from obj in academicYearBAL.GetAll() select new SelectListItem() { Text = obj.AcademicYearName, Value = obj.AcademicYearId.ToString() };
                    return(View(viewModel));
                }
            }
            catch
            {
                // AcademicYearBAL academicYearBAL = new AcademicYearBAL();
                //viewModel.AcademicYears = from obj in academicYearBAL.GetAll() select new SelectListItem() { Text = obj.AcademicYearName, Value = obj.AcademicYearId.ToString() };
                return(View(viewModel));
            }
        }
Exemplo n.º 2
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
                }));
            }
        }
Exemplo n.º 3
0
        public ActionResult Edit(FeeHeadVM viewModel)
        {
            try
            {
                // TODO: Add update logic here
                if (ModelState.IsValid)
                {
                    Entities.FeeHead entity = new Entities.FeeHead();
                    entity.FeeHeadId   = viewModel.FeeHeadId;
                    entity.FeeHeadName = viewModel.FeeHeadName;
                    entity.Status      = viewModel.Status;
                    entity.Remark      = viewModel.Remark;

                    FeeHeadBAL balObject = new FeeHeadBAL();
                    balObject.Edit(entity);
                    return(RedirectToAction("Index"));
                }
                else
                {
                    return(View(viewModel));
                }
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 4
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));
        }
Exemplo n.º 5
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
            }));
        }
Exemplo n.º 6
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));
            }
        }
Exemplo n.º 7
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));
        }
Exemplo n.º 8
0
 //
 // POST: /SysAdmin/FeeHead/Delete/5
 //[HttpPost]
 public ActionResult Delete(int id)
 {
     try
     {
         // TODO: Add delete logic here
         FeeHeadBAL balObject = new FeeHeadBAL();
         balObject.Delete(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 9
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));
        }
Exemplo n.º 10
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
            }));
        }
Exemplo n.º 11
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
            }));
        }