About Me

My photo
New Delhi, Delhi, India
I am working in Infosys.

July 12, 2015

Map Handler

<%@ WebHandler Language="C#" Class="hlrPickASchool" %>

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Drawing;
using System.Net;
using System.IO;
using System.Text;
using System.Collections;
using System.Web.SessionState;
using DBLibrary;
public class hlrPickASchool : IHttpHandler
{
   
    System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        string Mode = context.Request["Mode"];
        if (Mode == "GetCurrentLocation")
        {
            clsPickASchool objPick=new clsPickASchool();
            string Longitude = Convert.ToString(context.Request["Longitude"]);
            string Latitude = Convert.ToString(context.Request["Latitude"]);
            context.Response.Write(objPick.GetCurrentLocation(Longitude, Latitude));
        }
        if (Mode == "GetDataSchool")
        {
            clsPickASchool objPick=new clsPickASchool();
            string Longitude = Convert.ToString(context.Request["Longitude"]);
            string Latitude = Convert.ToString(context.Request["Latitude"]);
            string KiloMeter = Convert.ToString(context.Request["KiloMeter"]);
            string City = Convert.ToString(context.Request["City"]);
            string Type = Convert.ToString(context.Request["Type"]);
            List<clsPickASchool> lstSchool = new List<clsPickASchool>();
            lstSchool = objPick.GetDataSchool(Longitude, Latitude, KiloMeter,Type,City);
         //   serializer.Serialize(lstConTemp)
            context.Response.Write(serializer.Serialize(lstSchool));
        }
        if (Mode == "GetMicroSiteData")
        {
            clsPickASchool objPick=new clsPickASchool();

            string SchoolID = Convert.ToString(context.Request["SchoolID"]);
            List<clsPickASchool> lstSchool = new List<clsPickASchool>();
            lstSchool = objPick.GetDataMicroSchool(SchoolID);
         //   serializer.Serialize(lstConTemp)
            context.Response.Write(serializer.Serialize(lstSchool));
        }
        if (Mode == "GetDataCompareSchool")
        {
            clsPickASchool objPick=new clsPickASchool();

            string SchoolID = Convert.ToString(context.Request["IDS"]);
            List<clsPickASchool> lstSchool = new List<clsPickASchool>();
            lstSchool = objPick.GetDataCompareSchool(SchoolID);
         //   serializer.Serialize(lstConTemp)
            context.Response.Write(serializer.Serialize(lstSchool));
        }
        if (Mode == "GetCurrentLatLong")
        {
            clsPickASchool objPick=new clsPickASchool();

            string Position = Convert.ToString(context.Request["Position"]);
         
         //   lstSchool = objPick.GetCurrentLatLong(Position);
         //   serializer.Serialize(lstConTemp)
            context.Response.Write(objPick.GetCurrentLatLong(Position));
        }
    }

    public bool IsReusable {
        get {
            return false;
        }
    }
  

}

No comments:

Post a Comment