public async Task <IActionResult> StudentPaymentSheet(Int64 StudentId, string RegistrationId, Int64 ClassId, Int64 ClassYear = 0)
        {
            try
            {
                ViewBag.ddlFeeType = _FeeTypesServ.dropdown_FeeType(ClassId);
                ViewBag.ddlYear    = _StudentPaymentsServ.dropdown_Year(StudentId);
                //[NOTE : get default classyear if parameter is empty]
                if (ClassYear == 0)
                {
                    var classyears = _StudentPaymentsServ.dropdown_Year(StudentId).FirstOrDefault();
                    if (classyears != null)
                    {
                        ClassYear = classyears.Year;
                    }
                }
                var FeeStructureList = await Task.Run(() => _FeeStructuresServ.GetFeeStructuresByClass(StudentId, ClassId, ClassYear));

                var listOfFee = new List <IndexPaymentDetailByIdVM_FeeStructure>();
                foreach (var feeStructure in FeeStructureList._FeeStructures)
                {
                    var temp = new IndexPaymentDetailByIdVM_FeeStructure()
                    {
                        Id                   = feeStructure.Id,
                        ClassId              = feeStructure.ClassId,
                        Amount               = feeStructure.Amount,
                        FeeTypeId            = feeStructure.FeeTypeId,
                        IsActive             = feeStructure.IsActive,
                        TermNo               = feeStructure.TermNo,
                        TermName             = feeStructure.TermName,
                        FeeTermDescriptionId = feeStructure.FeeTermDescriptionId,
                        DiscountAmount       = feeStructure.DiscountAmount,
                        Fine                 = feeStructure.Fine,
                        PaidAmount           = feeStructure.PaidAmount,
                        Remarks              = feeStructure.Remarks,
                        FeeType              = feeStructure.FeeType
                    };
                    listOfFee.Add(temp);
                }
                ;
                var model = new IndexPaymentDetailByIdVM()
                {
                    ClassId        = ClassId,
                    ClassName      = FeeStructureList.ClassName,
                    FeeYear        = FeeStructureList.FeeYear,
                    _FeeStructure  = listOfFee,
                    StudentId      = StudentId,
                    RegistrationId = RegistrationId,
                };
                return(View("StudentPaymentSheet", model));
            }
            catch
            {
                return(BadRequest());
            }
        }
示例#2
0
        public JsonResult DropDown_FeeTypes(long ddlClassId)
        {
            var result = (dynamic)null;

            if (ddlClassId != 0)
            {
                var ddlFeeTypes = _FeeTypesServ.dropdown_FeeType(ddlClassId);
                result = Json(new SelectList(ddlFeeTypes, "Id", "Name"));
            }
            return(result);
        }