public PrintGetExpensesList PrintGetExpensesList() { var model = new PrintGetExpensesList(); try { var ExpensesList = _ExpensesRepo.GetAll().ToList(); var institution = _InstitutionsRepo.GetAll().FirstOrDefault(); var ExpenseTypeList = _ExpenseTypesRepo.GetAll().ToList(); var query = (from _Expenses in ExpensesList join _ExpenseType in ExpenseTypeList on _Expenses?.ExpenseTypeId equals _ExpenseType?.Id orderby _ExpenseType.Name ascending select new { _Expenses, _ExpenseType }); var list = new List <PrintGetExpensesList_Expenses>(); foreach (var item in query) { var temp = new PrintGetExpensesList_Expenses() { Id = item._Expenses.Id, Name = item._Expenses.Name, Amount = item._Expenses.Amount, Date = item._Expenses.Date, ExpenseTypeId = item._Expenses.ExpenseTypeId, ExpenseTypeName = item._ExpenseType.Name }; list.Add(temp); } ; //[NOTE: map institutions] var currentInstitution = new PrintGetExpensesList_Institutions() { Id = institution.Id, Name = institution.Name, IsActive = institution.IsActive, LogoPath = institution.LogoPath, FaviconPath = institution.FaviconPath, Email = institution.Email, ContactNo = institution.ContactNo, Address = institution.Address }; model = new PrintGetExpensesList() { _Expenses = list, Institution = currentInstitution }; } catch (Exception) { } return(model); }
public PrintGetStaffsList PrintGetStaffsList() { var model = new PrintGetStaffsList(); try { var StaffsList = _StaffsRepo.GetAll().ToList(); var DesignationsList = _DesignationsRepo.GetAll().ToList(); var institution = _InstitutionsRepo.GetAll().FirstOrDefault(); var query = (from _Staffs in StaffsList join _Designations in DesignationsList on _Staffs?.DesignationId equals _Designations?.Id orderby _Staffs.FirstName ascending select new { _Staffs, _Designations }); var list = new List <PrintGetStaffsList_Staffs>(); foreach (var item in query) { var temp = new PrintGetStaffsList_Staffs() { Id = item._Staffs.Id, DesignationId = item._Staffs.DesignationId, FirstName = item._Staffs.FirstName, LastName = item._Staffs.LastName, Name = item._Staffs.FirstName + " " + item._Staffs.LastName, Designation = item._Designations.Name, Cell = item._Staffs.Cell, Email = item._Staffs.Email, Education = item._Staffs.Education, Address = item._Staffs.Address }; list.Add(temp); } ; //[NOTE: map institutions] var currentInstitution = new PrintGetStaffsList_Institutions() { Id = institution.Id, Name = institution.Name, IsActive = institution.IsActive, LogoPath = institution.LogoPath, FaviconPath = institution.FaviconPath, Email = institution.Email, ContactNo = institution.ContactNo, Address = institution.Address }; model = new PrintGetStaffsList() { _Staffs = list, Institution = currentInstitution }; } catch (Exception) { } return(model); }
public PrintGetFeeStructuresList PrintGetFeeStructuresList() { var model = new PrintGetFeeStructuresList(); try { var institution = _InstitutionsRepo.GetAll().FirstOrDefault(); var FeeStructuresList = _FeeStructuresRepo.GetAll().ToList(); var FeeTypesList = _FeeTypesRepo.GetAll().ToList(); var classList = _classesRepo.GetAll().ToList(); var query = (from _FeeStructure in FeeStructuresList join _FeeTypes in FeeTypesList on _FeeStructure?.FeeTypeId equals _FeeTypes?.Id join _class in classList on _FeeStructure?.ClassId equals _class?.Id select new { _FeeStructure, _FeeTypes, _class }); var list = new List <PrintGetFeeStructuresList_FeeStructures>(); foreach (var item in query) { var temp = new PrintGetFeeStructuresList_FeeStructures() { Id = item._FeeStructure.Id, ClassId = item._FeeStructure.ClassId, Class = item._class.Name, FeeTypeId = item._FeeStructure.FeeTypeId, FeeType = item._FeeTypes.Name, FeeTypeMood = item._FeeStructure.YearlyTermNo, Amount = item._FeeStructure.Amount, StartingYear = item._FeeStructure.StartingYear, EndingYear = item._FeeStructure.EndingYear, IsActive = item._FeeStructure.IsActive }; list.Add(temp); } ; //[NOTE: map institutions] var currentInstitution = new PrintGetFeeStructuresList_Institutions() { Id = institution.Id, Name = institution.Name, IsActive = institution.IsActive, LogoPath = institution.LogoPath, FaviconPath = institution.FaviconPath, Email = institution.Email, ContactNo = institution.ContactNo, Address = institution.Address }; model = new PrintGetFeeStructuresList() { _FeeStructures = list, Institution = currentInstitution }; } catch (Exception) { } return(model); }
public PrintGetStudentPaymentsList PrintGetStudentPaymentsList() { var model = new PrintGetStudentPaymentsList(); try { var institution = _InstitutionsRepo.GetAll().FirstOrDefault(); var StudentPaymentsList = _StudentPaymentsRepo.GetAll().ToList(); var studentsList = _studentsRepo.GetAll().ToList(); var FeeTypesList = _FeeTypesRepo.GetAll().ToList(); var query = (from _StudentPayments in StudentPaymentsList join _Students in studentsList on _StudentPayments?.StudentId equals _Students?.Id join _FeeTypes in FeeTypesList on _StudentPayments?.FeeTypeId equals _FeeTypes?.Id select new { _StudentPayments, /*_StudentDiscounts,*/ _Students, _FeeTypes }); var list = new List <PrintGetStudentPaymentsList_StudentPayments>(); foreach (var item in query) { var temp = new PrintGetStudentPaymentsList_StudentPayments() { Id = item._StudentPayments.Id, ClassId = item._StudentPayments.ClassId, FeeYearDate = item._StudentPayments.FeeYearDate, StudentId = item._StudentPayments.StudentId, StudentName = item._Students.FirstName + " " + item._Students.LastName, FeeTypeId = item._StudentPayments.FeeTypeId, FeeType = item._FeeTypes.Name, Fine = item._StudentPayments.Fine, PaidAmount = item._StudentPayments.PaidAmount, PaymentDate = item._StudentPayments.PaymentDate, Remarks = item._StudentPayments.Remarks }; list.Add(temp); } ; //[NOTE: map institutions] var currentInstitution = new PrintGetStudentPaymentsList_Institutions() { Id = institution.Id, Name = institution.Name, IsActive = institution.IsActive, LogoPath = institution.LogoPath, FaviconPath = institution.FaviconPath, Email = institution.Email, ContactNo = institution.ContactNo, Address = institution.Address }; model = new PrintGetStudentPaymentsList() { _StudentPayments = list, Institution = currentInstitution }; } catch (Exception) { } return(model); }
public PrintGetExpenseTypeList PrintGetExpenseTypesList() { var model = new PrintGetExpenseTypeList(); try { var ExpenseTypeList = _ExpenseTypesRepo.GetAll().ToList(); var institution = _InstitutionsRepo.GetAll().FirstOrDefault(); var list = new List <PrintGetExpenseTypeList_ExpenseTypes>(); foreach (var item in ExpenseTypeList) { var temp = new PrintGetExpenseTypeList_ExpenseTypes() { Id = item.Id, Name = item.Name, IsActive = item.IsActive }; list.Add(temp); } ; //[NOTE: map institutions] var currentInstitution = new PrintGetExpenseTypeList_Institutions() { Id = institution.Id, Name = institution.Name, IsActive = institution.IsActive, LogoPath = institution.LogoPath, FaviconPath = institution.FaviconPath, Email = institution.Email, ContactNo = institution.ContactNo, Address = institution.Address }; model = new PrintGetExpenseTypeList() { _ExpenseTypes = list, Institution = currentInstitution }; } catch (Exception) { } return(model); }
public PrintGetStudentsList PrintGetStudentsList() { var model = new PrintGetStudentsList(); try { var studentsList = _studentsRepo.GetAll().ToList(); var institution = _InstitutionsRepo.GetAll().FirstOrDefault(); var ClassList = _classesRepo.GetAll().ToList(); var GendersList = _GendersRepo.GetAll().ToList(); var query = (from _students in studentsList join _Classes in ClassList on _students?.ClassId equals _Classes?.Id join _Genders in GendersList on _students?.GenderId equals _Genders?.Id select new { _students, _Classes, _Genders }); var list = new List <PrintGetStudentsList_Students>(); foreach (var item in query) { var temp = new PrintGetStudentsList_Students() { Id = item._students.Id, ClassId = item._students.ClassId, ClassName = item._Classes.Name, GenderId = item._students.GenderId, RegistrationNo = item._students.RegistrationNo, GenderName = item._Genders.Name, FirstName = item._students.FirstName, LastName = item._students.LastName, StudentName = item._students.FirstName + " " + item._students.LastName, IP300X200 = item._students.IP300X200, AdmittedYear = item._students.AdmittedYear, PresentAddress = item._students.PresentAddress, PermanentAddress = item._students.PermanentAddress, DOB = item._students.DOB, IsActive = item._students.IsActive, AddedBy = 0, AddedDate = DateTime.Now, ModifiedBy = 0, ModifiedDate = DateTime.Now, FatherName = item._students.FatherName, MotherName = item._students.MotherName, ParentsName = item._students.FatherName + " " + item._students.MotherName, DataType = null }; list.Add(temp); } ; //[NOTE: map institutions] var currentInstitution = new PrintGetStudentsList_Institutions() { Id = institution.Id, Name = institution.Name, IsActive = institution.IsActive, LogoPath = institution.LogoPath, FaviconPath = institution.FaviconPath, Email = institution.Email, ContactNo = institution.ContactNo, Address = institution.Address }; model = new PrintGetStudentsList() { _Students = list, Institution = currentInstitution }; } catch (Exception) { } return(model); }