Exemple #1
0
        public DTO.LABURNUM.COM.StudentModel ParentStudentLogin(DTO.LABURNUM.COM.StudentModel model)
        {
            if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
            {
                DTO.LABURNUM.COM.StudentModel studentmodel = new DTO.LABURNUM.COM.StudentModel();
                long studentId;
                if (model.IsStudentLogin)
                {
                    studentId = new FrontEndApi.StudentApi().IsStudentValid(model.StudentUserName, model.StudentPassword);
                }
                else
                {
                    studentId = new FrontEndApi.StudentApi().IsParentValid(model.ParentUserName, model.ParentPassword);
                }

                if (studentId > 0)
                {
                    studentmodel = new StudentHelper(new FrontEndApi.StudentApi().GetStudentByStudentId(studentId)).MapSingle();
                }
                return(studentmodel);
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
 public List <DTO.LABURNUM.COM.StudentFeeDetailModel> SearchPendingFeeByStudentModel(DTO.LABURNUM.COM.StudentModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         API.LABURNUM.COM.Student dbstudent = new FrontEndApi.StudentApi().GetStudentByAdmissionNumber(model.AdmissionNumber);
         return(new StudentFeeDetailHelper(new FrontEndApi.StudentFeeDetailApi().GetStudentFeeDetailByAdvanceSearch(new DTO.LABURNUM.COM.StudentFeeDetailModel()
         {
             StudentId = dbstudent.StudentId, AcademicYearId = model.AcademicYearId
         })).Map());
     }
     else
     {
         return(null);
     }
 }
Exemple #3
0
        private void SendChequeStatusUpdateEmail(long studentFeeDetailsId)
        {
            DTO.LABURNUM.COM.StudentFeeDetailModel model = new StudentFeeDetailHelper(new FrontEndApi.StudentFeeDetailApi().GetStudentFeeDetailByID(studentFeeDetailsId)).MapSingle();
            string EmailId = new FrontEndApi.StudentApi().GetStudentByStudentId(model.StudentId).EmailId;
            string from    = Component.Constants.MAIL.MAILSENTFROM;
            string subject = "Cheque Status Update Against Cheque No. " + model.ChequeNumber + " Submitted At Laburnum Public School.";
            string body    = new API.LABURNUM.COM.Component.HtmlHelper().RenderViewToString("User", "~/Views/Partial/EmailBodyForChequeStatusUpdate.cshtml", model);

            if (new Component.Mailer().MailSend(EmailId, "", body, from, subject))
            {
            }
            else
            {
            }
        }
Exemple #4
0
 public dynamic SearchStudentListForAttendance(DTO.LABURNUM.COM.CommonAttendanceModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         if (model.ClassId <= 0 && model.SectionId <= 0)
         {
             return(GetApiResponseModel("Class Id And Section Id Cannot be blank.", false, null));
         }
         if (model.ClassId <= 0)
         {
             return(GetApiResponseModel("Class Id Id Cannot be blank.", false, null));
         }
         if (model.SectionId <= 0)
         {
             return(GetApiResponseModel("Section Id Cannot be blank.", false, null));
         }
         List <DTO.LABURNUM.COM.CommonAttendanceModel> dbList = new List <DTO.LABURNUM.COM.CommonAttendanceModel>();
         List <API.LABURNUM.COM.Student> dbStudents           = new FrontEndApi.StudentApi().GetStudentByAdvanceSearch(new DTO.LABURNUM.COM.StudentModel()
         {
             ClassId = model.ClassId, SectionId = model.SectionId
         });
         foreach (API.LABURNUM.COM.Student item in dbStudents)
         {
             dbList.Add(new DTO.LABURNUM.COM.CommonAttendanceModel()
             {
                 ClassId         = item.ClassId,
                 SectionId       = item.SectionId,
                 StudentId       = item.StudentId,
                 StudentName     = item.FirstName + " " + item.MiddleName + " " + item.LastName,
                 Mobile          = item.Mobile,
                 FatherName      = item.FatherName,
                 AdmissionNumber = item.AdmissionNumber,
             });
         }
         return(GetApiResponseModel("Successfully Performed.", true, dbList));
     }
     else
     {
         return(GetApiResponseModel("Api Access User Name or Password Invalid.", false, null));
     }
 }
        private string GetUserName(API.LABURNUM.COM.LoginActivity apiLoginActivity)
        {
            string userName = null;

            API.LABURNUM.COM.Student apistudent = new FrontEndApi.StudentApi().GetStudentByStudentId(apiLoginActivity.StudentId);
            switch (apiLoginActivity.UserTypeId)
            {
            case 4:
                //userName = apiLoginActivity.Student.FatherName;
                userName = apistudent.FatherName;
                break;

            case 5:
                userName = apistudent.FirstName + " " + apistudent.MiddleName + " " + apistudent.LastName;
                break;

            default:
                userName = new FrontEndApi.FacultyApi().GetFacultyById(apiLoginActivity.StudentId).FacultyName;
                break;
            }
            return(userName);
        }
