Beispiel #1
0
        public void AddNewPhase()
        {
            int ix    = Phases.Count + 1;
            var phase = new Phase
            {
                Index = ix,
                JobId = Phases.First().JobId,
            };

            if (phase != null)
            {
                BuildingSystem bs = new BuildingSystem
                {
                    FullName           = "TBD",
                    ActualBoardFeet    = 0,
                    Code               = "TBD",
                    EstimatedBoardFeet = 0
                };
                phase.BuildingSystems = new List <BuildingSystem>()
                {
                    bs
                };
            }
            var lister = new List <Phase>();

            Phases.ForEach(p => lister.Add(p));
            lister.Add(phase);
            Phases.Clear();
            Phases = new ObservableCollection <Phase>(lister);
            OnPropertyChanged(nameof(Phases));
        }
Beispiel #2
0
 public void ClearPhases()
 {
     Flags &= PhaseShiftFlags.AlwaysVisible | PhaseShiftFlags.Inverse;
     Phases.Clear();
     NonCosmeticReferences = 0;
     CosmeticReferences    = 0;
     DefaultReferences     = 0;
     UpdateUnphasedFlag();
 }
Beispiel #3
0
 private void AddOrderToSettings(Comenzi order)
 {
     if (order == null)
     {
         Phases.Clear();
         return;
     }
     _settingsService.CommessaFromBarcode = order.NrComanda;
     _settingsService.CommessaIdSettings  = order.Id.ToString();
 }
        public void Open(string schemafile)
        {
            Phases.Clear();
            FileStream fs = null;

            try
            {
                SchemaSrc = new FileInfo(schemafile);
                string tmppath = Path.Combine(_workdir, SchemaSrc.Name);
                SchemaSrc.CopyTo(tmppath, true);

                SchemaTmp = new FileInfo(tmppath);
                if (!SchemaTmp.Exists)
                {
                    throw new FileNotFoundException(SchemaTmp.FullName);
                }

                fs          = SchemaTmp.Open(FileMode.Open, FileAccess.Read, FileShare.Read);
                fs.Position = 0;

                XDocument xdoc = XDocument.Load(fs, LoadOptions.None);

                foreach (XElement e1 in xdoc.Descendants().Where(p => p.Name.LocalName == "phase"))
                {
                    XAttribute id = e1.Attribute("id");

                    Phase phase = new Phase();
                    phase.Id = id?.Value ?? "";

                    foreach (XElement e2 in e1.Descendants().Where(p => p.Name.LocalName == "active"))
                    {
                        XAttribute pattern = e2.Attribute("pattern");
                        if (pattern != null)
                        {
                            phase.Patterns.Add(pattern.Value);
                        }
                    }
                    if (phase.IsEnabled)
                    {
                        Phases.Add(phase);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                fs?.Dispose();
            }
        }
Beispiel #5
0
        public void AddNewBuildingSystem(string phaseName)
        {
            var phase = Phases.SingleOrDefault(p => p.PhaseName == phaseName);

            if (phase != null)
            {
                BuildingSystem bs = new BuildingSystem
                {
                    FullName           = "TBD",
                    ActualBoardFeet    = 0,
                    Code               = "TBD",
                    EstimatedBoardFeet = 0
                };
                phase.BuildingSystems.Add(bs);
            }
            var lister = new List <Phase>();

            Phases.ForEach(p => lister.Add(p));
            Phases.Clear();
            Phases = new ObservableCollection <Phase>(lister);
            OnPropertyChanged(nameof(Phases));
        }
 public void Close()
 {
     Phases.Clear();
     SchemaSrc = null;
     SchemaTmp = null;
 }