public override void ProcessRequest(HttpContext context)
        {
            vmJsonResult         r_json_data = null;
            JavaScriptSerializer js          = new JavaScriptSerializer();

            js.MaxJsonLength = 4096;
            String       city  = context.Request.Form["city"];
            LogicAddress LBase = new LogicAddress();

            try
            {
                LBase.Connection = getSQLConnection();

                r_json_data = new vmJsonResult()
                {
                    result = true, data = LBase.GetCountry(city)
                };
                context.Response.Write(js.Serialize(r_json_data));
            }
            catch (Exception ex)
            {
                r_json_data = new vmJsonResult()
                {
                    result = false, message = ex.Message + ":" + ex.StackTrace
                };
                context.Response.Write(js.Serialize(r_json_data));
            }
        }
Example #2
0
        protected override void HandleCollectDataToOptions()
        {
            //ViewBag.NewsKind_Option = MakeDropDownOption(ac.GetGroupCodeValue("NewsKind"));
            a_Users ac_User = new a_Users()
            {
                Connection = getSQLConnection()
            };
            LogicAddress address = new LogicAddress()
            {
                Connection = this.getSQLConnection()
            };

            ViewBag.Unit_Option    = MakeCollectDataToOptions(ac_User.MakeOption_Unit(), false);
            ViewBag.City_Option    = MakeCollectDataToOptions(address.GetCity(), false);
            ViewBag.Country_Option = MakeCollectDataToOptions(address.GetCountry(""), false);
        }
        public override void ProcessRequest(HttpContext context)
        {
            vmJsonResult r_json_data = null;
            JavaScriptSerializer js = new JavaScriptSerializer();
            js.MaxJsonLength = 4096;
            String city = context.Request.Form["city"];
            LogicAddress LBase = new LogicAddress();

            try
            {
                LBase.Connection = getSQLConnection();

                r_json_data = new vmJsonResult() { result = true, data = LBase.GetCountry(city) };
                context.Response.Write(js.Serialize(r_json_data));
            }
            catch (Exception ex)
            {
                r_json_data = new vmJsonResult() { result = false, message = ex.Message + ":" + ex.StackTrace };
                context.Response.Write(js.Serialize(r_json_data));
            }
        }