Exemple #6
0
        public DTO.LABURNUM.COM.AttendanceReporting.AttendanceSummaryReportModel GetAttendanceSummary(DateTime startDate, DateTime endDate)
        {
            DTO.LABURNUM.COM.AttendanceReporting.AttendanceSummaryReportModel attendanceSummaryReportModel = new DTO.LABURNUM.COM.AttendanceReporting.AttendanceSummaryReportModel();
            int totalstudents = 0, totalMorningPresent = 0, totalMorningAbsent = 0, totalLunchPresent = 0, totalLunchAbsent = 0;
            List <API.LABURNUM.COM.Student> dbstudents = new FrontEndApi.StudentApi().GetActiveStudents();

            List <DTO.LABURNUM.COM.ClassModel> classes = new ClassHelper(new FrontEndApi.ClassApi().GetActiveClass()).Map();

            DTO.LABURNUM.COM.AttendanceReporting.DayWiseAttendanceSummary daysummary = new DTO.LABURNUM.COM.AttendanceReporting.DayWiseAttendanceSummary();
            foreach (DTO.LABURNUM.COM.ClassModel item in classes)
            {
                int studentsinclass = 0, morningpresent = 0, morningAbsent = 0, lunchpresent = 0, lunchAbsent = 0;
                List <DTO.LABURNUM.COM.AttendanceReporting.SectionModelForAttendance> sections = new List <DTO.LABURNUM.COM.AttendanceReporting.SectionModelForAttendance>();

                foreach (DTO.LABURNUM.COM.SectionModel item1 in item.Sections)
                {
                    DTO.LABURNUM.COM.DashBoard.ClassAttendanceStatus rmodel = new Controllers.DashBoardController().GetClassAttendanceStatus(item.ClassId, item1.SectionId, startDate, endDate);
                    int m = dbstudents.Where(x => x.ClassId == item.ClassId && x.SectionId == item1.SectionId).ToList().Count;
                    rmodel.TotalStudents = m;

                    sections.Add(new DTO.LABURNUM.COM.AttendanceReporting.SectionModelForAttendance()
                    {
                        SectionId             = item1.SectionId,
                        SectionName           = item1.SectionName,
                        ClassAttendanceStatus = rmodel
                    });


                    totalstudents = m + totalstudents;
                    if (rmodel.MorningPresentStudentCount == 0 && rmodel.LunchPresentStudentCount == 0)
                    {
                        totalMorningAbsent = m + totalMorningAbsent;
                        totalLunchAbsent   = m + totalLunchAbsent;
                        rmodel.MorningAbsentStudentCount = m;
                        rmodel.LunchAbsentStudentCount   = m;
                    }
                    else
                    {
                        totalMorningPresent = rmodel.MorningPresentStudentCount + totalMorningPresent;
                        totalMorningAbsent  = rmodel.MorningAbsentStudentCount + totalMorningAbsent;
                        totalLunchPresent   = rmodel.LunchPresentStudentCount + totalLunchPresent;
                        totalLunchAbsent    = rmodel.MorningAbsentStudentCount + totalLunchAbsent;
                    }
                    studentsinclass = studentsinclass + m;
                    morningpresent  = morningpresent + rmodel.MorningPresentStudentCount;
                    morningAbsent   = morningAbsent + rmodel.MorningAbsentStudentCount;
                    lunchpresent    = lunchpresent + rmodel.LunchPresentStudentCount;
                    lunchAbsent     = lunchAbsent + rmodel.LunchAbsentStudentCount;
                }
                daysummary.ForDate = startDate;
                daysummary.ClassModelsForAttendance.Add(new DTO.LABURNUM.COM.AttendanceReporting.ClassModelForAttendance()
                {
                    ClassId   = item.ClassId,
                    ClassName = item.ClassName,
                    SectionModelsForAttendance   = sections,
                    StudentInClass               = studentsinclass,
                    MorningPresentStudentInClass = morningpresent,
                    MorningAbsentStudentInClass  = morningAbsent,
                    LunchPresentStudentInClass   = lunchpresent,
                    LunchAbsentStudentInClass    = lunchAbsent
                });
            }
            attendanceSummaryReportModel.DayWiseAttendanceSummaries.Add(daysummary);
            attendanceSummaryReportModel.TotalStudentsInSchool            = totalstudents;
            attendanceSummaryReportModel.TotalStudentsMorningPresentCount = totalMorningPresent;
            attendanceSummaryReportModel.TotalStudentsMorningAbsentCount  = totalMorningAbsent;
            attendanceSummaryReportModel.TotalStudentsLunchPresentCount   = totalLunchPresent;
            attendanceSummaryReportModel.TotalStudentsLunchAbsentCount    = totalLunchAbsent;
            return(attendanceSummaryReportModel);
        }