public bool Add(tblBin obj) { try { repository.tblBins.Add(obj); repository.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool Delete(int id) { try { tblBin result = Get(id); if (result != null) { result.Deleted = true; repository.SaveChanges(); return(true); } return(false); } catch (Exception) { return(false); } }
public bool Update(tblBin obj) { try { tblBin result = Get(obj.BinId); if (result != null) { repository.Entry(result).CurrentValues.SetValues(obj); repository.SaveChanges(); return(true); } return(false); } catch (Exception) { return(false); } }