Example #1
0
        private long AddStudentFee(DTO.LABURNUM.COM.StudentFeeModel model)
        {
            API.LABURNUM.COM.StudentFee apiStudentFee = new StudentFee()
            {
                StudentId         = model.StudentId,
                AdmissionTypeId   = model.AdmissionTypeId,
                ClassId           = model.ClassId,
                SectionId         = model.SectionId,
                AdmissionFee      = model.AdmissionFee,
                AnnualCharges     = model.AnnualCharges,
                DevelopementFee   = model.DevelopementFee,
                ExamFee           = model.ExamFee,
                SecurityFee       = model.SecurityFee,
                SportsFee         = model.SportsFee,
                AnnualFunctionFee = model.AnnualFunctionFee,
                DiscountAmount    = model.DiscountAmount,
                DiscountRemarks   = model.DiscountRemarks,
                CollectedById     = model.CollectedById,
                CreatedOn         = new Component.Utility().GetISTDateTime(),
                AcademicYearId    = model.AcademicYearId,
                IsActive          = true,
            };
            this._laburnum.StudentFees.Add(apiStudentFee);
            this._laburnum.SaveChanges();

            return(apiStudentFee.StudentFeeId);
        }
Example #2
0
        public void Update(DTO.LABURNUM.COM.StudentFeeModel model)
        {
            model.StudentFeeId.TryValidate();
            IQueryable <API.LABURNUM.COM.StudentFee> iQuery        = this._laburnum.StudentFees.Where(x => x.StudentFeeId == model.StudentFeeId && x.IsActive == true);
            List <API.LABURNUM.COM.StudentFee>       dbStudentFees = iQuery.ToList();

            if (dbStudentFees.Count == 0)
            {
                throw new Exception(API.LABURNUM.COM.Component.Constants.ERRORMESSAGES.NO_RECORD_FOUND);
            }
            if (dbStudentFees.Count > 1)
            {
                throw new Exception(API.LABURNUM.COM.Component.Constants.ERRORMESSAGES.MORE_THAN_ONE_RECORDFOUND);
            }
            dbStudentFees[0].ClassId           = model.ClassId;
            dbStudentFees[0].AdmissionTypeId   = model.AdmissionTypeId;
            dbStudentFees[0].StudentId         = model.StudentId;
            dbStudentFees[0].SectionId         = model.SectionId;
            dbStudentFees[0].AdmissionFee      = model.AdmissionFee;
            dbStudentFees[0].AnnualCharges     = model.AnnualCharges;
            dbStudentFees[0].DevelopementFee   = model.DevelopementFee;
            dbStudentFees[0].ExamFee           = model.ExamFee;
            dbStudentFees[0].SecurityFee       = model.SecurityFee;
            dbStudentFees[0].SportsFee         = model.SportsFee;
            dbStudentFees[0].AnnualFunctionFee = model.AnnualFunctionFee;
            dbStudentFees[0].DiscountAmount    = model.DiscountAmount;
            dbStudentFees[0].DiscountRemarks   = model.DiscountRemarks;
            dbStudentFees[0].CollectedById     = model.CollectedById;
            dbStudentFees[0].LastUpdated       = new Component.Utility().GetISTDateTime();
            this._laburnum.SaveChanges();
        }
