Exemplo n.º 1
0
        private void ModifyBicycleButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            UpdateForm uf = new UpdateForm(this, "modifyBicycle");

            uf.Show();
        }
        public WorkerDataInputForm(UpdateForm uf, string s, MainMenu m)
        {
            InitializeComponent();
            myCaller = uf;
            mainMenu = m;
            WorkerPasswordBox.PasswordChar = '*';

            Object[] status = new Object[2];
            status[0] = "Active";
            status[1] = "Inactive";
            StatusComboBox.Items.AddRange(status);

            Object[] credential = new Object[2];
            credential[0] = "Administrator";
            credential[1] = "Ordinary";
            CredentialComboBox.Items.AddRange(credential);

            Worker existingWorker = new Worker();

            existingWorker.populateBannerID(s);
            WorkerDataLabel.Text             = "Modify Worker Data";
            BannerIDBox.Text                 = existingWorker.BannerID;
            FirstNameBox.Text                = existingWorker.FirstName;
            LastNameBox.Text                 = existingWorker.LastName;
            PhoneNumberBox.Text              = existingWorker.PhoneNumber;
            EmailBox.Text                    = existingWorker.EmailAddress;
            CredentialComboBox.SelectedIndex = CredentialComboBox.FindStringExact(existingWorker.Credential);
            WorkerPasswordBox.Text           = existingWorker.WorkerPassword;
            NotesBox.Text                    = existingWorker.Notes;
            StatusComboBox.SelectedIndex     = StatusComboBox.FindStringExact(existingWorker.Status);

            FormAction = "update";
            id         = s;
        }
Exemplo n.º 3
0
        public UserDataInputForm(UpdateForm uf, string s, MainMenu m)
        {
            InitializeComponent();
            myCaller      = uf;
            this.mainMenu = m;
            User existingUser = new User();

            Object[] userType = new Object[2];
            userType[0] = "Faculty/Staff";
            userType[1] = "Student";
            UserTypeComboBox.Items.AddRange(userType);

            Object[] status = new Object[2];
            status[0] = "Active";
            status[1] = "Inactive";
            StatusComboBox.Items.AddRange(status);



            existingUser.populateWithBannerID(s);
            UserDataLabel.Text             = "Modify User Data";
            BannerIDBox.Text               = existingUser.BannerID;
            FirstNameBox.Text              = existingUser.FirstName;
            LastNameBox.Text               = existingUser.LastName;
            PhoneNumberBox.Text            = existingUser.PhoneNumber;
            EmailBox.Text                  = existingUser.EmailAddress;
            UserTypeComboBox.SelectedIndex = UserTypeComboBox.FindStringExact(existingUser.UserType);
            NotesBox.Text                  = existingUser.Notes;
            StatusComboBox.SelectedIndex   = StatusComboBox.FindStringExact(existingUser.Status);


            FormAction = "update";
            bannerID   = s;
        }
        public BicycleDataInputForm(UpdateForm uf, int i, MainMenu mm)
        {
            InitializeComponent();

            myCaller = uf;
            mainMenu = mm;

            BicycleDataInputFormTitle.Text = "Modify Bicycle data";

            Object[] location = new Object[7];
            location[0] = "Benedict Hall";
            location[1] = "Harmon Hall";
            location[2] = "McFarlane Hall";
            location[3] = "Mortimer Hall";
            location[4] = "Student Union";
            location[5] = "Thompson Hall";
            location[6] = "Welcome Center";
            LocationComboBox.Items.AddRange(location);

            Object[] physical = new Object[2];
            physical[0] = "Good";
            physical[1] = "Damaged";
            PhysicalConditionComboBox.Items.AddRange(physical);

            Object[] status = new Object[2];
            status[0] = "Available";
            status[1] = "Unavailable";
            StatusComboBox.Items.AddRange(status);



            Vehicle existingVehicle = new Vehicle();

            existingVehicle.populate(i);
            BikeMakeBox.Text                        = existingVehicle.BikeMake;
            ModelNumberBox.Text                     = existingVehicle.ModelNumber;
            SerialNumberBox.Text                    = existingVehicle.SerialNumber;
            ColorBox.Text                           = existingVehicle.Color;
            DescriptionBox.Text                     = existingVehicle.Description;
            LocationComboBox.SelectedIndex          = LocationComboBox.FindStringExact(existingVehicle.Location);
            PhysicalConditionComboBox.SelectedIndex = PhysicalConditionComboBox.FindStringExact(existingVehicle.PhysicalCondition);
            NotesBox.Text                           = existingVehicle.Notes;
            StatusComboBox.SelectedIndex            = StatusComboBox.FindStringExact(existingVehicle.Status);

            FormAction = "update";
            id         = i;
        }