public List <AssetPurchaseEntry> GetBySearchItem(AssetPurchaseEntry obj) { var dbobj = db.AssetPurchaseEntries.AsQueryable(); if (!string.IsNullOrEmpty(obj.PurchaseDate)) { dbobj = dbobj.Where( c => c.IsDeleted == false && (c.PurchaseDate.ToLower().Contains(obj.PurchaseDate.ToLower()))); } else { dbobj = dbobj.Where(c => c.IsDeleted == false); return(dbobj.OrderBy(o => o.PurchaseDate).ToList()); } return(dbobj.OrderBy(o => o.PurchaseDate).ToList()); }
public int Update(AssetPurchaseEntry obj) { db.AssetPurchaseEntries.Attach(obj); db.Entry(obj).State = EntityState.Modified; return(db.SaveChanges()); }
public int Save(AssetPurchaseEntry obj) { db.AssetPurchaseEntries.Add(obj); int rowAffected = db.SaveChanges(); return(rowAffected); }
public bool Update(AssetPurchaseEntry obj) { int rowAffected = _Repository.Update(obj); bool isUpdated = rowAffected > 0; return(isUpdated); }
public bool Save(AssetPurchaseEntry obj) { // save code ... int rowAffected = _Repository.Save(obj); bool isSaved = rowAffected > 0; return(isSaved); }
public int Delete(int?id) { int?ID = id; AssetPurchaseEntry obj = db.AssetPurchaseEntries.Where(c => c.Id == ID).First(); obj.IsDeleted = true; int rowAffected = db.SaveChanges(); return(rowAffected); }
public List <AssetPurchaseEntry> GetBySearchItem(AssetPurchaseEntry obj) { var var = _Repository.GetBySearchItem(obj); return(var); }