Example #3
0
 private DTO.LABURNUM.COM.StudentFeeModel MapCore(API.LABURNUM.COM.StudentFee studentFee)
 {
     DTO.LABURNUM.COM.StudentFeeModel dtoStudentFee = new DTO.LABURNUM.COM.StudentFeeModel()
     {
         StudentFeeId           = studentFee.StudentFeeId,
         ClassId                = studentFee.ClassId,
         AdmissionTypeId        = studentFee.AdmissionTypeId,
         AdmissionFee           = studentFee.AdmissionFee,
         DevelopementFee        = studentFee.DevelopementFee,
         AnnualCharges          = studentFee.AnnualCharges,
         ExamFee                = studentFee.ExamFee,
         SportsFee              = studentFee.SportsFee,
         SecurityFee            = studentFee.SecurityFee,
         StudentId              = studentFee.StudentId,
         AnnualFunctionFee      = studentFee.AnnualFunctionFee,
         CollectedById          = studentFee.CollectedById,
         SectionId              = studentFee.SectionId,
         CreatedOn              = studentFee.CreatedOn,
         IsActive               = studentFee.IsActive,
         LastUpdated            = studentFee.LastUpdated,
         AcademicYearId         = studentFee.AcademicYearId,
         ClassName              = studentFee.Class.ClassName,
         StudentName            = studentFee.Student.FirstName + " " + studentFee.Student.MiddleName + " " + studentFee.Student.LastName,
         SectionName            = studentFee.Section.SectionName,
         DiscountAmount         = studentFee.DiscountAmount,
         DiscountRemarks        = studentFee.DiscountRemarks,
         TotalPayableAmount     = (studentFee.AdmissionFee + studentFee.DevelopementFee + studentFee.AnnualCharges + studentFee.ExamFee + studentFee.SportsFee + studentFee.SecurityFee + studentFee.AnnualFunctionFee.GetValueOrDefault()) - studentFee.DiscountAmount,
         CollectedByName        = studentFee.Faculty.FacultyName,
         ParentName             = studentFee.Student.FatherName,
         AcademicYear           = studentFee.AcademicYearTable.StartYear + "-" + studentFee.AcademicYearTable.EndYear,
         StudentAdmissionNumber = studentFee.Student.AdmissionNumber,
     };
     return(dtoStudentFee);
 }
Example #4
0
 public void UpdateStatus(DTO.LABURNUM.COM.StudentFeeModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         new FrontEndApi.StudentFeeApi().UpdateIsActive(model);
     }
 }
Example #5
0
 public List <DTO.LABURNUM.COM.StudentFeeModel> SearchStudentByAdvanceSearch(DTO.LABURNUM.COM.StudentFeeModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         return(new StudentFeeHelper(new FrontEndApi.StudentFeeApi().GetStudentFeeByAdvanceSearch(model)).Map());
     }
     else
     {
         return(null);
     }
 }
Example #6
0
 public long Add(DTO.LABURNUM.COM.StudentFeeModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         return(new FrontEndApi.StudentFeeApi().Add(model));
     }
     else
     {
         return(-1);
     }
 }
Example #7
0
 public DTO.LABURNUM.COM.StudentFeeModel GetStudentFeeModel(DTO.LABURNUM.COM.FeeReportingModel model)
 {
     DTO.LABURNUM.COM.StudentFeeModel studentFeeModel = new DTO.LABURNUM.COM.StudentFeeModel()
     {
         ClassId   = model.ClassId,
         StudentId = model.StudentId,
         SectionId = model.SectionId,
         StartDate = model.StartDate,
         EndDate   = model.EndDate
     };
     return(studentFeeModel);
 }
Example #8
0
 private long AddStudentFee(DTO.LABURNUM.COM.StudentFeeModel model)
 {
     API.LABURNUM.COM.StudentFee apiStudentFee = new StudentFee()
     {
         StudentId       = model.StudentId,
         AdmissionTypeId = model.AdmissionTypeId,
         ClassId         = model.ClassId,
         CreatedOn       = System.DateTime.Now,
         IsActive        = true
     };
     this._laburnum.StudentFees.Add(apiStudentFee);
     this._laburnum.SaveChanges();
     return(apiStudentFee.ClassId);
 }
Example #9
0
 private DTO.LABURNUM.COM.StudentFeeModel MapCore(API.LABURNUM.COM.StudentFee studentFee)
 {
     DTO.LABURNUM.COM.StudentFeeModel dtoStudentFee = new DTO.LABURNUM.COM.StudentFeeModel()
     {
         StudentFeeId    = studentFee.StudentFeeId,
         ClassId         = studentFee.ClassId,
         AdmissionTypeId = studentFee.AdmissionTypeId,
         StudentId       = studentFee.StudentId,
         CreatedOn       = studentFee.CreatedOn,
         IsActive        = studentFee.IsActive,
         LastUpdated     = studentFee.LastUpdated
     };
     return(dtoStudentFee);
 }
