public BizMaterialCategory[] MaterialCategoryGetAll() { var _result = new List <BizMaterialCategory>(); lock (GParams.Instance.ComLockObj) { try { var _rows = GParams.Instance.MaterialCategoryTable.Select(string.Empty, "Designation ASC"); if (_rows.Length > 0) { foreach (var _row in _rows) { _result.Add(BizMaterialCategory.ConvertFromDataRow(_row)); } } } catch { _result.Clear(); } } return(_result.Count > 0 ? _result.ToArray() : null); }
public BizMaterialCategory MaterialCategoryGet(Guid id) { lock (GParams.Instance.ComLockObj) { try { var _row = GParams.Instance.MaterialCategoryTable.FetchById(id); if (_row != null) { return(BizMaterialCategory.ConvertFromDataRow(_row)); } } catch { // ignored } } return(null); }