public override void DeleteRecord(int id) { var context = new MoneyBoxEntities(); var obj = new tblMoneyBox_Records {Id = id}; context.AttachTo("tblMoneyBox_Records", obj); context.DeleteObject(obj); context.SaveChanges(); }
public override int InsertRecord(Record record) { var context = new MoneyBoxEntities(); var obj = new tblMoneyBox_Records(); record.CopyToObject(obj); context.AddTotblMoneyBox_Records(obj); context.SaveChanges(); return obj.Id; }
private static Record Convert(tblMoneyBox_Records obj) { if (obj == null) { return null; } var money = new Record(obj.Id, obj.CreatedDate, obj.CreatedBy, obj.ModifiedDate, obj.ModifiedBy); money.CopyFromObject(obj); return money; }
public override void UpdateRecord(Record record) { var context = new MoneyBoxEntities(); var obj = new tblMoneyBox_Records {Id = record.Id}; context.AttachTo("tblMoneyBox_Records", obj); record.CopyToObject(obj); context.SaveChanges(); }