Example #1
0
        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;
        }
Example #2
0
        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;
        }
Example #3
0
 private void ConvertGradeLevelToGradeLevelBDO(GradeLevel g, GradeLevelBDO gbdo)
 {
     gbdo.Description = g.Description;
     gbdo.GradeLev = g.GradeLevel1;
 }
Example #4
0
 private void ConvertGradeLevelBDOToGradeLevel(GradeLevelBDO gbdo, GradeLevel g)
 {
     g.Description = gbdo.Description;
     g.GradeLevel1 = gbdo.GradeLev;
 }
Example #5
0
 public void ConvertGradeLevelToGradeLevelBDO(GradeLevel g, GradeLevelBDO gbdo)
 {
     gbdo.Description = g.Description;
     gbdo.GradeLev = g.GradeLevel1;
     gbdo.Category = g.Category;
 }
Example #6
0
 public void ConvertGradeLevelBDOToGradeLevel(GradeLevelBDO gbdo, GradeLevel g)
 {
     g.Description = gbdo.Description;
     g.GradeLevel1 = gbdo.GradeLev;
     g.Category = gbdo.Category;
 }