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 InsertCategory(Category category)
 {
     var context = new MoneyBoxEntities();
     var obj = new tblMoneyBox_Categories();
     category.CopyToObject(obj);
     context.AddTotblMoneyBox_Categories(obj);
     context.SaveChanges();
     return obj.Id;
 }
 public override void UpdateCategory(Category category)
 {
     var context = new MoneyBoxEntities();
     var obj = new tblMoneyBox_Categories {Id = category.Id};
     context.AttachTo("tblMoneyBox_Categories", obj);
     category.CopyToObject(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;
 }
 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();
 }