Ejemplo n.º 1
0
        public HttpResponseMessage GetTemplate(string model, string userid)
        {
            string returntxt = "";

            try
            {
                RuletblEQI_Query_Group rule_group = new RuletblEQI_Query_Group();
                if (rule.IsNmmber(Convert.ToString(userid)))
                {
                    IList <tblEQI_Query_Group> list = rule_group.GetByUserIDandObject(int.Parse(userid), model);
                    if (list.Count > 0)
                    {
                        returntxt = rule.JsonStr("ok", "成功", list);
                    }
                    else
                    {
                        returntxt = rule.JsonStr("1", "没有数据", list);
                    }
                }
                else
                {
                    returntxt = rule.JsonStr("error", "参数错误", "");
                }
            }
            catch (Exception e)
            {
                returntxt = rule.JsonStr("error", e.Message, "");
            }
            return(new HttpResponseMessage {
                Content = new StringContent(returntxt, System.Text.Encoding.UTF8, "application/json")
            });
        }