Exemplo n.º 1
0
        public Boolean CreateFee(ref FeeBDO fBDO, ref string message)
        {
            message = "Fee Added Successfully";
            bool ret = true;

            Fee f = new Fee();
            try {
            ConvertFeeBDOToFee(fBDO, f);
            using (var DCEnt = new DCFIEntities())
            {
                DCEnt.Fees.Attach(f);
                DCEnt.Entry(f).State = System.Data.Entity.EntityState.Added;
                int num = DCEnt.SaveChanges();

                if (num != 1)
                {
                    ret = false;
                    message = "Adding of Fee failed";
                }
            }
            }
            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 ret;
        }
Exemplo n.º 2
0
        public FeeBDO GetFee(int FeeId) {
            Fee fe = new Fee();
            FeeBDO fb = new FeeBDO();
            try { 
            using (var DCEnt = new DCFIEntities())
            {
                fe = (from f in DCEnt.Fees
                      where f.FeeID==FeeId
                      select f).FirstOrDefault();
            }
            ConvertFeeToFeeBDO(fe, fb);
        }
            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 fb;
        }
Exemplo n.º 3
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.º 4
0
        //Changed
        public FeeBDO GetFeeForAll(string currSY)
        {
            Fee fe = new Fee();
            FeeBDO fb = new FeeBDO();
            try { 
            using (var DCEnt = new DCFIEntities())
            {
               fe = (from f in DCEnt.Fees
                             where f.GradeLevel.Equals("0") && f.SYImplemented.Equals(currSY)
                     select f).FirstOrDefault();
            }
                ConvertFeeToFeeBDO(fe, fb);
        }
            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 fb;
        }
Exemplo n.º 5
0
 public List<FeeBDO> ToFeeBDOList(List<Fee> fList) {
     List<FeeBDO> feeList = new List<FeeBDO>();
     foreach (Fee f in fList) {
         FeeBDO fbdo = new FeeBDO();
         TranslateFeeToFeeBDO(f, fbdo);
         feeList.Add(fbdo);
     }
     return feeList;
 }
Exemplo n.º 6
0
 public void TranslateFeeBDOToFee(FeeBDO fbdo, Fee f) {
     f.Deactivated = fbdo.Deactivated;
     f.FeeCode = fbdo.FeeCode;
     f.FeeDescription = fbdo.FeeDescription;
     f.Unit = fbdo.Unit;
     f.Amount = fbdo.Amount;
     f.DateSet = fbdo.DateSet;
     f.GradeLevel = fbdo.GradeLevel;
     f.SYImplemented = fbdo.SYImplemented;
     
 }
Exemplo n.º 7
0
 public void ConvertFeeBDOToFee(FeeBDO fbdo, Fee f)
 {
     f.Deactivated = fbdo.Deactivated;
     f.FeeID = fbdo.FeeID;
     f.FeeDescription = fbdo.FeeDescription;
     f.NumPay = fbdo.NumPay;
     f.DiscountFullPay = fbdo.DiscountFullPay;
     f.Amount = fbdo.Amount;
     //   f.DateSet = (DateTime)fbdo.DateSet;
     f.GradeLevel = fbdo.GradeLevel;
     f.SYImplemented = fbdo.SYImplemented;
 }
Exemplo n.º 8
0
        public void TranslateFeeToFeeBDO(Fee f, FeeBDO fbdo)
        {
            fbdo.Deactivated = f.Deactivated;
            fbdo.FeeID = f.FeeID;
            fbdo.FeeDescription = f.FeeDescription;
            fbdo.NumPay = f.NumPay;
            fbdo.DiscountFullPay = f.DiscountFullPay;
            fbdo.Amount = f.Amount;
            fbdo.GradeLevel = f.GradeLevel;
            fbdo.SYImplemented = f.SYImplemented;

        }
Exemplo n.º 9
0
        public void ConvertFeeToFeeBDO(Fee f, FeeBDO fBDO)
        {
            GradeLevelDAO gdao = new GradeLevelDAO();

            fBDO.Deactivated = f.Deactivated;
            fBDO.FeeID = f.FeeID;
            fBDO.FeeDescription = f.FeeDescription;
            fBDO.NumPay = f.NumPay;
            fBDO.DiscountFullPay = f.DiscountFullPay;
            fBDO.Amount = f.Amount;

            fBDO.GradeLevel = f.GradeLevel;
            fBDO.SYImplemented = f.SYImplemented;
        }
