- Create new project name EmployeeWS with type ASP.NET Web Service. Change name of Service1 to EmpWS.
- Write some method to export to the Web
– A method to add new Employee
– A method to get department name of employee. Parameters: empid, empname
– A method to calculate man-hour for employee. Parameter: empid
- Use HTTP-GET to test Web service by press F5
- Use HTTP-POST to test Web service. Create a HTML page and place control to pass parameters.
- Create a Web proxy to test Web service.
- Create a new Web project to test above dll.
- Create new project name MyWebControl with type Web Control Library. Change class name from WebControl1 to MyOwnWebControl.
- This composite control has two control DropDownList and DataGrid as below:
- Write some properties and method to do the following:
– Set text display before DropDownList
– Set data source for DropDownList (Customers table)
– When user choose an item in the DropDownList, the appropriate data should be display in the DataGrid, according to the SelectedValue in the DropDownList (data in Bookings table according to CustID in DropDownList)
– DataGrid has two columns, first column link to appropriate page to edit data in the Bookings table, second column to delete appropriate row in the Bookings table.
- To do work above, write the following properties:
– Text : Set text display before DropDownList
– SQLConnectionString : Set connection string for database
– sqlTextForCombo : Sql command text to retrieve data for DropDownList
– ErrorMessage : to get error while processing
– SourceTableForDataGrid : Table name is data source for DataGrid
– KeyFieldForDataGrid : DataKeyField for DataGrid
– UpdateLink : link to the page to edit data in the Bookings table
- Write the following methods:
– public bool SetDataSourceCombo(string textField, string valueField) : to set data source for DropDownList
– private bool SetDataSourceDataGrid(string sqlText) : to set data source for DataGrid
- Create new Web form name Reports.aspx as below :
In lower section is a CrystalReportViewer
- The doprdown list Period includes Day, Month, Quarter and Year. The doprdown list Order includes Ascending and Descending. The doprdown list Report Type includes Profit and Performance. The doprdown list By includes Profit, Room name.
- The doprdown list Room should be fill with data in table rooms.
- When button View Report click, show report with appropriate condition.
- Profit report contain 5 columns :
– Room name
– Revenue (group by room)
– Cost = 80% of Revenue
– Profit = 20% of Revenue