public bool AddContactPerson(ContactPerson CP) { var res = DBDataExtractor <ContactPerson> .AddItem(DBProvider.Client.CreateContactPerson, CP); if (res > 0) { CP.Id = res; ContactPerson.Add(CP); } return(res > 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); }