public int SaveResult(Result r) { r.CreatedDate = DateTime.Now; r.UpdatedDate = DateTime.Now; using (var context = new STUDENT_GRADE_MANGEREntities()) { context.Result.Add(r); return(context.SaveChanges()); } }
public int SaveAssessment(ModuleAssessment r) { r.CreatedDate = DateTime.Now; r.UpdatedDate = DateTime.Now; try { using (var context = new STUDENT_GRADE_MANGEREntities()) { context.ModuleAssessment.Add(r); return(context.SaveChanges()); } } catch (Exception ex) { Console.Write(ex); return(0); } }
public int SaveCourseModule(CourseModule m) { m.CreatedDate = DateTime.Now; m.UpdatedDate = DateTime.Now; try { using (var context = new STUDENT_GRADE_MANGEREntities()) { context.CourseModule.Add(m); return(context.SaveChanges()); } } catch (Exception ex) { Console.Write(ex); return(0); } }
public int SaveStudent(Student student) { student.CreatedDate = DateTime.Now; student.UpdatedDate = DateTime.Now; try { using (var context = new STUDENT_GRADE_MANGEREntities()) { context.Student.Add(student); return(context.SaveChanges()); } } catch (Exception ex) { Console.Write(ex); return(0); } }