public SelectUserToView(string sessionUserMainMenu) { passedUsername = sessionUserMainMenu; sessionUserSelectUserToView = sessionUserMainMenu; InitializeComponent(); List <UserEmployee> ListOfEmployees = new List <UserEmployee>(); ListOfEmployees = UserEmployeeCollection.ReturnAList(); var tempList = from employee in ListOfEmployees where employee.Active == 1 select new { Name = employee.FirstName + " " + employee.LastName, Position = employee.UserPositionID, Username = employee.Username, StartDate = employee.StartDate, Email = employee.Email, CreatedBy = employee.UserCreatedBy, CreatedOn = employee.UserCreatedOn, UpdatedBy = employee.UserLastUpdatedBy, UpdatedOn = employee.UserLastUpdatedOn }; this.EmployeeListSelect.ItemsSource = tempList; }
private void Application_Startup(object sender, StartupEventArgs e) { Window1 wnd = new Window1(); DateTime value = new DateTime(2016, 11, 1, 5, 20, 00); //call for loading in users from database goes here. //below is a temporary test case object UserEmployeeCollection.addUser(1, "Derek", "Thomas", "Blankinship", 1, 1, "admin", "password", value, 'M', "574-123-1234", "574-234-2345", "N/A", "574-345-3456", "N/A", "*****@*****.**", value, value, value, "admin", value, "admin", "no notes", 1); UserEmployeeAddressCollection.addUserAddress("admin", "exampleStreet1", "exampleCity1", "exampleState1", 12345, value, "admin", value, "admin", "no notes", 1); UserEmployeeAddressCollection.addUserAddress("admin", "exampleStreet2", "exampleCity2", "exampleState2", 23456, value, "admin", value, "admin", "no notes", 1); UserEmployeeEmergencyCollection.addUserEmergencyContact("admin", "Tara", "Blankinship", "574-567-8901", "wife", value, "admin", value, "admin", "no notes", 1); UserEmployeeCollection.addUser(1, "Hunter", "A", "Johnson", 1, 1, "user", "12345", value, 'M', "574-123-1234", "574-234-2345", "N/A", "574-345-3456", "N/A", "*****@*****.**", value, value, value, "admin", value, "admin", "no notes", 1); wnd.Show(); }
private void Next_Click(object sender, RoutedEventArgs e) { int selectedProfileType = 0; string first, middle, last, dateBirth, dateStart; char selectedGender = 'N'; string cellNumber1, cellNumber2, workNumber, fax; string userEmail, storedPassword; string homePhoneNumber, notes; first = FirstName.Text; middle = MiddleName.Text; last = LastName.Text; dateBirth = DateOfBirth.Text; dateStart = StartDate.Text; homePhoneNumber = HomePhone.Text; cellNumber1 = CellPhone1.Text; cellNumber2 = CellPhone2.Text; workNumber = WorkPhone.Text; fax = FaxNumber.Text; userEmail = Email.Text; storedPassword = UserEmployeeCollection.GetPassword(passedUsername); notes = NotesTextBox.Text; if (ProfileType.Text == "Owner") { selectedProfileType = 1; } if (Gender.Text == "Male") { selectedGender = 'M'; } else if (Gender.Text == "Female") { selectedGender = 'F'; } else if (Gender.Text == "Attack Helicopter") { selectedGender = 'A'; } DateTime dateRightNow = DateTime.Now; DateTime fakeQuitDate = new DateTime(2100, 1, 1); DateTime BirthDate = DateTime.Parse(dateBirth); DateTime DateofStart = DateTime.Parse(dateStart); //adds on to the back //so access with UserCollection.last(); UserEmployeeCollection.ModifyUser(1, first, middle, last, selectedProfileType, 1, passedUsername, storedPassword, BirthDate, selectedGender, homePhoneNumber, cellNumber1, cellNumber2, workNumber, fax, userEmail, DateofStart, fakeQuitDate, UserEmployeeCollection.GetCreatedByDate(passedUsername), UserEmployeeCollection.GetCreatedBy(passedUsername), dateRightNow, sessionUserModifyEmployee, notes, 1, passedUsername); EmployeeShow main = new EmployeeShow(sessionUserModifyEmployee, passedUsername); App.Current.MainWindow = main; this.Close(); main.Show(); }
public UserChangeToInactive(string sessionUser, string storedUsername) { InitializeComponent(); passedUsername = storedUsername; sessionUserEmployeeDelete = sessionUser; UserName.Content = passedUsername; int holderVariable = UserEmployeeCollection.GetProfileType(passedUsername); if (holderVariable == 1) { ProfileType.Content = "Owner"; } FirstName.Content = UserEmployeeCollection.GetFirstName(passedUsername); MiddleName.Content = UserEmployeeCollection.GetMiddleName(passedUsername); LastName.Content = UserEmployeeCollection.GetLastName(passedUsername); DateOfBirth.Content = UserEmployeeCollection.GetDateOfBirth(passedUsername); Gender.Content = UserEmployeeCollection.GetGender(passedUsername); StartDate.Content = UserEmployeeCollection.GetStartDate(passedUsername); CellPhone1.Content = UserEmployeeCollection.GetMobilePhone1(passedUsername); CellPhone2.Content = UserEmployeeCollection.GetMobilePhone2(passedUsername); WorkPhone.Content = UserEmployeeCollection.GetWorkPhone(passedUsername); FaxPhone.Content = UserEmployeeCollection.GetFaxNumber(passedUsername); HomePhone.Content = UserEmployeeCollection.GetHomePhone(passedUsername); Email.Content = UserEmployeeCollection.GetEmail(passedUsername); }
private void Deactivate_Click(object sender, RoutedEventArgs e) { UserEmployeeCollection.DeactivateUser(passedUsername); MainMenu main = new MainMenu(sessionUserEmployeeDelete); App.Current.MainWindow = main; this.Close(); main.Show(); }
private void Next_Click(object sender, RoutedEventArgs e) { UserEmployeeCollection.ModifyPosition(passedUsername, ID); MainMenu main = new MainMenu(sessionUserProfileSubmit); App.Current.MainWindow = main; this.Close(); main.Show(); }
public EmployeeShow(string sessionUser, string storedUsername) { InitializeComponent(); passedUsername = storedUsername; sessionUserEmployeeShow = sessionUser; //set Employee Fields UserName.Content = passedUsername; int holderVariable = UserEmployeeCollection.GetProfileType(passedUsername); if (holderVariable == 1) { ProfileType.Content = "Owner"; } FirstName.Content = UserEmployeeCollection.GetFirstName(passedUsername); MiddleName.Content = UserEmployeeCollection.GetMiddleName(passedUsername); LastName.Content = UserEmployeeCollection.GetLastName(passedUsername); DateOfBirth.Content = UserEmployeeCollection.GetDateOfBirth(passedUsername); Gender.Content = UserEmployeeCollection.GetGender(passedUsername); StartDate.Content = UserEmployeeCollection.GetStartDate(passedUsername); CellPhone1.Content = UserEmployeeCollection.GetMobilePhone1(passedUsername); CellPhone2.Content = UserEmployeeCollection.GetMobilePhone2(passedUsername); WorkPhone.Content = UserEmployeeCollection.GetWorkPhone(passedUsername); FaxPhone.Content = UserEmployeeCollection.GetFaxNumber(passedUsername); HomePhone.Content = UserEmployeeCollection.GetHomePhone(passedUsername); Email.Content = UserEmployeeCollection.GetEmail(passedUsername); //set Address Fields Street1.Content = UserEmployeeAddressCollection.GetStreet1(passedUsername); City1.Content = UserEmployeeAddressCollection.GetCity1(passedUsername); State1.Content = UserEmployeeAddressCollection.GetState1(passedUsername); ZipCode1.Content = UserEmployeeAddressCollection.GetZipCode1(passedUsername); Street2.Content = UserEmployeeAddressCollection2.GetStreet2(passedUsername); City2.Content = UserEmployeeAddressCollection2.GetCity2(passedUsername); State2.Content = UserEmployeeAddressCollection2.GetState2(passedUsername); ZipCode2.Content = UserEmployeeAddressCollection2.GetZipCode2(passedUsername); //set Emergency Contact Fields eFirstName1.Content = UserEmployeeEmergencyCollection.GetFirstName1(passedUsername); eLastName1.Content = UserEmployeeEmergencyCollection.GetLastName1(passedUsername); ePhoneNumber1.Content = UserEmployeeEmergencyCollection.GetPhone1(passedUsername); eRelation1.Content = UserEmployeeEmergencyCollection.GetRelation1(passedUsername); eFirstName2.Content = UserEmployeeEmergencyCollection2.GetFirstName2(passedUsername); eLastName2.Content = UserEmployeeEmergencyCollection2.GetLastName2(passedUsername); ePhoneNumber2.Content = UserEmployeeEmergencyCollection2.GetPhone2(passedUsername); eRelation2.Content = UserEmployeeEmergencyCollection2.GetRelation2(passedUsername); }
public EmployeeModify(string sessionUser, string storedUsername) { passedUsername = storedUsername; sessionUserModifyEmployee = sessionUser; InitializeComponent(); int holderVariable = UserEmployeeCollection.GetProfileType(passedUsername); if (holderVariable == 1) { ProfileType.Text = "Owner"; } FirstName.Text = UserEmployeeCollection.GetFirstName(passedUsername); MiddleName.Text = UserEmployeeCollection.GetMiddleName(passedUsername); LastName.Text = UserEmployeeCollection.GetLastName(passedUsername); DateOfBirth.Text = UserEmployeeCollection.GetDateOfBirth(passedUsername).ToShortDateString(); StartDate.Text = UserEmployeeCollection.GetStartDate(passedUsername).ToShortDateString(); CellPhone1.Text = UserEmployeeCollection.GetMobilePhone1(passedUsername); CellPhone2.Text = UserEmployeeCollection.GetMobilePhone2(passedUsername); WorkPhone.Text = UserEmployeeCollection.GetWorkPhone(passedUsername); FaxNumber.Text = UserEmployeeCollection.GetFaxNumber(passedUsername); HomePhone.Text = UserEmployeeCollection.GetHomePhone(passedUsername); Email.Text = UserEmployeeCollection.GetEmail(passedUsername); NotesTextBox.Text = UserEmployeeCollection.GetNotes(passedUsername); char tempGender = UserEmployeeCollection.GetGender(passedUsername); if (tempGender == 'M') { Gender.Text = "Male"; } else if (tempGender == 'F') { Gender.Text = "Female"; } else if (tempGender == 'A') { Gender.Text = "Attack Helicopter"; } }
private void button_Click(object sender, RoutedEventArgs e) { bool validCredentials = false; string enteredUsername; string enteredPassword; enteredUsername = Username_Textbox.Text; enteredPassword = Password_Textbox.Text; validCredentials = UserEmployeeCollection.checkCredentials(enteredUsername, enteredPassword); if (validCredentials == false) { MessageBox.Show("Invalid Input. Please Retry"); } else { sessionUserLogin = enteredUsername; MainMenu main = new MainMenu(sessionUserLogin); App.Current.MainWindow = main; this.Close(); main.Show(); } }
private void EmployeeListSelect_CellClick(object sender, SelectedCellsChangedEventArgs e) { string x = GetSelectedCellValue(); TestLabel.Content = x; passedUsername = x; List <UserEmployee> checkXList = new List <UserEmployee>(); checkXList = UserEmployeeCollection.ReturnAList(); bool isThere = false; foreach (var element in checkXList) { if (element.Username == x) { isThere = true; } } if (isThere == false) { MessageBox.Show("Please Select a Username before trying to click the Next button"); } }
private void Application_Startup(object sender, StartupEventArgs e) { Window1 wnd = new Window1(); DateTime value = new DateTime(2016, 11, 1, 5, 20, 00); //call for loading in users from database goes here. //below is a temporary test case object UserEmployeeCollection.addUser(1, "Derek", "Thomas", "Blankinship", 1, 1, "admin", "password", value, 'M', "574-123-1234", "574-234-2345", "N/A", "574-345-3456", "N/A", "*****@*****.**", value, value, value, "admin", value, "admin", "no notes"); UserEmployeeCollection.addUser(1, "Hunter", "H", "Johnson", 1, 1, "user2", "12345", value, 'M', "574-410-2323", "574-234-7811", "N/A", "574-420-6969", "N/A", "*****@*****.**", value, value, value, "admin", value, "admin", "no notes"); UserEmployeeCollection.addUser(1, "Andrew", "A", "Stone", 1, 1, "user3", "12345", value, 'M', "574-123-4201", "574-234-6955", "N/A", "574-666-1337", "N/A", "*****@*****.**", value, value, value, "admin", value, "admin", "no notes"); UserEmployeeAddressCollection.addUserAddress1("admin", "exampleStreet1", "exampleCity1", "exampleState1", 12345, value, "admin", value, "admin", "no notes"); UserEmployeeAddressCollection2.addUserAddress2("admin", "exampleStreet2", "exampleCity2", "exampleState2", 23456, value, "admin", value, "admin", "no notes"); UserEmployeeEmergencyCollection.addUserEmergencyContact1("admin", "Tara", "Blankinship", "574-567-8901", "wife", value, "admin", value, "admin", "no notes"); UserEmployeeEmergencyCollection2.addUserEmergencyContact2("admin", "ASD", "adf", "adsf", "adsf", value, "admin", value, "admin", "no notes"); UserEmployeeAddressCollection.addUserAddress1("user2", "321 Red Drive", "exampleCity1", "exampleState1", 54378, value, "admin", value, "admin", "no notes"); UserEmployeeAddressCollection.addUserAddress1("user3", "275 Green Avenue", "exampleCity1", "exampleState1", 43589, value, "admin", value, "admin", "no notes"); UserEmployeeEmergencyCollection.addUserEmergencyContact1("user2", "John", "Meme", "574-567-6969", "wife", value, "admin", value, "admin", "no notes"); UserEmployeeEmergencyCollection.addUserEmergencyContact1("user3", "Max", "Smith", "574-216-2017", "wife", value, "admin", value, "admin", "no notes"); CustomerCollection.AddCustomer("Walmart", 3, "walmart", "edlp33", "574-201-5669", "574-420-7878", "*****@*****.**", value, "N/A", value, "N/A", "no notes"); CustomerCollection.AddCustomer("Dicks Sporting Goods", 3, "dicks", "sports", "574-343-5555", "574-777-9999", "*****@*****.**", value, "admin", value, "admin", "no notes"); CustomerCollection.AddCustomer("Dominos Pizza", 3, "dominos", "pizza", "574-666-6666", "574-323-0909", "*****@*****.**", value, "admin", value, "admin", "no notes"); CustomerAddressCollection.addCustomerAddress("walmart", "123 Streert Name", "Mishawaka", "Indiana", 46544, value, "admin", value, "admin", "no notes"); CustomerAddressCollection.addCustomerAddress("dicks", "234 Streert Name", "Mishawaka", "Indiana", 46544, value, "admin", value, "admin", "no notes"); CustomerAddressCollection.addCustomerAddress("dominos", "345 Streert Name", "Mishawaka", "Indiana", 46544, value, "admin", value, "admin", "no notes"); AssetCollection.AddAsset("Lawnmowers", 2000.0, 10.0, "Hardware", value, "admin", value, "admin", "for cutting grass"); AssetCollection.AddAsset("Leafblower", 500.0, 5.0, "Hardware", value, "admin", value, "admin", "for blowing leaves"); AssetCollection.AddAsset("Snowblower", 400.0, 4.0, "Hardware", value, "admin", value, "admin", "for blowing snow"); UserPositionIDCollection.addUserPositionID(1, "Owner", 10000000.00); UserPositionIDCollection.addUserPositionID(2, "Employee", 200000.00); UserPositionIDCollection.addUserPositionID(3, "Intern", 0.0); wnd.Show(); }