public void ConvertGradeLevelBDOToGradeLevel(GradeLevelBDO gbdo, GradeLevel g) { g.Description = gbdo.Description; g.GradeLevel1 = gbdo.GradeLev; g.Category = gbdo.Category; g.level = gbdo.level; }
public Boolean CreateGradeLevel(ref GradeLevelBDO gBDO, ref string message) { message = "Grade Level Added Successfully"; bool ret = true; GradeLevel g = new GradeLevel(); try { ConvertGradeLevelBDOToGradeLevel(gBDO, g); using (var DCEnt = new DCFIEntities()) { DCEnt.GradeLevels.Attach(g); DCEnt.Entry(g).State = System.Data.Entity.EntityState.Added; int num = DCEnt.SaveChanges(); if (num != 1) { ret = false; message = "Adding of Grade Level 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 void ConvertGradeLevelToGradeLevelBDO(GradeLevel g, GradeLevelBDO gbdo) { gbdo.Description = g.Description; gbdo.GradeLev = g.GradeLevel1; gbdo.Category = g.Category; gbdo.level = g.level; }
public Boolean UpdateGradeLevel(ref GradeLevelBDO gBDO, ref string message) { message = "Grade Level updated successfully."; Boolean ret = true; using (var DCEnt = new DCFIEntities()) { var gCode = gBDO.GradeLev; GradeLevel gInDB = (from g in DCEnt.GradeLevels where g.GradeLevel1 == gCode select g).FirstOrDefault(); if (gInDB == null) { throw new Exception("No Grade Level " + gBDO.GradeLev); } DCEnt.GradeLevels.Remove(gInDB); gInDB.GradeLevel1 = gBDO.GradeLev; gInDB.Description = gBDO.Description; DCEnt.GradeLevels.Attach(gInDB); DCEnt.Entry(gInDB).State = System.Data.Entity.EntityState.Modified; int num = DCEnt.SaveChanges(); if (num != 1) { ret = false; message = "No grade level is updated."; } } return(ret); }
public Boolean UpdateGradeLevel(ref GradeLevelBDO gBDO, ref string message) { message = "Grade Level updated successfully."; Boolean ret = true; try { using (var DCEnt = new DCFIEntities()) { var gCode = gBDO.GradeLev; GradeLevel gInDB = (from g in DCEnt.GradeLevels where g.GradeLevel1 == gCode select g).FirstOrDefault(); if (gInDB == null) { throw new Exception("No Grade Level " + gBDO.GradeLev); } DCEnt.GradeLevels.Remove(gInDB); gInDB.GradeLevel1 = gBDO.GradeLev; gInDB.Description = gBDO.Description; DCEnt.GradeLevels.Attach(gInDB); DCEnt.Entry(gInDB).State = System.Data.Entity.EntityState.Modified; int num = DCEnt.SaveChanges(); if (num != 1) { ret = false; message = "No grade level 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 Boolean CreateGradeLevel(ref GradeLevelBDO gBDO, ref string message) { message = "Grade Level Added Successfully"; bool ret = true; GradeLevel g = new GradeLevel(); ConvertGradeLevelBDOToGradeLevel(gBDO, g); using (var DCEnt = new DCFIEntities()) { DCEnt.GradeLevels.Attach(g); DCEnt.Entry(g).State = System.Data.Entity.EntityState.Added; int num = DCEnt.SaveChanges(); if (num != 1) { ret = false; message = "Adding of Grade Level failed"; } } return ret; }
public Boolean CreateGradeLevel(ref GradeLevelBDO gBDO, ref string message) { message = "Grade Level Added Successfully"; bool ret = true; GradeLevel g = new GradeLevel(); ConvertGradeLevelBDOToGradeLevel(gBDO, g); using (var DCEnt = new DCFIEntities()) { DCEnt.GradeLevels.Attach(g); DCEnt.Entry(g).State = System.Data.Entity.EntityState.Added; int num = DCEnt.SaveChanges(); if (num != 1) { ret = false; message = "Adding of Grade Level failed"; } } return(ret); }
public Boolean CreateGradeLevel(ref GradeLevelBDO gBDO, ref string message) { message = "Grade Level Added Successfully"; bool ret = true; GradeLevel g = new GradeLevel(); try { ConvertGradeLevelBDOToGradeLevel(gBDO, g); using (var DCEnt = new DCFIEntities()) { DCEnt.GradeLevels.Attach(g); DCEnt.Entry(g).State = System.Data.Entity.EntityState.Added; int num = DCEnt.SaveChanges(); if (num != 1) { ret = false; message = "Adding of Grade Level 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); }
private void ConvertGradeLevelToGradeLevelBDO(GradeLevel g, GradeLevelBDO gbdo) { gbdo.Description = g.Description; gbdo.GradeLev = g.GradeLevel1; }
private void ConvertGradeLevelBDOToGradeLevel(GradeLevelBDO gbdo, GradeLevel g) { g.Description = gbdo.Description; g.GradeLevel1 = gbdo.GradeLev; }
public void ConvertGradeLevelToGradeLevelBDO(GradeLevel g, GradeLevelBDO gbdo) { gbdo.Description = g.Description; gbdo.GradeLev = g.GradeLevel1; gbdo.Category = g.Category; }
public void ConvertGradeLevelBDOToGradeLevel(GradeLevelBDO gbdo, GradeLevel g) { g.Description = gbdo.Description; g.GradeLevel1 = gbdo.GradeLev; g.Category = gbdo.Category; }