Find Jobs
Hire Freelancers

567802 PayrollSystem3

N/A

Em Andamento
Publicado há quase 12 anos

N/A

Pago na entrega
Hello Nick, Felicia stated your last work was good. Nicely done. Here is the next set of instructions for you. Keep up the good work. 1. Open Microsoft Visual [login to view URL] 2008. 2. Open your last version of PayrollSystem. 3. Open the clsDataLayer class and add the following function: // This function saves the personnel data public static bool SavePersonnel(string Database, string FirstName, string LastName, string PayRate, string StartDate, string EndDate) { bool recordSaved; try { // Add your comments here OleDbConnection conn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); [login to view URL](); OleDbCommand command = [login to view URL](); string strSQL; // Add your comments here strSQL = "Insert into tblPersonnel " + "(FirstName, LastName, PayRate, StartDate, EndDate) values ('" + FirstName + "', '" + LastName + "', " + PayRate + ", '" + StartDate + "', '" + EndDate + "')"; // Add your comments here [login to view URL] = [login to view URL]; [login to view URL] = strSQL; // Add your comments here [login to view URL](); // Add your comments here [login to view URL](); recordSaved = true; } catch (Exception ex) { recordSaved = false; } return recordSaved; } 4. In the frmPersonnelVerified form, go to the Page_Load() event and add the following code after the existing code (but in the Page_Load event handler): // Add your comments here if ([login to view URL]([login to view URL]("[login to view URL]"), Session["txtFirstName"].ToString(), Session ["txtLastName"].ToString(), Session ["txtPayRate"].ToString(), Session ["txtStartDate"].ToString(), Session ["txtEndDate"].ToString())) { [login to view URL] = [login to view URL] + "\nThe information was successfully saved!"; } else { [login to view URL] = [login to view URL] + "\nThe information was NOT saved."; 5. Add explanatory comments for all the remaining code containing “// Add your comments here.” 6. Test your work for errors. 7. Create a new DataSet for the tblPersonnel table (called the DataSet dsPersonnel). 8. Create a new function called GetPersonnel in the clsDataLayer class. This function should retrieve all data from the tblPersonnel table and return it in the form of a dsPersonnel DataSet. Use the GetUserActivity function as an example. 9. Create a new Web form called frmViewPersonnel. 10. Add a GridView control (called grdViewPersonnel) to the form. This GridView control will be used to display data from the tblPersonnel table. Add the CoolBiz logo at the top of the page and make sure it links back to frmMain. 11. Add the following code to the Page_Load() function in frmViewPersonnel: if (![login to view URL]) { // Declare the DataSet dsPersonnel myDataSet = new dsPersonnel(); // Fill the dataset with what is returned from the function myDataSet = [login to view URL]([login to view URL]("[login to view URL]")); // Set the DataGrid to the DataSource based on the table [login to view URL] = [login to view URL]["tblPersonnel"]; // Bind the DataGrid [login to view URL](); } 12. Return to the frmPersonnel Web form and add a button ((ID) = btnViewPersonnel, Text = View Personnel) which, when clicked, will display form frmViewPersonnel. 13. Open the frmPersonnelVerified form and add a button ((ID) = btnViewPersonnel, Text = View Personnel) which, when clicked, will display form frmViewPersonnel. NOTE: This is the same button with the same functionality that you added to form frmPersonnel in the last step. Also add a new link and linked image to frmMain called View Personnel that will go to the new frmViewPersonnel page you created. 14. Add a search feature to allow the user to find and display data. Users will need to enter a last name and the web application will display the grid of employees with all employees that match that last name. 15. Create a new web form called frmSearchPersonnel. Add the hyperlinked Cool Biz logo to this page. Also add a new item on frmMain (with a link button and image button) called Search Personnel. 16. On the frmSearchPersonnel form, add a label that displays "Search for employee by last name:". Next to the label, add a text box with an ID of txtSearchName. Add a button with an ID of btnSearch and set the text of the button to "Search". 17. When the frmSearchPersonnel Search button is pressed, the frmViewPersonnel is displayed. At this point, no searching is actually happening, but you have the forms you need and the navigation working. Now you can focus on the coding you will need to do to have the grid only display matching employees. 18. Before calling the GetPersonnel method you added previously last week, get the value that is in the Request["txtSearch"] item. When the form posts the search page results to the frmViewPersonnel, the name value pair for the search value is passed as part of the Request object. Assign this value to a string variable. 19. Modify the GetPersonnel method you added to include a new parameter called strSearch of type string. This parameter needs to be after the Database string parameter that is already in the method. 20. When calling the GetPersonnel method, pass the value you received to the strSearch parameter. 21. In the GetPersonnel method, you now need to use the passed in strSearch parameter value as part of the SQL string being used to retrieve data. You also need to add logic so that, if strSearch is empty or has no value, all employees are returned in the query. 22. Test the search so that when you enter a last name, employees with that last name are returned. Make sure that when you access frmViewPersonnel and you are not searching, all employees are returned. 23. Some helpful hints: Make sure you reestablish your database connection if you copied the files from a previous lab. Before you pass the search value into the GetPersonnel method, make sure you check to see if the Request item is null. If it is, you need to pass an empty string into the method or check for null inside the method. If you don't do this, you will get a server error. To check to see if an object is null, you compare the object to the keyword null. To create an SQL statement that will search for a given last name in the tblPersonnel table, you can do the following (assume that the search variable was called strSearch). "select * from tblPersonnel where LastName = '" + strSearch + "'" 24. Add the new Search option and the View Employees option to your main navigation page. Run your project and test it: The frmMain form should be displayed first (set this form as your start page). See Picture001 Click on the Add New Employee hyperlink to go to the frmPersonnel data entry form. Click the View Personnel button on this form. The frmViewPersonnel form should be displayed in the browser, but at this point, there should not be any personnel listed (because you haven't entered any yet). Use the Back button in your web browser to return to the frmPersonnel form and enter some personnel data, similar to the following: See Picture002 Now click the Submit button. The frmPersonnelVerified form should be displayed, showing the data you entered, and you should get a message saying that the data was successfully saved, like this: See Picture003 Finally, click the View Personnel data button on this form. The frmViewPersonnel form should be displayed and should show the personnel record you just entered, retrieved from the database, like this: See Picture004 You also should be able to view the employee records by clicking the link on the home page. Test the search feature and make sure that entering no search string returns all the data and that typing in a last name will return all employees with the same last name. See Picture005 See Picture006 NOTE: Make sure you include comments in the code provided where specified: " // Your comments here" and for any code you write, thanks.
ID do Projeto: 2313766

Sobre o projeto

1 proposta
Projeto remoto
Ativo há 12 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
Concedido a:
Avatar do Usuário
Done. Thanks.
$60 USD em 0 dia
4,9 (201 avaliações)
5,7
5,7

Sobre o cliente

Bandeira do(a)
5,0
16
Membro desde ago. 8, 2010

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.