Ejemplo n.º 1
0
        //
        public HttpResponseMessage GetEqiw_DX_Section_V2(string STCode, string RCode, short Level, int include, int year)
        {
            string result = string.Empty;

            try
            {
                RuletblEQIW_DX_Section     rule_point = new RuletblEQIW_DX_Section();
                IList <tblEQIW_DX_Section> list       = rule_point.GetRSCode(STCode, RCode, Level, include, year);
                if (list != null && list.Count > 0)
                {
                    result = rule.JsonStr("ok", "", list);
                }
                else
                {
                    result = rule.JsonStr("nodata", "没有测点数据", "");
                }
            }
            catch (Exception e)
            {
                result = rule.JsonStr("error", e.Message, "");
            }

            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
Ejemplo n.º 2
0
        //
        public HttpResponseMessage GetEqiw_DX_RNameandRSName(string year, string stcode, string Level)
        {
            string result = string.Empty;

            try
            {
                if (string.IsNullOrEmpty(year))
                {
                    result = rule.JsonStr("error", "缺少结束日期", "");
                }
                else if (string.IsNullOrEmpty(stcode))
                {
                    result = rule.JsonStr("error", "缺少城市代码", "");
                }
                else if (string.IsNullOrEmpty(Level))
                {
                    result = rule.JsonStr("error", "缺少断面级别", "");
                }
                else
                {
                    RuletblEQIW_DX_Section     rule_section = new RuletblEQIW_DX_Section();
                    IList <tblEQIW_DX_Section> list         = rule_section.GetRSCodeandRCode(stcode, short.Parse(Level), year);

                    if (list != null && list.Count > 0)
                    {
                        result = rule.JsonStr("ok", "", list);
                    }
                    else
                    {
                        result = rule.JsonStr("nodata", "没有断面数据", "");
                    }
                }
            }
            catch (Exception e)
            {
                result = rule.JsonStr("error", e.Message, "");
            }

            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }