static void Main()
        {
            ShippingSystem sm;
            Stream TestFileStream;

            if (File.Exists(FileName))
            {
                TestFileStream = File.OpenRead(FileName);
                BinaryFormatter deserializer = new BinaryFormatter();
                sm = (ShippingSystem)deserializer.Deserialize(TestFileStream);
                TestFileStream.Close();
                Console.WriteLine("Loaded hey string: "+sm.hey);
            }
            else
            {
                TestFileStream = File.Create(FileName);
                sm = new ShippingSystem();
                sm.hey = "Hello world?";
                Console.WriteLine("wrote to sm");
            }

            TestFileStream = File.OpenWrite(FileName);
            BinaryFormatter serializer = new BinaryFormatter();
            serializer.Serialize(TestFileStream, sm);
            TestFileStream.Close();

            Console.Read();
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new LoginForm());
        }
 public AddPackageForm(Form parent, ShippingSystem sm)
 {
     InitializeComponent();
     parentForm = parent;
     shippingSystem = sm;
     serviceTypeComboBox.SelectedIndex = 0;
     weightClassComboBox.SelectedIndex = 0;
 }
 public DeliveryForm(Form parent, ShippingSystem sm, Package p)
 {
     InitializeComponent();
     parentForm = parent as DeliverPackageForm;
     shippingSystem = sm;
     package = p;
     recepientNameTextBox.Text = p.Destination.Addressee;
     streetAddressTextBox.Text = p.Destination.StreetAddress;
 }
 public AdminForm(Form parent, ShippingSystem sm)
 {
     InitializeComponent();
     shippingSystem = sm;
     parentForm = parent;
     employeeTypeComboBox.SelectedIndex = 0;
     locationTypeComboBox.SelectedIndex = 0;
     employeesListBox.Items.AddRange(sm.Employees);
     locationsListBox.Items.AddRange(sm.Locations);
     moveablesListBox.Items.AddRange(sm.Moveables);
     routesListBox.Items.AddRange(sm.Routes);
     //routeLocationOneListBox.Items.AddRange(sm.Locations);
     //routeLocationTwoListBox.Items.AddRange(sm.Locations);
     //routeUsingListBox.Items.AddRange(sm.RoutelessMoveable);
 }
        public WarehouseForm(Form parent, ShippingSystem sm)
        {
            InitializeComponent();
            parentForm = parent;
            shippingSystem = sm;
            em = shippingSystem.LoggedInEmployee as WarehouseEmployee;
            currentWarehouse = em.CurrentLocation as Warehouse;
            currentStoreFront = em.CurrentLocation as StoreFront;

            updateReceivingListBox();
            updateVehiclesListBox();

            if (currentStoreFront != null)
                Text = currentStoreFront.Id;
            else
                Text = currentWarehouse.Id;
        }
 public ChangePasswordForm(Form parent, ShippingSystem sm)
 {
     InitializeComponent();
     parentForm = parent;
     shippingSystem = sm;
 }
Exemple #7
0
 public LoginForm(ShippingSystem ss)
 {
     shippingSystem = ss;
     InitializeComponent();
 }
Exemple #8
0
 public GuestForm(Form parent, ShippingSystem sm)
 {
     InitializeComponent();
     parentForm = parent;
     shippingSystem = sm;
 }