Example #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;
        }
Example #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;
        }
Example #3
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;
        }
Example #4
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;
 }
Example #5
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;
        }
Example #6
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;
        }
Example #7
0
 private void ConvertFeeBDOToFee(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;
 }
Example #8
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;
 }
Example #9
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;
 }
Example #10
0
 private void ConvertFeeToFeeBDO(Fee fb, FeeBDO f)
 {
     f.Deactivated = fb.Deactivated;
     f.FeeCode = fb.FeeCode;
     f.FeeDescription = fb.FeeDescription;
 }
Example #11
0
 private void ConvertScholarshipDiscountBDOToScholarshipDiscount(ScholarshipDiscountBDO d, ScholarshipDiscount sd, string scholarshipCode)
 {
     Fee f = new Fee();
     ConvertFeeBDOToFee(d.Fee, f);
     sd.Deactivated = d.Deactivated;
     sd.Discount = d.Discount;
     sd.FeeCode = d.FeeCode;
     sd.ScholarshipFeeCode = d.ScholarshipFeeCode;
     sd.Fee = f;
 }
Example #12
0
 private void ConvertFeeToFeeBDO(Fee fb, FeeBDO f)
 {
     f.Deactivated    = fb.Deactivated;
     f.FeeCode        = fb.FeeCode;
     f.FeeDescription = fb.FeeDescription;
 }
Example #13
0
 public void ConvertFeeToFeeBDO(Fee fb, FeeBDO f)
 {
     f.Deactivated = fb.Deactivated;
     f.FeeID = fb.FeeID;
     f.FeeDescription = fb.FeeDescription;
 }
Example #14
0
 public void ConvertFeeToFeeBDO(Fee fb, FeeBDO f)
 {
     f.Deactivated    = fb.Deactivated;
     f.FeeID          = fb.FeeID;
     f.FeeDescription = fb.FeeDescription;
 }