コード例 #1
0
        public void FillData()
        {
            VisitEasy store = new VisitEasy();

            store.FillTestData(10);
            Assert.AreEqual("0", store.Agencies[0].Portions[0].Trip.Location);
        }
コード例 #2
0
        // To create a new Agency.

        public EditAgency(VisitEasy store)
        {
            InitializeComponent();
            Agency    = new Agency();
            Store     = store;
            OldAgency = false;
        }
コード例 #3
0
 //To process needed items.
 public ShowAgency(Agency agency, Client client, VisitEasy store)
 {
     InitializeComponent();
     Agency = agency;
     Client = client;
     Store  = store;
     portionBindingSource.DataSource = Agency.Portions;
 }
コード例 #4
0
 //To process needed items.
 public ShowTrip(Portion portion, Client client, VisitEasy store)
 {
     InitializeComponent();
     Portion         = new Portion();
     Portion         = portion;
     Client          = client;
     Store           = store;
     HowMany.Maximum = Portion.Amount;
     HowMany.Minimum = 0;
     liiiikes.Text   = Convert.ToString(Portion.Trip.Counter);
 }
コード例 #5
0
        //To update an old agency.
        public EditAgency(Agency agency, VisitEasy store) : this(store)
        {
            OldAgency           = true;
            Store               = store;
            Agency              = agency;
            NameBox.Text        = agency.Name;
            DescriptionBox.Text = agency.Description;
            Agency         a    = agency;
            List <Portion> port = a.Portions;
            //if(port == null)
            //{
            //     port = new List<Portion> { new Portion(new Trip("Unknown", 0, "Unknown", "Unknown", "Unknown"), 0) };
            //}

            imageBox.Image = agency.Image;
        }
コード例 #6
0
ファイル: Dao.cs プロジェクト: sdermann/travel-agency-app
        //To load store VisitEasy.
        public void Load()
        {
            using (Stream stream = File.OpenRead(path + filePath))
            {
                var       serializer = new BinaryFormatter();
                VisitEasy st         = (VisitEasy)serializer.Deserialize(stream);

                Copy(st.Agencies, store.Agencies);
                Copy(st.Clients, store.Clients);
                Copy(st.Admins, store.Admins);
                Copy(st.Orders, store.Orders);
            }

            void Copy <T>(List <T> from, List <T> to)
            {
                to.Clear();
                to.AddRange(from);
            }
        }
コード例 #7
0
        public MainClientForm(VisitEasy store, Client client)
        {
            InitializeComponent();
            Store  = store;
            Client = client;
            Cost   = 0;
            List <string> states = new List <string>
            {
                "Cairo", "Bangkok", "New York", "Budapest", "London", "Paris",
                "Berlin", "Gdansk", "Talin", "Beijing", "Rio de Janeiro",
                "Affins", "Larnaca", "Sharm El Sheikh", "Vienna", "Amsterdam",
                "Odessa", "St. Petersburg", "Moscow", "Lviv", "Sydney"
            };


            // Add range og choise.
            LocationsForClient.Items.AddRange(states);



            foreach (Agency a in Store.Agencies)
            {
                foreach (Portion An in a.Portions)
                {
                    if (An.Amount > 0)
                    {
                        RightPortion.Add(An);
                    }
                }
            }
            foreach (Agency a in Store.Agencies)
            {
                if (a.Portions.Count > 0)
                {
                    GoodAgency.Add(a);
                }
            }
            ResetAgencies();
            ResetOrder();
            ResetTrips();
        }
コード例 #8
0
        public MainForm(ref VisitEasy easy)
        {
            InitializeComponent();
            store = easy;


            //store.FillTestData(5);

            List <Portion> port = new List <Portion>();

            foreach (Agency agency in store.Agencies)
            {
                foreach (Portion p in agency.Portions)
                {
                    if (p.OnSaleOrInFuture == "FutureTrip")
                    {
                        port.Add(p);
                    }
                }
            }
            List <Portion> portHot = new List <Portion>();

            foreach (Agency agency in store.Agencies)
            {
                foreach (Portion p in agency.Portions)
                {
                    if (p.OnSaleOrInFuture == "OnSale")
                    {
                        portHot.Add(p);
                    }
                }
            }


            portionBindingSource1.DataSource = port;
            portionBindingSource2.DataSource = portHot;
            portionBindingSource1.ResetBindings(false);
            portionBindingSource2.ResetBindings(false);
        }
コード例 #9
0
ファイル: Sign_up.cs プロジェクト: sdermann/travel-agency-app
 //To process our VisitEasy store.
 public Sign_up(VisitEasy store)
 {
     InitializeComponent();
     this.store = store;
 }
コード例 #10
0
 //Creat our store.
 public LetClientIn()
 {
     InitializeComponent();
     store = new VisitEasy();
 }
コード例 #11
0
ファイル: Dao.cs プロジェクト: sdermann/travel-agency-app
 public Dao(VisitEasy store)
 {
     this.store = store;
 }
コード例 #12
0
 public Sign_Up_Form(ref VisitEasy store)
 {
     this.store = store;
     InitializeComponent();
 }
コード例 #13
0
 public LetAdminIn()
 {
     InitializeComponent();
     store = new VisitEasy();
 }