Beispiel #1
0
        void loadList()
        {
            DataTable tab = MsgContentsBLL.getMsgByPageType();

            if (tab != null && tab.Rows.Count > 0)
            {
                gv_msg.DataSource = tab.DefaultView;
                gv_msg.DataBind();
            }
        }
Beispiel #2
0
        string getTempMsg(HttpContext context)
        {
            int       ret  = Convert.ToInt16(context.Request.Form["type"]);
            DataTable dt   = MsgContentsBLL.getMsgByPageType(ret);
            ArrayList list = new ArrayList();

            if (dt != null && dt.Rows.Count > 0)
            {
                string json_obj = "{'msg':[";
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string type = Convert.ToString(dt.Rows[i]["page_type"]);
                    if (string.IsNullOrEmpty(type) == true)
                    {
                        return("{'ret':'1'}");
                    }
                    ;
                    if (list.Count <= 0)
                    {
                        list.Add(type);
                    }
                    else
                    {
                        if (list.IndexOf(type) < 0)
                        {
                            list.Add(type);
                        }
                    }
                    json_obj += "{";
                    json_obj += @"'pageType':'" + Convert.ToString(dt.Rows[i]["page_type"]) + "',";
                    json_obj += @"'typeTitle':'" + Convert.ToString(dt.Rows[i]["type_title"]) + "',";
                    json_obj += @"'msgContent':'" + Convert.ToString(dt.Rows[i]["msg_content"]) + "'";
                    json_obj += "}";
                    if (i != dt.Rows.Count - 1)
                    {
                        json_obj += ",";
                    }
                }
                json_obj += "],'ret':'0',typelist:'" + listToString(list) + "'}";
                return(json_obj);
            }
            return("");
        }