Example #10
0
 public DTO.LABURNUM.COM.StudentFeeModel SearchAdmissionFeeReceiptData(DTO.LABURNUM.COM.StudentFeeModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         DTO.LABURNUM.COM.StudentFeeModel  studentFeeModel     = new StudentFeeHelper(new FrontEndApi.StudentFeeApi().GetStudentFeeById(model.StudentFeeId)).MapSingle();
         API.LABURNUM.COM.StudentFeeDetail dbstudentfeeDetails = new FrontEndApi.StudentFeeDetailApi().GetFeePaidDetailDuringAdmission(studentFeeModel.StudentId, studentFeeModel.ClassId, studentFeeModel.SectionId, studentFeeModel.AcademicYearId);
         studentFeeModel.PendingFee       = dbstudentfeeDetails.PendingFee.GetValueOrDefault();
         studentFeeModel.CashPaidAmount   = dbstudentfeeDetails.CashPaidAmount.GetValueOrDefault();
         studentFeeModel.ChequePaidAmount = dbstudentfeeDetails.ChequePaidAmount.GetValueOrDefault();
         studentFeeModel.ChequeNumber     = dbstudentfeeDetails.ChequeNumber;
         studentFeeModel.ChequeDate       = dbstudentfeeDetails.ChequeDate;
         return(studentFeeModel);
     }
     else
     {
         return(null);
     }
 }
Example #11
0
        public void UpdateIsActive(DTO.LABURNUM.COM.StudentFeeModel model)
        {
            model.StudentFeeId.TryValidate();
            IQueryable <API.LABURNUM.COM.StudentFee> iQuery        = this._laburnum.StudentFees.Where(x => x.StudentFeeId == model.StudentFeeId && x.IsActive == true);
            List <API.LABURNUM.COM.StudentFee>       dbStudentFees = iQuery.ToList();

            if (dbStudentFees.Count == 0)
            {
                throw new Exception(API.LABURNUM.COM.Component.Constants.ERRORMESSAGES.NO_RECORD_FOUND);
            }
            if (dbStudentFees.Count > 1)
            {
                throw new Exception(API.LABURNUM.COM.Component.Constants.ERRORMESSAGES.MORE_THAN_ONE_RECORDFOUND);
            }
            dbStudentFees[0].IsActive    = model.IsActive;
            dbStudentFees[0].LastUpdated = System.DateTime.Now;
            this._laburnum.SaveChanges();
        }
Example #12
0
        public long Add(DTO.LABURNUM.COM.StudentFeeModel model)
        {
            if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
            {
                long cstatus = 0;
                if (model.ChequePaidAmount > 0)
                {
                    cstatus = DTO.LABURNUM.COM.Utility.ChequeStatusMaster.GetChequeStatusMasterId(DTO.LABURNUM.COM.Utility.EnumChequeStatusMaster.SUBMITTED);
                }
                else
                {
                    cstatus = model.ChequeStatus.GetValueOrDefault();
                }
                long studentFeeDetailsId = new FrontEndApi.StudentFeeDetailApi().Add(new DTO.LABURNUM.COM.StudentFeeDetailModel()
                {
                    CollectedById    = model.CollectedById,
                    AcademicYearId   = model.AcademicYearId,
                    DiscountAmount   = model.DiscountAmount,
                    DiscountRemarks  = model.DiscountRemarks,
                    StudentId        = model.StudentId,
                    ClassId          = model.ClassId,
                    SectionId        = model.SectionId,
                    PayForTheMonth   = new Component.Utility().GetISTDateTime().Month,
                    CashPaidAmount   = model.CashPaidAmount,
                    ChequePaidAmount = model.ChequePaidAmount,
                    BankId           = model.BankId,
                    ChequeDate       = model.ChequeDate.GetValueOrDefault(),
                    ChequeNumber     = model.ChequeNumber,
                    PendingFee       = model.PendingFee,
                    ChequeStatus     = cstatus
                });
                long studentfeeId = new FrontEndApi.StudentFeeApi().Add(model);
                if (Component.Constants.DEFAULTVALUE.ISMAILSENDSTART)
                {
                    sendmail(studentFeeDetailsId);
                }

                return(studentFeeDetailsId);
            }
            else
            {
                return(-1);
            }
        }
