public void FillData() { VisitEasy store = new VisitEasy(); store.FillTestData(10); Assert.AreEqual("0", store.Agencies[0].Portions[0].Trip.Location); }
// To create a new Agency. public EditAgency(VisitEasy store) { InitializeComponent(); Agency = new Agency(); Store = store; OldAgency = false; }
//To process needed items. public ShowAgency(Agency agency, Client client, VisitEasy store) { InitializeComponent(); Agency = agency; Client = client; Store = store; portionBindingSource.DataSource = Agency.Portions; }
//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); }
//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; }
//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(); }
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); }
//To process our VisitEasy store. public Sign_up(VisitEasy store) { InitializeComponent(); this.store = store; }
//Creat our store. public LetClientIn() { InitializeComponent(); store = new VisitEasy(); }
public Dao(VisitEasy store) { this.store = store; }
public Sign_Up_Form(ref VisitEasy store) { this.store = store; InitializeComponent(); }
public LetAdminIn() { InitializeComponent(); store = new VisitEasy(); }