Exemplo n.º 10
0
        public List<FeeBDO> GetAllFees()
        {
            List<Fee> fList = new List<Fee>();
            using (var DCEnt = new DCFIEntities())
            {
                var allFees = (DCEnt.Fees);
                fList = allFees.ToList<Fee>();
            }

            List<FeeBDO> fBDOList = new List<FeeBDO>();
            foreach (Fee f in fList)
            {
                FeeBDO fBDO = new FeeBDO();
                ConvertFeeToFeeBDO(f, fBDO);
                fBDOList.Add(fBDO);
            }
            return fBDOList;
        }
Exemplo n.º 11
0
        public List<FeeBDO> GetAllFeesForGradeLevel(string gradeLevel)
        {
            List<Fee> studentFees = null;
            List<FeeBDO> sfbdoList = new List<FeeBDO>();
            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();
                ConvertFeeToFeeBDO(s, sBDO);
                sfbdoList.Add(sBDO);
            }
            return sfbdoList;
        }
Exemplo n.º 12
0
        public void TranslateFeeBDOToFee(FeeBDO fbdo, Fee f)
        {
            GradeLevelService gService = new GradeLevelService();
            if (fbdo != null)
            {
                f.Deactivated = fbdo.Deactivated;
                f.FeeID = fbdo.FeeID;
                f.FeeDescription = fbdo.FeeDescription;
                fbdo.NumPay = fbdo.NumPay ?? 0;
                f.NumPay = (int)fbdo.NumPay;
                fbdo.DiscountFullPay = fbdo.DiscountFullPay ?? 0;
                f.DiscountFullPay = (float)fbdo.DiscountFullPay;
                f.Amount = fbdo.Amount;
                //gService.
                f.GradeLev = gService.GetGradeLevel(fbdo.GradeLevel);
                f.GradeLevel = fbdo.GradeLevel;
                f.SYImplemented = fbdo.SYImplemented;
            }

        }
Exemplo n.º 13
0
        public Boolean CreateFee(ref FeeBDO fBDO, ref string message)
        {
            message = "Fee Added Successfully";
            bool ret = true;

            Fee f = new Fee();
            ConvertFeeBDOToFee(fBDO, f);
            using (var DCEnt = new DCFIEntities())
            {
                DCEnt.Fees.Attach(f);
                DCEnt.Entry(f).State = System.Data.Entity.EntityState.Added;
                int num = DCEnt.SaveChanges();

                if (num != 1)
                {
                    ret = false;
                    message = "Adding of Fee failed";
                }
            }
            return ret;
        }
Exemplo n.º 14
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.º 15
0
        public Boolean UpdateFee(ref FeeBDO fBDO, ref string message)
        {
            message = "Fee updated successfully.";
            Boolean ret = true;
            using (var DCEnt = new DCFIEntities())
            {
                var fCode = fBDO.FeeCode;
                Fee fInDB = (from f in DCEnt.Fees
                                    where f.FeeCode == fCode
                                    select f).FirstOrDefault();
                if (fInDB == null)
                {
                    throw new Exception("No Fee " + fBDO.FeeCode);
                }
                DCEnt.Fees.Remove(fInDB);
                fInDB.Deactivated = fBDO.Deactivated;
                fInDB.FeeCode = fBDO.FeeCode;
                fInDB.FeeDescription = fBDO.FeeDescription;
                fInDB.Unit = fBDO.Unit;
                fInDB.Amount = fBDO.Amount;
                fInDB.DateSet = fBDO.DateSet;
                fInDB.GradeLevel = fBDO.GradeLevel;
                fInDB.SYImplemented = fBDO.SYImplemented;

                DCEnt.Fees.Attach(fInDB);
                DCEnt.Entry(fInDB).State = System.Data.Entity.EntityState.Modified;
                int num = DCEnt.SaveChanges();

                if (num != 1)
                {
                    ret = false;
                    message = "No fee is updated.";
                }
            }
            return ret;

        }
