Example #1
0
    public void postMessage()
    {
        string name   = Request["txtname"];
        string mobile = Request["mobile"];
        string desc   = Request["desc"];
        string email  = Request["email"];

        Cms.Model.C_message model = new Cms.Model.C_message();
        model.Name       = name;
        model.PhoneNum   = mobile;
        model.telNum     = mobile;
        model.content    = desc;
        model.email      = email;
        model.updateTime = DateTime.Now;
        int result = new Cms.BLL.C_message().Add(model);

        if (result > 0)
        {
            string strJson = "{\"status\":0}";
            Response.Write(strJson);
            Response.End();
        }
        else
        {
            string strJson = "{\"status\":1}";
            Response.Write(strJson);
            Response.End();
        }
    }
Example #2
0
    public static void RepeaterMessage(int top, Repeater rep)
    {
        DataSet ds = new Cms.BLL.C_message().GetList(top, "", "messageid desc");

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            rep.DataSource = ds.Tables[0].DefaultView;
            rep.DataBind();
        }
    }
Example #3
0
    public void DataBind(int messageid)
    {
        Cms.BLL.C_message bllmessage = new Cms.BLL.C_message();
        DataSet           ds         = bllmessage.GetList("messageid=" + messageid);

        if (ds.Tables[0].Rows.Count > 0)
        {
            DataRow dr = ds.Tables[0].Rows[0];
            this.Name.Text     = dr["Name"].ToString();     //联系人
            this.UnitName.Text = dr["UnitName"].ToString(); //单位名称
            this.PhoneNum.Text = dr["PhoneNum"].ToString();
            this.telNum.Text   = dr["telNum"].ToString();
            this.email.Text    = dr["email"].ToString();
            this.title.Text    = dr["title"].ToString();

            this.strcontent.Text    = dr["content"].ToString();
            this.userName.Text      = dr["userName"].ToString() == "" ? "匿名用户" : dr["userName"].ToString();
            this.updateTime.Text    = dr["updateTime"].ToString();
            this.replay.Text        = dr["replay"].ToString();
            this.re_updateTime.Text = dr["re_updateTime"].ToString();
        }
    }