Example #13
0
        private void sendmail(long studentFeeDetailsId)
        {
            DTO.LABURNUM.COM.StudentFeeDetailModel smodel = new DTO.LABURNUM.COM.StudentFeeDetailModel()
            {
                StudentFeeDetailId = studentFeeDetailsId
            };
            smodel.ApiClientModel.UserName = Component.Constants.APIACCESS.APIUSERNAME;;
            smodel.ApiClientModel.Password = Component.Constants.APIACCESS.APIPASSWORD;;
            DTO.LABURNUM.COM.StudentFeeModel model = SearchAdmissionFeeReceiptDataByDetailId(smodel);
            //DTO.LABURNUM.COM.StudentFeeDetailModel studentfeeDetail = new StudentFeeDetailHelper(new FrontEndApi.StudentFeeDetailApi().GetFeePaidDetailDuringAdmission(studentId, classId, sectionId, academicyearId)).MapSingle();
            DTO.LABURNUM.COM.StudentModel studentmodel = new StudentHelper(new FrontEndApi.StudentApi().GetStudentByStudentId(model.StudentId)).MapSingle();
            model.StudentFeeId = studentFeeDetailsId;
            string from    = Component.Constants.MAIL.MAILSENTFROM;
            string subject = Component.Constants.MAILSUBJECT.ADMISSIONSUBJECT;
            string body    = new API.LABURNUM.COM.Component.HtmlHelper().RenderViewToString("User", "~/Views/Partial/NewAdmissionThankyouEmail.cshtml", model);

            if (new Component.Mailer().MailSend(studentmodel.EmailId, "", body, from, subject))
            {
            }
            else
            {
            }
        }
Example #14
0
 public long Add(DTO.LABURNUM.COM.StudentFeeModel model)
 {
     return(AddValidation(model));
 }
Example #15
0
 private long AddValidation(DTO.LABURNUM.COM.StudentFeeModel model)
 {
     model.TryValidate();
     return(AddStudentFee(model));
 }
Example #16
0
        public List <API.LABURNUM.COM.StudentFee> GetStudentFeeByAdvanceSearch(DTO.LABURNUM.COM.StudentFeeModel model)
        {
            IQueryable <API.LABURNUM.COM.StudentFee> iQuery = null;

            //Search By Academic Year Id.
            if (iQuery != null)
            {
                if (model.AcademicYearId > 0)
                {
                    iQuery = iQuery.Where(x => x.AcademicYearId == model.AcademicYearId && x.IsActive == true);
                }
            }
            else
            {
                if (model.AcademicYearId > 0)
                {
                    iQuery = this._laburnum.StudentFees.Where(x => x.AcademicYearId == model.AcademicYearId && x.IsActive == true);
                }
            }
            //Search By Student Fee Id.
            if (iQuery != null)
            {
                if (model.StudentFeeId > 0)
                {
                    iQuery = iQuery.Where(x => x.StudentFeeId == model.StudentFeeId && x.IsActive == true);
                }
            }
            else
            {
                if (model.StudentFeeId > 0)
                {
                    iQuery = this._laburnum.StudentFees.Where(x => x.StudentFeeId == model.StudentFeeId && x.IsActive == true);
                }
            }
            //Search By Admission Type Id.
            if (iQuery != null)
            {
                if (model.AdmissionTypeId > 0)
                {
                    iQuery = iQuery.Where(x => x.AdmissionTypeId == model.AdmissionTypeId && x.IsActive == true);
                }
            }
            else
            {
                if (model.AdmissionTypeId > 0)
                {
                    iQuery = this._laburnum.StudentFees.Where(x => x.AdmissionTypeId == model.AdmissionTypeId && x.IsActive == true);
                }
            }
            //Search By Student Id.
            if (iQuery != null)
            {
                if (model.StudentId > 0)
                {
                    iQuery = iQuery.Where(x => x.StudentId == model.StudentId && x.IsActive == true);
                }
            }
            else
            {
                if (model.StudentId > 0)
                {
                    iQuery = this._laburnum.StudentFees.Where(x => x.StudentId == model.StudentId && x.IsActive == true);
                }
            }
            //Search By Class Id.
            if (iQuery != null)
            {
                if (model.ClassId > 0)
                {
                    iQuery = iQuery.Where(x => x.ClassId == model.ClassId && x.IsActive == true);
                }
            }
            else
            {
                if (model.ClassId > 0)
                {
                    iQuery = this._laburnum.StudentFees.Where(x => x.ClassId == model.ClassId && x.IsActive == true);
                }
            }
            //Search By Section Id.
            if (iQuery != null)
            {
                if (model.SectionId > 0)
                {
                    iQuery = iQuery.Where(x => x.SectionId == model.SectionId && x.IsActive == true);
                }
            }
            else
            {
                if (model.SectionId > 0)
                {
                    iQuery = this._laburnum.StudentFees.Where(x => x.SectionId == model.SectionId && x.IsActive == true);
                }
            }
            //Search By Date Range.
            if (iQuery != null)
            {
                if (model.StartDate.Year != 0001)
                {
                    model.StartDate = new Component.Utility().GetDate(model.StartDate);
                    if (model.EndDate.Year != 0001)
                    {
                        model.EndDate = new Component.Utility().GetDate(model.EndDate).AddDays(1).AddSeconds(-1);
                    }
                    if (model.EndDate.Year == 0001)
                    {
                        model.EndDate = model.StartDate.AddDays(1).AddSeconds(-1);
                    }
                    iQuery = iQuery.Where(x => x.CreatedOn >= model.StartDate && x.CreatedOn <= model.EndDate && x.IsActive == true);
                }
            }
            else
            {
                if (model.StartDate.Year != 0001)
                {
                    model.StartDate = new Component.Utility().GetDate(model.StartDate);
                    if (model.EndDate.Year != 0001)
                    {
                        model.EndDate = new Component.Utility().GetDate(model.EndDate).AddDays(1).AddSeconds(-1);
                    }
                    if (model.EndDate.Year == 0001)
                    {
                        model.EndDate = model.StartDate.AddDays(1).AddSeconds(-1);
                    }
                    iQuery = this._laburnum.StudentFees.Where(x => x.CreatedOn >= model.StartDate && x.CreatedOn <= model.EndDate && x.IsActive == true);
                }
            }
            List <API.LABURNUM.COM.StudentFee> dbStudentFee = iQuery.OrderByDescending(x => x.StudentFeeId).ToList();

            return(dbStudentFee);
        }
