Beispiel #1
0
        public void Update(BoxesModel box)
        {
            BoxId          = box.BoxId;
            SubscriptionId = box.SubscriptionId;
            PawzeUserId    = box.PawzeUserId;

            if (BoxId == 0)
            {
                // IF IT'S NEW
                foreach (var boxItem in box.BoxItems)
                {
                    var dbBoxItem = new BoxItem();
                    dbBoxItem.Update(boxItem);
                    BoxItems.Add(dbBoxItem);
                }
            }
            else
            {
                // if it exists
                foreach (var modelBoxItem in box.BoxItems)
                {
                    var databaseBoxItem = BoxItems.FirstOrDefault(bi => bi.BoxItemId == modelBoxItem.BoxItemId);

                    databaseBoxItem.Update(modelBoxItem);
                }
            }
        }
 void IDropTarget.Drop(IDropInfo dropInfo)
 {
     if (dropInfo.Data is TECTypical typ)
     {
         BoxItems.Add(new TECSystem(typ as TECSystem));
     }
     else
     {
         DragDropHelpers.StandardDrop(dropInfo, manager);
     }
 }
 public override void BuildDoorHandle()
 {
     box.Add(new DoorHandle());
 }