Exemplo n.º 1
0
        public List <FeeBDO> GetAllFeesForGradeLevel(string gradeLevel)
        {
            FeeDAO        fdao        = new FeeDAO();
            List <Fee>    studentFees = null;
            List <FeeBDO> sfbdoList   = new List <FeeBDO>();

            try {
                using (var DCEnt = new DCFIEntities())
                {
                    studentFees = (from sf in DCEnt.Fees
                                   where sf.GradeLevel == gradeLevel
                                   select sf).ToList <Fee>();
                }
                foreach (Fee s in studentFees)
                {
                    FeeBDO sBDO = new FeeBDO();
                    fdao.ConvertFeeToFeeBDO(s, sBDO);
                    sfbdoList.Add(sBDO);
                }
            }
            catch (DbEntityValidationException dbEx)
            {
                foreach (var validationErrors in dbEx.EntityValidationErrors)
                {
                    foreach (var validationError in validationErrors.ValidationErrors)
                    {
                        Trace.TraceInformation("Property: {0} Error: {1}",
                                               validationError.PropertyName,
                                               validationError.ErrorMessage);
                    }
                }
            }
            return(sfbdoList);
        }
Exemplo n.º 2
0
        public List<FeeBDO> GetAllFeesForGradeLevel(string gradeLevel)
        {
            FeeDAO fdao = new FeeDAO();
            List<Fee> studentFees = null;
            List<FeeBDO> sfbdoList = new List<FeeBDO>();
            try {
            using (var DCEnt = new DCFIEntities())
            {
                studentFees = (from sf in DCEnt.Fees
                               where sf.GradeLevel == gradeLevel
                               select sf).ToList<Fee>();

            }
            foreach (Fee s in studentFees)
            {
                FeeBDO sBDO = new FeeBDO();
                fdao.ConvertFeeToFeeBDO(s, sBDO);
                sfbdoList.Add(sBDO);
            }
            }
            catch (DbEntityValidationException dbEx)
            {
                foreach (var validationErrors in dbEx.EntityValidationErrors)
                {
                    foreach (var validationError in validationErrors.ValidationErrors)
                    {
                        Trace.TraceInformation("Property: {0} Error: {1}",
                                                validationError.PropertyName,
                                                validationError.ErrorMessage);
                    }
                }
            }
            return sfbdoList;
        }
Exemplo n.º 3
0
        public void ConvertAssessToAssessBDO(StudentAssessment a, StudentAssessmentBDO ab)
        {
            FeeDAO fd = new FeeDAO();
            FeeBDO fb = new FeeBDO();
            ScholarshipDAO sd = new ScholarshipDAO();
            ScholarshipDiscountBDO sb = new ScholarshipDiscountBDO();

            if (a.DiscountId.HasValue)
            {
                int d = (int)a.DiscountId;
                sb = sd.GetScholarship(d);
                ab.DiscountId = (int)a.DiscountId;
            }

            ab.StudentAssessmentId = a.StudentAssessmentId;
            ab.StudentSY = a.StudentSY;
            ab.FeeID = a.FeeID;
            ab.Fee = fd.GetFee((int)ab.FeeID);

            ab.ScholarshipDiscount = sb;
        }
Exemplo n.º 4
0
        public void ConvertAssessToAssessBDO(StudentAssessment a, StudentAssessmentBDO ab)
        {
            FeeDAO                 fd = new FeeDAO();
            FeeBDO                 fb = new FeeBDO();
            ScholarshipDAO         sd = new ScholarshipDAO();
            ScholarshipDiscountBDO sb = new ScholarshipDiscountBDO();

            if (a.DiscountId.HasValue)
            {
                int d = (int)a.DiscountId;
                sb            = sd.GetScholarship(d);
                ab.DiscountId = (int)a.DiscountId;
            }

            ab.StudentAssessmentId = a.StudentAssessmentId;
            ab.StudentSY           = a.StudentSY;
            ab.FeeID = a.FeeID;
            ab.Fee   = fd.GetFee((int)ab.FeeID);

            ab.ScholarshipDiscount = sb;
        }