Exemplo n.º 1
0
    private List<ItemOrder> ReCheckItems(List<ItemOrder> _items)
    {
        List<Item> sellList = new ItemDataSource().GetListItem();
        List<ItemOrder> old = new List<ItemOrder>();

        for (int i = 0; i < _items.Count; ) //(ItemOrder item in _items)
        {
            if (!string.IsNullOrEmpty(_items[i].Item.Id) && !ItemInList(_items[i].Item, sellList))
            {
                _items[i].NotOnSale = true;
                old.Add(_items[i]);
                _items.RemoveAt(i);
            }
            else i++;
            //_items[i].NotOnSale = !string.IsNullOrEmpty(_items[i].Item.Id) && !ItemInList(_items[i].Item, sellList);
            //i++;
        }

        _items.InsertRange(0, old);
        return old;
    }
Exemplo n.º 2
0
 protected string EvalItemId(object o)
 {
     string res = string.Empty;
     try
     {
         if (ItemDataSource.IsExistItem(o.ToString()))
             res = o.ToString();
         else
             res = new ItemDataSource().GetOneItem().Id;
     }
     catch { }
     return res;
 }