Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Request.QueryString["aid"] != null)
        {
            aid = this.Request.QueryString["aid"].ToString();
        }
        this.txtcid.Value = cid;
        this.txtaid.Value = aid;
        this.lb_type.Text = "手摄一族";
        StringBuilder stringBuilder = new StringBuilder();
        JpPhotography jpPhotography = new JpPhotography();

        DataTable dt = jpPhotography.Getdocbyid(Convert.ToInt32(aid));
        if (dt.Rows.Count > 0)
        {
            this.lb_time.Text = Convert.ToDateTime(dt.Rows[0]["hy_addtime"].ToString()).ToString("yyyy年MM月dd日");
            this.lb_title.Text = dt.Rows[0]["hy_content"].ToString();
            HyFileatt hyFileatt = new HyFileatt();
            DataTable dt_img = hyFileatt.Getdocs(dt.Rows[0]["docid"].ToString(), 8);
            for (int i = 0; i < dt_img.Rows.Count; i++)
            {
                imgPath += "<img src=\"" + dt_img.Rows[i]["hy_filepath"].ToString() + "\" width=\"640\" height=\"340\">";
            }
            this.lb_article.Text = dt.Rows[0]["hy_content"].ToString();
        }
    }
Example #2
0
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改
        }

        if (this.Request.QueryString["id"] != null)
        {
            this.txtid.Value = this.Request.QueryString["id"].ToString();     //文档ID
        }
        TPortalClass.JpPhotography JpPhotography = new TPortalClass.JpPhotography();

        //旧文档
        if (this.txtop.Value == "modify")
        {
            DataTable dt = JpPhotography.Getdocbyid(int.Parse(this.txtid.Value));
            if (dt.Rows.Count > 0)
            {
                this.txtid.Value = dt.Rows[0]["id"].ToString();
                this.txthy_uid.Text = dt.Rows[0]["hy_uid"].ToString();
                this.txthy_content.Text = dt.Rows[0]["hy_content"].ToString();
                this.txthy_address.Text = dt.Rows[0]["hy_address"].ToString();
                this.txthy_addtime.Text = Convert.ToDateTime(dt.Rows[0]["hy_addtime"].ToString()).ToString("yyyy-MM-dd");
                this.txthy_sort.Text = dt.Rows[0]["hy_sort"].ToString();
            }
        }
        else
        {
            TPortalClass.DAO db = new TPortalClass.DAO();
            string sql = "select top 1  hy_sort   from hy_help order by hy_sort desc ";
            DataTable dt = db.GetDataTable(sql);
            if (dt.Rows.Count > 0)
            {
                this.txthy_sort.Text = (Convert.ToInt32(dt.Rows[0]["hy_sort"].ToString()) + 1).ToString();
            }
            else
            {
                this.txthy_sort.Text = "1";
            }
        }
    }
Example #3
0
 public string GetPraiseCount(string pis_yzm, string pis_table, string pis_id)
 {
     string pos_json = "";
     string configYzm = ConfigurationManager.AppSettings["Yanzm"].ToString();
     bool flag = false;
     if (configYzm == pis_yzm && pis_table != "" && pis_id != "")
     {
         if (pis_table == "0")
         {
             JpArticle JpArticle = new JpArticle();
             DataTable dt = JpArticle.GetArticleByaid(Convert.ToInt32(pis_id));
             if (dt.Rows.Count > 0)
             {
                 pos_json = "{\"code\":\"0\",\"praiseCount\":\"" + dt.Rows[0]["praiseCount"].ToString() + "\"}";
             }
             else
             {
                 pos_json = "{\"code\":\"0\",\"praiseCount\":\"0\"}";
             }
         }
         else if (pis_table == "1")
         {
             JpPhotography JpPhotography = new JpPhotography();
             DataTable dt = JpPhotography.Getdocbyid(Convert.ToInt32(pis_id));
             if (dt.Rows.Count > 0)
             {
                 pos_json = "{\"code\":\"0\",\"praiseCount\":\"" + dt.Rows[0]["praiseCount"].ToString() + "\"}";
             }
             else
             {
                 pos_json = "{\"code\":\"0\",\"praiseCount\":\"0\"}";
             }
         }
         else
         {
             //系统错误
             pos_json = "{\"code\":\"1\"}";
         }
     }
     else
     {
         //非法调用
         pos_json = "{\"code\":\"2\"}";
     }
     return pos_json;
 }