Ejemplo n.º 1
0
 /***
 * function: Add()
 * param : DMDiemIn
 * result: int
 * author: vietvb
 * Thêm dữ liệu, trả ra id
 * */
 public int Add(DMDiemInModel DMDiemIn)
 {
     db.DMDiemIns.Add(DMDiemIn.toCreate());
     return db.SaveChanges();
 }
Ejemplo n.º 2
0
 /***
 * function: Update()
 * param : DMDiemIn
 * result: int
 * author: vietvb
 * Update dữ liệu, trả ra id
 * */
 public int Update(DMDiemInModel diemIn)
 {
     //get old data
     DMDiemIn Old = db.DMDiemIns.Find(diemIn.Id);
     diemIn.changeEdit(Old);
     //edit
     db.Entry(Old).State = EntityState.Modified;
     return db.SaveChanges();
 }