コード例 #1
0
 //Create New a Agency
 public EditAgency(VietTravel VietTravel)
 {
     InitializeComponent();
     agency     = new Agency();
     vietTravel = VietTravel;
     Odd        = false;
 }
コード例 #2
0
 public ShowAgency(Agency agency, Client client, VietTravel vietTravel)
 {
     InitializeComponent();
     GetAgency     = agency;
     GetClient     = client;
     GetVietTravel = vietTravel;
 }
コード例 #3
0
 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);
 }
コード例 #4
0
        // 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);
            }
        }
コード例 #6
0
        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();
 }
コード例 #12
0
 public SignUp_Form(ref VietTravel store)
 {
     this.GetVietTravel = store;
     InitializeComponent();
 }
コード例 #13
0
 public Dao(VietTravel store)
 {
     this.store = store;
 }