Example #17
0
        public List <API.LABURNUM.COM.StudentFee> GetStudentFeeByAdvanceSearch(DTO.LABURNUM.COM.StudentFeeModel model)
        {
            IQueryable <API.LABURNUM.COM.StudentFee> iQuery = null;

            //Search By Student Fee Id.
            if (iQuery != null)
            {
                if (model.StudentFeeId > 0)
                {
                    iQuery = iQuery.Where(x => x.StudentFeeId == model.StudentFeeId && x.IsActive == true);
                }
            }
            else
            {
                if (model.StudentFeeId > 0)
                {
                    iQuery = this._laburnum.StudentFees.Where(x => x.StudentFeeId == model.StudentFeeId && x.IsActive == true);
                }
            }
            //Search By Admission Type Id.
            if (iQuery != null)
            {
                if (model.AdmissionTypeId > 0)
                {
                    iQuery = iQuery.Where(x => x.AdmissionTypeId == model.AdmissionTypeId && x.IsActive == true);
                }
            }
            else
            {
                if (model.AdmissionTypeId > 0)
                {
                    iQuery = this._laburnum.StudentFees.Where(x => x.AdmissionTypeId == model.AdmissionTypeId && x.IsActive == true);
                }
            }
            //Search By Student Id.
            if (iQuery != null)
            {
                if (model.StudentId > 0)
                {
                    iQuery = iQuery.Where(x => x.StudentId == model.StudentId && x.IsActive == true);
                }
            }
            else
            {
                if (model.StudentId > 0)
                {
                    iQuery = this._laburnum.StudentFees.Where(x => x.StudentId == model.StudentId && x.IsActive == true);
                }
            }
            //Search By Class Id.
            if (iQuery != null)
            {
                if (model.ClassId > 0)
                {
                    iQuery = iQuery.Where(x => x.ClassId == model.ClassId && x.IsActive == true);
                }
            }
            else
            {
                if (model.ClassId > 0)
                {
                    iQuery = this._laburnum.StudentFees.Where(x => x.ClassId == model.ClassId && x.IsActive == true);
                }
            }



            List <API.LABURNUM.COM.StudentFee> dbStudentFee = iQuery.ToList();

            return(dbStudentFee);
        }
Example #18
0
 public static void TryValidate(this DTO.LABURNUM.COM.StudentFeeModel item)
 {
     item.StudentId.TryValidate();
     item.AdmissionTypeId.TryValidate();
     item.ClassId.TryValidate();
 }