Exemplo n.º 1
0
        private void PreparePossibleCargoes()
        {
            listBoxCargoMarketCargoListForCompany.Items.Clear();

            ExtCompany t = ExternalCompanies.Find(x => x.CompanyName == comboBoxSourceCargoMarketCompany.SelectedValue.ToString());

            if (t != null)
            {
                List <string> oC = t.outCargo;

                if (oC != null)
                {
                    foreach (string cargo in oC)
                    {
                        if (comboBoxCMTrailerTypes.SelectedValue != null && ExtCargoList.Count > 0)
                        {
                            ExtCargo temp = ExtCargoList.Find(x => x.CargoName == cargo);
                            if (temp != null)
                            {
                                if (temp.BodyTypes.Contains(comboBoxCMTrailerTypes.SelectedValue.ToString()))
                                {
                                    listBoxCargoMarketCargoListForCompany.Items.Add(cargo);
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void Snapshot(Writer writer)
        {
            if (SnapshotIdentity == writer.SnapshotIdentity)
            {
                return;
            }
            SnapshotIdentity = writer.SnapshotIdentity;
            SnapshotObjectId = writer.GetNextObjectId();

            //Collections
            foreach (var company in ExternalCompanies)
            {
                company.Snapshot(writer);
            }

            //Referenced Snapshot Items

            //Snapshot Object
            writer.WriteClassStart("SnapshotTestingGround.ModelClasses.Model");
            writer.WriteProperty("SnapshotObjectId", SnapshotObjectId);
            writer.WriteArray("ExternalCompanies", ExternalCompanies.Select(e => e.SnapshotObjectId));
            writer.WriteClassEnd();
        }
Exemplo n.º 3
0
 public void Hydrate(Dictionary <string, string[]> values, Reader reader)
 {
     ExternalCompanies.AddRange(values["ExternalCompanies"].Select(i => reader.GetOrCreate <ExternalCompany>(i)));
 }