//Create New a Agency
 public EditAgency(VietTravel VietTravel)
 {
     InitializeComponent();
     agency     = new Agency();
     vietTravel = VietTravel;
     Odd        = false;
 }
 public ShowAgency(Agency agency, Client client, VietTravel vietTravel)
 {
     InitializeComponent();
     GetAgency     = agency;
     GetClient     = client;
     GetVietTravel = vietTravel;
 }
 public ShowTrip(Portion portion, Client client, VietTravel vietTravel)
 {
     InitializeComponent();
     GetPortion      = portion;
     GetVietTravel   = vietTravel;
     GetClient       = client;
     GetPortion      = new Portion();
     SoLuong.Maximum = GetPortion.Amount;
     SoLuong.Minimum = 0;
     DanhGia.Text    = Convert.ToString(GetPortion.Trip.Counter);
 }
        // Update old Version
        public EditAgency(Agency Agency, VietTravel VietTravel) : this(VietTravel)
        {
            Odd                 = true;
            vietTravel          = VietTravel;
            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("Unknow", 0, "Unknow", "Unknow", "Unknow"), 0)
                };
            }

            pictureBox1.Image = Agency.Image;
        }
예제 #5
0
        public void Load()
        {
            void Copy <T>(List <T> from, List <T> to)
            {
                to.Clear();
                to.AddRange(from);
            }

            using (Stream stream = File.OpenRead(path + filepath))
            {
                var        serializer = new BinaryFormatter();
                VietTravel st         = (VietTravel)serializer.Deserialize(stream);

                Copy(st.Agencies, store.Agencies);
                Copy(st.Clients, store.Clients);
                Copy(st.Admins, store.Admins);
                Copy(st.Orders, store.Orders);
            }
        }
        public MainClient(VietTravel vietTravel, Client client)
        {
            GetVietTravel = vietTravel;
            GetClient     = client;
            cost          = 0;
            List <string> vung = 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", "Kyoto", "Seol",
                "Vernice", "Coron", "Mauritius", "Mandalay", "Isetwald", "Sigriswil Urban",
                "Grindelwald", "Obwalden", "Zurich", "Jeju Island", "Zanzibar", "Labadee",
                "Mozambique", "Cusco", "Oku Mountain", "Kilimanjaro", "Fatucama Peninsula",
                "Inhambane", "Misti Volcano", "Bazaruto Island", "Titicaca Lake", "Serengeti",
                "Petrovaradin", "Maputo Church", "Kalemegdan", "Skadarlija", "Maria Cathedral"
            };

            InitializeComponent();
            LocationsForClient.Items.Add(vung);

            foreach (Agency a in GetVietTravel.Agencies)
            {
                foreach (Portion p in a.Portions)
                {
                    if (p.Amount > 0)
                    {
                        GetPortions.Add(p);
                    }
                }
            }
            foreach (Agency a in GetVietTravel.Agencies)
            {
                if (a.Portions.Count > 0)
                {
                    GetAgencies.Add(a);
                }
            }
            KhoiPhucDaiLy();
            KhoiPhucHangDat();
            KhoiPhucTrip();
        }
예제 #7
0
        public MainForm(ref VietTravel GetHard)
        {
            InitializeComponent();
            GetVietTravel = GetHard;


            //GetVietTravel.FillTestData(5);

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

            foreach (Agency agency in GetVietTravel.Agencies)
            {
                foreach (Portion p in agency.Portions)
                {
                    if (p.OnSale == "Future Trip")
                    {
                        Port.Add(p);
                    }
                }
            }

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

            foreach (Agency agency in GetVietTravel.Agencies)
            {
                foreach (Portion p in agency.Portions)
                {
                    if (p.OnSale == "On Sale")
                    {
                        portions.Add(p);
                    }
                }
            }

            portionBindingSource1.DataSource = Port;
            portionBindingSource2.DataSource = portions;
            portionBindingSource1.ResetBindings(false);
            portionBindingSource2.ResetBindings(false);
        }
예제 #8
0
 public Dao(VietTravel store)
 {
     this.GetVietTravel = store;
 }
예제 #9
0
 public SignIn()
 {
     InitializeComponent();
     GetVietTravel = new VietTravel();
 }
예제 #10
0
 public SignUp(VietTravel vietTravel)
 {
     InitializeComponent();
     this.GetVietTravel = vietTravel;
 }
예제 #11
0
 public ByAdmin()
 {
     InitializeComponent();
     GetVietTravel = new VietTravel();
 }
 public SignUp_Form(ref VietTravel store)
 {
     this.GetVietTravel = store;
     InitializeComponent();
 }
예제 #13
0
 public Dao(VietTravel store)
 {
     this.store = store;
 }