Beispiel #1
0
 public HoldSetupProxy(HoldSetup _hs)
 {
     Id             = _hs.Id;
     Name           = _hs.Name;
     HoldPlacements = new List <HoldSetupHoldPlacement>(_hs.HoldSetupHoldPlacements)
                      .ConvertAll(hshp => hshp.Id);
 }
Beispiel #2
0
        private bool LoadHoldSetup(HoldSetupProxy p)
        {
            HoldSetup hs             = Deproxy.GetHoldSetup(p);
            string    objTypeAndName = p.GetDataType().ToLower() + ": " + p.FriendlyString();

            if (moonServer.HoldSetups.Any(o => o.Id.Equals(hs.Id) || o.Name.Equals(hs.Name)))
            {
                if (ErrorOnDupCheckBox.Checked)
                {
                    throw new DuplicateException(objTypeAndName);
                }
                StatusTextBox.AppendText("Skipping duplicate " + objTypeAndName + "\n");
                return(false);
            }
            StatusTextBox.AppendText("Adding " + objTypeAndName + "\n");
            moonServer.HoldSetups.Add(hs);
            moonServer.SaveChanges();
            return(true);
        }