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; }
//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 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 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 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; }
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; }
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; }
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 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; }
public void ConvertFeeToFeeBDO(Fee fb, FeeBDO f) { f.Deactivated = fb.Deactivated; f.FeeID = fb.FeeID; f.FeeDescription = fb.FeeDescription; }