public async Task <IActionResult> StudentPromotionsList(int pg = 1)
        {
            try
            {
                var StudentPromotionsList = Task.Run(() => _StudentPromotionsServ.getStudentPromotionsList());
                var result = await StudentPromotionsList;
                ViewBag.ddlClass = _classesServ.dropdown_Class();
                var list = new List <IndexStudentPromotionsVM_StudentPromotions>();
                foreach (var item in result._StudentPromotions.ToList())
                {
                    var temp = new IndexStudentPromotionsVM_StudentPromotions()
                    {
                        Id             = item.Id,
                        ClassId        = item.ClassId,
                        ClassName      = item.ClassName,
                        StudentId      = item.StudentId,
                        RegistrationNo = item.RegistrationNo,
                        RollNo         = item.RollNo,
                        ClassYear      = item.ClassYear,
                        IsActive       = item.IsActive,
                        AddedBy        = item.AddedBy,
                        AddedDate      = item.AddedDate,
                        ModifiedBy     = item.ModifiedBy,
                        ModifiedDate   = item.ModifiedDate,
                        DataType       = item.DataType
                    };
                    list.Add(temp);
                }
                ;

                #region "Paging"
                const int pageSize = 5;
                if (pg < 1)
                {
                    pg = 1;
                }
                int recsCount = list.Count();
                var pager     = new Pager(recsCount, pg, pageSize);
                int recSkip   = (pg - 1) * pageSize;
                var data      = list.Skip(recSkip).Take(pager.PageSize).ToList();
                this.ViewBag.Pager = pager;
                var model = new IndexStudentPromotionsVM()
                {
                    _StudentPromotions = data
                };
                #endregion "Paging"


                return(View("StudentPromotionsList", model));
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Exemple #2
0
        public async Task <IActionResult> FeeStructuresList(int pg = 1)
        {
            try
            {
                var FeeStructuresList = Task.Run(() => _FeeStructuresServ.getFeeStructuresList());
                var result            = await FeeStructuresList;
                ViewBag.ddlClass = _classesServ.dropdown_Class();
                var list = new List <Vm_FeeStructures>();
                foreach (var item in result._FeeStructures.ToList())
                {
                    var temp = new Vm_FeeStructures()
                    {
                        Id           = item.Id,
                        ClassId      = item.ClassId,
                        Class        = item.Class,
                        FeeTypeId    = item.FeeTypeId,
                        FeeType      = item.FeeType,
                        FeeTypeMood  = item.FeeTypeMood,
                        Amount       = item.Amount,
                        StartingYear = item.StartingYear,
                        EndingYear   = item.EndingYear != null ? item.EndingYear : null,
                        IsActive     = item.IsActive
                    };
                    list.Add(temp);
                }
                ;

                #region "Paging"
                const int pageSize = 5;
                if (pg < 1)
                {
                    pg = 1;
                }
                int recsCount = list.Count();
                var pager     = new Pager(recsCount, pg, pageSize);
                int recSkip   = (pg - 1) * pageSize;
                var data      = list.Skip(recSkip).Take(pager.PageSize).ToList();
                this.ViewBag.Pager = pager;

                var model = new IndexFeeStructuresListVM()
                {
                    _FeeStructures = data
                };

                #endregion "Paging"

                return(View("FeeStructuresList", model));
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Exemple #3
0
        public async Task <IActionResult> StudentDiscountsList(int pg = 1)
        {
            try
            {
                var StudentDiscountsList = Task.Run(() => _StudentDiscountsServ.getStudentDiscountsList());
                var result = await StudentDiscountsList;
                ViewBag.ddlStudent = _studentsServ.dropdown_Students();
                ViewBag.ddlClass   = _classesServ.dropdown_Class();
                var list = new List <IndexStudentDiscountsListVM_StudentDiscounts>();
                foreach (var item in result._StudentDiscounts.ToList())
                {
                    var temp = new IndexStudentDiscountsListVM_StudentDiscounts()
                    {
                        Id             = item.Id,
                        StudentId      = item.StudentId,
                        ClassId        = item.ClassId,
                        ClassName      = item.ClassName,
                        RegistrationNo = item.RegistrationNo,
                        StudentName    = item.StudentName,
                        FeeTypeId      = item.FeeTypeId,
                        FeeType        = item.FeeType,
                        DiscountAmout  = item.DiscountAmout
                    };
                    list.Add(temp);
                }
                ;

                #region "Paging"
                const int pageSize = 5;
                if (pg < 1)
                {
                    pg = 1;
                }
                int recsCount = list.Count();
                var pager     = new Pager(recsCount, pg, pageSize);
                int recSkip   = (pg - 1) * pageSize;
                var data      = list.Skip(recSkip).Take(pager.PageSize).ToList();
                this.ViewBag.Pager = pager;
                var model = new IndexStudentDiscountsListVM()
                {
                    _StudentDiscounts = data
                };
                #endregion "Paging"

                return(View("StudentDiscountsList", model));
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
        public async Task <IActionResult> SearchStudentList(string RegistrationId)
        {
            try
            {
                if (String.IsNullOrEmpty(RegistrationId))
                {
                    var model = new IndexSearchStudentListVM()
                    {
                        //Students = null,
                        RegistrationId = null
                    };
                    return(View("SearchStudentList", model));
                }
                else
                {
                    var result = new SearchStudentList()
                    {
                        RegistrationId = RegistrationId
                    };
                    var studentList = await Task.Run(() => _StudentPaymentsServ.SearchStudentList(result));

                    ViewBag.ddlClasses = _classesServ.dropdown_Class();
                    ViewBag.ddlGenders = _GendersServ.Dropdown_Genders();
                    if (studentList.Students != null)
                    {
                        var temp = new IndexSearchStudentListVM_Students()
                        {
                            Id               = studentList.Students.Id,
                            ClassId          = studentList.Students.ClassId,
                            RegistrationNo   = studentList.Students.RegistrationNo,
                            ClassName        = studentList.Students.ClassName,
                            GenderId         = studentList.Students.GenderId,
                            GenderName       = studentList.Students.GenderName,
                            FirstName        = studentList.Students.FirstName,
                            LastName         = studentList.Students.LastName,
                            StudentName      = studentList.Students.StudentName,
                            IP300X200        = studentList.Students.IP300X200,
                            AdmittedYear     = studentList.Students.AdmittedYear,
                            PresentAddress   = studentList.Students.PresentAddress,
                            PermanentAddress = studentList.Students.PermanentAddress,
                            DOB              = studentList.Students.DOB,
                            IsActive         = studentList.Students.IsActive,
                            AddedBy          = studentList.Students.AddedBy = 0,
                            AddedDate        = DateTime.Now,
                            ModifiedBy       = 0,
                            ModifiedDate     = DateTime.Now,
                            DataType         = null
                        };
                        var model = new IndexSearchStudentListVM()
                        {
                            Students       = temp,
                            RegistrationId = RegistrationId,
                        };
                        return(View("SearchStudentList", model));
                    }
                    else
                    {
                        var model = new IndexSearchStudentListVM()
                        {
                            Students       = null,
                            RegistrationId = RegistrationId,
                        };
                        return(View("SearchStudentList", model));
                    }
                }
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Exemple #5
0
        public async Task <IActionResult> StudentsByAccountant(string SearchStudentClassId, int pg = 1)
        {
            try
            {
                if (String.IsNullOrEmpty(SearchStudentClassId))
                {
                    ViewBag.ddlClasses    = _classesServ.dropdown_Class();
                    ViewBag.searchRequest = false;
                    var model = new StudentsByAccountantVM()
                    {
                        _Students            = null,
                        SearchStudentClassId = null
                    };
                    return(View("StudentsByAccountant", model));
                }
                else
                {
                    var result = new SearchStudentsByClass()
                    {
                        WebRootPath          = _he.WebRootPath,
                        SearchStudentClassId = SearchStudentClassId
                    };
                    var SearchStudentsByClass = await Task.Run(() => _studentsServ.SearchStudentsByClass(result));

                    ViewBag.ddlClasses = _classesServ.dropdown_Class();
                    ViewBag.ddlGenders = _GendersServ.Dropdown_Genders();
                    var list = new List <StudentsByAccountantVM_Students>();
                    foreach (var item in SearchStudentsByClass._Students.ToList())
                    {
                        var temp = new StudentsByAccountantVM_Students()
                        {
                            Id               = item.Id,
                            ClassId          = item.ClassId,
                            ClassName        = item.ClassName,
                            GenderId         = item.GenderId,
                            GenderName       = item.GenderName,
                            RegistrationNo   = item.RegistrationNo,
                            FirstName        = item.FirstName,
                            LastName         = item.LastName,
                            StudentName      = item.StudentName,
                            FatherName       = item.FatherName,
                            MotherName       = item.MotherName,
                            ParentsName      = item.ParentsName,
                            CurrentClassName = item.CurrentClassName,
                            CurrentYear      = item.CurrentYear,
                            IP300X200        = item.IP300X200,
                            AdmittedYear     = item.AdmittedYear,
                            PresentAddress   = item.PresentAddress,
                            PermanentAddress = item.PermanentAddress,
                            DOB              = item.DOB,
                            IsActive         = item.IsActive,
                            AddedBy          = item.AddedBy = 0,
                            AddedDate        = DateTime.Now,
                            ModifiedBy       = 0,
                            ModifiedDate     = DateTime.Now,
                            DataType         = null
                        };
                        list.Add(temp);
                    }
                    ;


                    #region "Paging"
                    const int pageSize = 5;
                    if (pg < 1)
                    {
                        pg = 1;
                    }
                    int recsCount = list.Count();
                    var pager     = new Pager(recsCount, pg, pageSize);
                    int recSkip   = (pg - 1) * pageSize;
                    var data      = list.Skip(recSkip).Take(pager.PageSize).ToList();
                    this.ViewBag.Pager = pager;
                    var model = new StudentsByAccountantVM()
                    {
                        ClassName            = SearchStudentsByClass.SearchStudentClassName,
                        _Students            = data,
                        SearchStudentClassId = SearchStudentClassId
                    };
                    #endregion "Paging"

                    return(View("StudentsByAccountant", model));
                }
            }
            catch
            {
                return(BadRequest());
            }
        }