private int DeleteTblCurrency(TblCurrency row) { using (var context = new WorkFlowManagerDBEntities()) { var oldRow = (from e in context.TblCurrencies where e.Iserial == row.Iserial select e).SingleOrDefault(); if (oldRow != null) { context.DeleteObject(oldRow); } context.SaveChanges(); } return(row.Iserial); }
private TblCurrency UpdateOrInsertTblCurrency(TblCurrency newRow, bool save, int index, out int outindex) { outindex = index; using (var context = new WorkFlowManagerDBEntities()) { if (save) { context.TblCurrencies.AddObject(newRow); } else { var oldRow = (from e in context.TblCurrencies where e.Iserial == newRow.Iserial select e).SingleOrDefault(); if (oldRow != null) { GenericUpdate(oldRow, newRow, context); } } context.SaveChanges(); return(newRow); } }
public TblCurrency GetCurrencyById(int id) { TblCurrency cur = _db.TblCurrencies.FirstOrDefault(x => x.Id == id); return(cur); }
public void DeleteCurrency(TblCurrency cur) { cur.Del = 0; _db.TblCurrencies.Update(cur); _db.SaveChanges(); }
public void UpdateCurrency(TblCurrency cur) { _db.TblCurrencies.Update(cur); _db.SaveChanges(); }
public void CreateCurrency(TblCurrency cur) { _db.TblCurrencies.Add(cur); _db.SaveChanges(); }