Exemplo n.º 1
0
        public static IEnumerable <Tuple <int, string, bool> > GetShopsByShopIds(int[] shopIds)
        {
            var result    = new List <Tuple <int, string, bool> >();
            var shopTable = DALPromotion.SelectShopNamesByIDs(shopIds);

            if (shopTable != null)
            {
                foreach (DataRow item in shopTable.Rows)
                {
                    result.Add(Tuple.Create(item.GetValue <int>("PKID"), item.GetValue <string>("CarparName"), item.GetValue <bool>("Exist")));
                }
            }
            shopIds?.ToList().ForEach(f =>
            {
                var shops = result.Where(w => w.Item1 == f).FirstOrDefault();
                if (shops == null)
                {
                    result.Add(Tuple.Create(f, "", false));
                }
            });
            return(result);
        }