Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";
            context.Response.ContentEncoding = Encoding.UTF8;

            // The Request QueryString here is protected against XSS attacks by Request Validation
            QuerySettings settings = CCHSerializer.DeserializeSettings<QuerySettings>(context.Request.QueryString);
            if (settings.Lat == 0.0) { settings.Lat = context.GetLatitude<Double>(); }// Convert.ToDouble(context.GetLatitude<String>()); }
            if (settings.Lng == 0.0) { settings.Lng = context.GetLongitude<Double>(); }// Convert.ToDouble(ThisSession.PatientLongitude); }

            ResultsBack rb = new ResultsBack();
            using (GetFacilitiesForServicePastCare gffspc = new GetFacilitiesForServicePastCare())
            {
                gffspc.ServiceID = context.GetServiceID<Int32>();//ThisSession.ServiceID;
                gffspc.ProcedureCode = context.GetPastCareProcedureCode<String>();// ThisSession.PastCareProcedureCode;
                gffspc.Latitude = settings.Lat;
                gffspc.Longitude = settings.Lng;
                gffspc.SpecialtyID = context.GetSpecialtyID<Int32>();//ThisSession.SpecialtyID;
                gffspc.PastCareID = context.GetPastCareID<Int32>();//Convert.ToInt32(ThisSession.PastCareID);
                //gffspc.MemberMedicalID = ThisSession.SubscriberMedicalID;
                gffspc.CCHID = context.GetCCHID<Int32>();//ThisSession.CCHID;
                gffspc.UserID = context.GetUserLogginID<String>();//System.Web.Security.Membership.GetUser(ThisSession.PatientEmail).ProviderUserKey.ToString();
                gffspc.SessionID = context.GetSessionID<String>();
                gffspc.Domain = context.GetDomain<String>();
                gffspc.GetData();

                if (!gffspc.HasErrors)
                {
                    //ResultData rd;
                    gffspc.ForEachResult<DataRow>(delegate(DataRow dr)
                    {
                        //rd = new ResultData();

                    });
                }
            }
        }
Пример #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";
            context.Response.ContentEncoding = Encoding.UTF8;

            // The Request QueryString here is protected against XSS attacks by Request Validation
            QuerySettings settings = CCHSerializer.DeserializeSettings<QuerySettings>(context.Request.QueryString);
            if (settings.Lat == null) { settings.Lat = context.GetLatitude<String>(); }
            if (settings.Lng == null) { settings.Lng = context.GetLongitude<String>(); }

            ResultsBack rb = new ResultsBack();
            using (GetDoctorsForService gdfs = new GetDoctorsForService())
            {
                gdfs.ServiceName = context.GetServiceName<String>();
                gdfs.Latitude = settings.Lat;
                gdfs.Longitude = settings.Lng;
                gdfs.SpecialtyID = context.GetSpecialtyID<Int32>();
                //gdfs.MemberMedicalID = ThisSession.SubscriberMedicalID;
                gdfs.CCHID = context.GetCCHID<Int32>();
                gdfs.UserID = context.GetUserLogginID<String>();
                gdfs.SessionID = context.GetSessionID<String>();
                gdfs.Domain = context.GetDomain<String>();
                gdfs.GetData();
                if (!gdfs.HasErrors)
                {
                    ResultData rd = new ResultData();
                    gdfs.ForEachResult(delegate(object Result)
                    {
                        rd = CCHSerializer.DeserializeDataRow<ResultData>(Result);
                        rd.Distance = String.Format("{0:#0.0 mi}", Convert.ToDouble(rd.NumericDistance));
                        rb.AddResult(rd);
                    });
                }
            }

            JavaScriptSerializer jss = new JavaScriptSerializer();
            String jsonBack = jss.Serialize(rb);

            context.Response.Write(jsonBack);
        }