private void login_Load(object sender, EventArgs e) { //Check to see if the Required ProgramFiles folder exist if (!Directory.Exists(REQUIREDFOLDER)) { Directory.CreateDirectory(REQUIREDFOLDER); } if (!Directory.Exists(REQUIREDFOLDER + "Admin")) { userControls creatTheAdminUser = new userControls(); creatTheAdminUser.createUser("admin", "admin"); creatTheAdminUser = null; } //Checks to see if the Job codes file exist if (!File.Exists(REQUIREDFOLDER + JOBCODESFILE)) { //Create the job Codes File Here FileStream createJobCodesFile = new FileStream(REQUIREDFOLDER + JOBCODESFILE, FileMode.Create, FileAccess.Write); StreamWriter write = new StreamWriter(createJobCodesFile); write.WriteLine("JOB"); write.Close(); createJobCodesFile.Close(); } }
private void deleteSelectedUserJobBtn_Click(object sender, EventArgs e) { userControls deleteSelectedUserJob = new userControls(); deleteSelectedUserJob.deleteJobForSelectedUser(userNamesListBox.SelectedItem.ToString(), selectedUsersJobListBox.SelectedItem.ToString()); fillSelectedUsersJobList(userNamesListBox.SelectedItem.ToString()); deleteSelectedUserJobBtn = null; }
private void deleteUserBtn2_Click(object sender, EventArgs e) { userControls deleteSelectedUser = new userControls(); deleteSelectedUser.deleteUser(userNamesListBox.SelectedItem.ToString()); deleteSelectedUser = null; fillCurrentUsersList(); }
private void newUserBtn2_Click(object sender, EventArgs e) { string newUserName = newUserNameTextBox.Text; string newPassword = newUserPassowrdTextBox.Text; if (newUserName != "" && newPassword != "" && !Directory.Exists(REQUIREDFOLDER + newUserName.ToLower())) { userControls createNewUser = new userControls(); createNewUser.createUser(newUserNameTextBox.Text, newUserPassowrdTextBox.Text); fillCurrentUsersList(); createNewUser = null; } else { newUserErrorLabel.Visible = true; } }
private void newJobBtn2_Click(object sender, EventArgs e) { int jobNumberInt; if (newJobNameTextBox.Text != "" && newJobNumberTextBox.Text != "" && int.TryParse(newJobNumberTextBox.Text, out jobNumberInt)) { newJobErrorLabel.Visible = false; userControls createNewJobForSelectedUser = new userControls(); createNewJobForSelectedUser.createNewJobForSelectedUser(userNamesListBox.SelectedItem.ToString(), newJobNumberTextBox.Text, newJobNameTextBox.Text); newJobNameTextBox.Text = ""; newJobNumberTextBox.Text = ""; fillSelectedUsersJobList(userNamesListBox.SelectedItem.ToString()); } else { newJobErrorLabel.Visible = true; } }