You are on page 1of 1

using using using using using using using using using using using using using using using

using using using using

System; System.Collections.Generic; System.Linq; System.Web; System.Web.UI; System.Web.UI.WebControls; System.Web.Services; System.Data; System.Text; System.Data.SqlClient; System.Configuration; System.Web.Script.Services; System.Collections; Newtonsoft.Json; System.Web.UI.HtmlControls; System.Runtime.Serialization; System.Web.Script.Serialization; System.IO; StackMachine.Controls;

namespace StackMachine.Service { /// <summary> /// Summary description for Employees /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NET AJAX, u ncomment the following line. [System.Web.Script.Services.ScriptService] public class Employees : System.Web.Services.WebService { [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string GetEmployees() { ArrayList employeeList; string url = HttpContext.Current.Request.QueryString.Get("Url"); Uri myRef = new Uri(url); string jobNumber = HttpUtility.ParseQueryString(myRef.Query).Get("Jo bNumber"); int JobNum = Convert.ToInt16(jobNumber); employeeList = StackMachineBL.BLMBR.GetEmployeesForMBR(JobNum); int numBillableRates = 0; numBillableRates = StackMachineBL.BLMBR.GetNoOfBRForJob(JobNum); string nameListJSON = JsonConvert.SerializeObject(new { EmpList = em ployeeList, NoOfBRs = numBillableRates }, Formatting.None); return nameListJSON; } } }

You might also like