Пример #1
0
        public bool AddLabelInfo(long ParenDishId)
        {
            ItemLabelInfo l = new ItemLabelInfo()
            {
                ParenItemId = ParenDishId, SerialNumber = ItemLabelsInfo.Where(a => a.ParenItemId == ParenDishId).Count() + 1
            };
            var res = DBDataExtractor <ItemLabelInfo> .AddItem(DBProvider.Client.CreateItemLabelInfo, l);

            if (res > 0)
            {
                l.Id = res;
                ItemLabelsInfo.Add(l);
                Dishes.SingleOrDefault(a => a.Id == ParenDishId).LabelsCount++;
                return(true);
            }
            return(false);
        }