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; }
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; }
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; }
//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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; } }
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; }
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; }
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; }
public bool CreateFee(ref Fee fee, ref string message) { FeeBDO fbdo = new FeeBDO(); TranslateFeeToFeeBDO(fee, fbdo); return flogic.CreateFee(ref fbdo, ref message); }
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; }
public Boolean UpdateFee(ref FeeBDO fbdo, ref string message) { return fDao.UpdateFee(ref fbdo, ref message); }
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; }
private void ConvertFeeToFeeBDO(Fee fb, FeeBDO f) { f.Deactivated = fb.Deactivated; f.FeeCode = fb.FeeCode; f.FeeDescription = fb.FeeDescription; }
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; }
public void ConvertFeeToFeeBDO(Fee fb, FeeBDO f) { f.Deactivated = fb.Deactivated; f.FeeID = fb.FeeID; f.FeeDescription = fb.FeeDescription; }
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; }
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; }