Esempio n. 1
0
        public void FillData()
        {
            VisitEasy store = new VisitEasy();

            store.FillTestData(10);
            Assert.AreEqual("0", store.Agencies[0].Portions[0].Trip.Location);
        }
Esempio n. 2
0
        // To create a new Agency.

        public EditAgency(VisitEasy store)
        {
            InitializeComponent();
            Agency    = new Agency();
            Store     = store;
            OldAgency = false;
        }
Esempio n. 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;
 }
Esempio n. 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);
 }
Esempio n. 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;
        }
Esempio n. 6
0
        //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);
            }
        }
        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();
        }
Esempio n. 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);
        }
Esempio n. 9
0
 //To process our VisitEasy store.
 public Sign_up(VisitEasy store)
 {
     InitializeComponent();
     this.store = store;
 }
Esempio n. 10
0
 //Creat our store.
 public LetClientIn()
 {
     InitializeComponent();
     store = new VisitEasy();
 }
Esempio n. 11
0
 public Dao(VisitEasy store)
 {
     this.store = store;
 }
Esempio n. 12
0
 public Sign_Up_Form(ref VisitEasy store)
 {
     this.store = store;
     InitializeComponent();
 }
Esempio n. 13
0
 public LetAdminIn()
 {
     InitializeComponent();
     store = new VisitEasy();
 }