Exemplo n.º 16
0
 public bool CreateFee(ref Fee fee, ref string message)
 {
     FeeBDO fbdo = new FeeBDO();
     TranslateFeeToFeeBDO(fee, fbdo);
     return flogic.CreateFee(ref fbdo, ref message);
 }
Exemplo n.º 17
0
 private void ConvertFeeToFeeBDO(Fee f, FeeBDO fBDO)
 {
     fBDO.Deactivated = f.Deactivated;
     fBDO.FeeCode = f.FeeCode;
     fBDO.FeeDescription = f.FeeDescription;
     fBDO.Unit = f.Unit;
     fBDO.Amount = f.Amount;
     fBDO.DateSet = f.DateSet;
     fBDO.GradeLevel = f.GradeLevel;
     fBDO.SYImplemented = f.SYImplemented;
 }
Exemplo n.º 18
0
 public Boolean UpdateFee(ref FeeBDO fbdo, ref string message)
 {
     return fDao.UpdateFee(ref fbdo, ref message);
 }
Exemplo n.º 19
0
 private void ConvertFeeToFeeBDO(Fee sf, FeeBDO sfBDO)
 {
     sfBDO.Amount = sf.Amount;
     sfBDO.DateSet = sf.DateSet;
     sfBDO.Deactivated = sf.Deactivated;
     sfBDO.FeeCode = sf.FeeCode;
     sfBDO.GradeLevel = sf.GradeLevel;
     sfBDO.SYImplemented = sf.SYImplemented;
 }
Exemplo n.º 20
0
 private void ConvertFeeToFeeBDO(Fee fb, FeeBDO f)
 {
     f.Deactivated = fb.Deactivated;
     f.FeeCode = fb.FeeCode;
     f.FeeDescription = fb.FeeDescription;
 }
Exemplo n.º 21
0
 private void ConvertScholarshipDiscountToScholarshipDiscountBDO(ScholarshipDiscount d, ScholarshipDiscountBDO sd, string scholarshipCode)
 {
     FeeBDO f = new FeeBDO();
     ConvertFeeToFeeBDO(d.Fee, f);
     sd.Deactivated = d.Deactivated;
     sd.Discount = d.Discount;
     sd.FeeCode = d.FeeCode;
     sd.ScholarshipFeeCode = d.ScholarshipFeeCode;
     sd.Fee = f;
 }
Exemplo n.º 22
0
 public void ConvertFeeToFeeBDO(Fee fb, FeeBDO f)
 {
     f.Deactivated = fb.Deactivated;
     f.FeeID = fb.FeeID;
     f.FeeDescription = fb.FeeDescription;
 }
Exemplo n.º 23
0
        public Boolean UpdateFee(ref FeeBDO fBDO, ref string message)
        {
            message = "Fee updated successfully.";
            Boolean ret = true;
            try {
            using (var DCEnt = new DCFIEntities())
            {
                var fCode = fBDO.FeeID;
                Fee fInDB = (from f in DCEnt.Fees
                             where f.FeeID == fCode
                             select f).FirstOrDefault();
                if (fInDB == null)
                {
                    throw new Exception("No Fee " + fBDO.FeeID);
                }
                DCEnt.Fees.Remove(fInDB);
                ConvertFeeBDOToFee(fBDO, fInDB);

                DCEnt.Fees.Attach(fInDB);
                DCEnt.Entry(fInDB).State = System.Data.Entity.EntityState.Modified;
                int num = DCEnt.SaveChanges();

                if (num != 1)
                {
                    ret = false;
                    message = "No fee is updated.";
                }
            }
            }
            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 ret;
        }
Exemplo n.º 24
0
 public List<FeeBDO> ToFeeBDOList(List<Fee> fList)
 {
     List<FeeBDO> fbList = new List<FeeBDO>();
     foreach (Fee f in fList)
     {
         FeeBDO fb = new FeeBDO();
         ConvertFeeToFeeBDO(f, fb);
         fbList.Add(fb);
     }
     return fbList;
 }