public JsonResult Save(Tbl_AttandanceMid record) { Tbl_AttandanceMid entity; using (DIUBDatabaseEntities8 context = new DIUBDatabaseEntities8()) { if (record.AttandanceID > 0) { entity = context.Tbl_AttandanceMid.First(p => p.AttandanceID == record.AttandanceID); entity.StudentID = record.StudentID; entity.StudentName = record.StudentName; entity.Day1 = record.Day1; entity.Day2 = record.Day2; entity.Day3 = record.Day3; entity.Day4 = record.Day4; entity.Day5 = record.Day5; entity.Day6 = record.Day6; entity.Day7 = record.Day7; entity.Day8 = record.Day8; entity.Day9 = record.Day9; entity.Day10 = record.Day10; entity.Day11 = record.Day11; entity.Day12 = record.Day12; entity.TotalAttandanceMid = record.TotalAttandanceMid; } context.SaveChanges(); } return(Json(new { result = true })); }
public void Add(Tbl_Entity entity) { _dbSet.Add(entity); _DBEntity.SaveChanges(); }
public void SaveChanges() { DBEntity.SaveChanges(); }