public List <TGoods> GetDishesHoz() { var dd = new List <TGoods>(); //foreach (var grN in res) { TGoodsList r = null; try { string merrMess; int merrCode = 0; // _logger.Debug($"GetGoods Id {grN} "); r = sh.GetGoods(40, out merrCode, out merrMess); } catch (Exception e) { // _logger.Error($"GetGoods Id {grN} Error "+e.Message); } if (r != null) { dd.AddRange(r.ListGoods); } } return(dd); }
public List <TGoods> GetDishesFromSH(bool togo) { string errMess; int errCode = 0; var gr = sh.GetGoodsTree(out errCode, out errMess).ListGoodsTree; List <int> PGroups; //List<int> PGroups = new List<int> { 77, 164, 2417 }; //List<int> PGroups = new List<int> { 77, 2417 }; if (togo) { PGroups = new List <int> { 164 }; } else { PGroups = new List <int> { 77, 2417 }; } List <int> res = new List <int>(); res.AddRange(PGroups); foreach (var id in PGroups) { var r = GetGroups(id, gr); if (r.Count > 0) { res.AddRange(r); } } //var grs = GetGroups(); var dd = new List <TGoods>(); foreach (var grN in res) { TGoodsList r = null; try { string merrMess; int merrCode = 0; // _logger.Debug($"GetGoods Id {grN} "); r = sh.GetGoods(grN, out merrCode, out merrMess); } catch (Exception e) { // _logger.Error($"GetGoods Id {grN} Error "+e.Message); } if (r != null) { dd.AddRange(r.ListGoods); } } return(dd); }