private bool CheckDataTransactionLog(int id) { try { using (var context = new RubberSoftEntities()) { var query = context.spt_GetTransactionLog().Where(o => o.PriceId == id).ToList(); if (query.Count > 0) { return(true); } else { return(false); } } } catch (Exception ex) { XtraMessageBox.Show(ex.Message); return(false); } }