Example #1
0
        public JpColumns(string cid)
        {
            string sql = " select * from JpColumns ";
            sql += " where cid = @cid ";

            DAO db = new DAO();

            SqlParameter[] sqlparam = {
                    db.MakeInParam("@cid",SqlDbType.VarChar,cid),
                };

            DataTable dt = db.GetDataTable(sql, sqlparam);

            if (dt.Rows.Count > 0)
            {
                this.cid = dt.Rows[0]["cid"].ToString();
                this.cname = dt.Rows[0]["cname"].ToString();
                this.tmp_col = dt.Rows[0]["tmp_col"].ToString();
                this.tmp_art = dt.Rows[0]["tmp_art"].ToString();
                this.online = dt.Rows[0]["online"].ToString();
                this.hotpublish = dt.Rows[0]["hotpublish"].ToString();
                this.pubtime = dt.Rows[0]["pubtime"].ToString();
                this.seotitle = dt.Rows[0]["seotitle"].ToString();
                this.seokeywords = dt.Rows[0]["seokeywords"].ToString();
                this.seodescription = dt.Rows[0]["seodescription"].ToString();
                this.pubhtmlpath = dt.Rows[0]["pubhtmlpath"].ToString();
                this.ifhotnews = dt.Rows[0]["ifhotnews"].ToString();
                this.csort = Int32.Parse(dt.Rows[0]["csort"].ToString());
                this.shtml = dt.Rows[0]["shtml"].ToString();
                this.rss = Int32.Parse(dt.Rows[0]["rss"].ToString());
                this.newpic = dt.Rows[0]["newpic"].ToString();
                this.newday = Int32.Parse(dt.Rows[0]["newday"].ToString());
            }
        }
Example #2
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <returns></returns>
 public bool Update()
 {
     bool ret = true;
     DAO db = new DAO();
     try
     {
         String sqlUpdate = " update hy_verifycode set hy_tel=@hy_tel,hy_addtime=@hy_addtime,hy_code=@hy_code  where 1=1 and id=@id";
         SqlParameter[] sqlparam = {db.MakeInParam("@hy_addtime",SqlDbType.DateTime,hy_addtime),
                                       db.MakeInParam("@hy_tel",SqlDbType.VarChar,hy_tel),
                                       db.MakeInParam("@hy_code",SqlDbType.VarChar,hy_code),
                                       db.MakeInParam("@id",SqlDbType.Int,id)
                                  };
         db.Execute(sqlUpdate, sqlparam);
     }
     catch
     {
         ret = false;
     }
     finally
     {
         db.Close();
         db.Dispose();
     }
     return ret;
 }
Example #3
0
        /// <summary>
        /// 插入
        /// </summary>
        /// <returns></returns>
        public bool Insert()
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                String sqlInsert = " insert into hy_verifycode(hy_tel,hy_code,hy_addtime)  values (@hy_tel,@hy_code,@hy_addtime)";
                SqlParameter[] sqlparam = {db.MakeInParam("@hy_addtime",SqlDbType.DateTime,hy_addtime),
                                              db.MakeInParam("@hy_tel",SqlDbType.VarChar,hy_tel),
                                              db.MakeInParam("@hy_code",SqlDbType.VarChar,hy_code)
                                         };
                db.Execute(sqlInsert, sqlparam);
            }
            catch (Exception ex)
            {
                throw ex;
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Example #4
0
        /// <summary>
        /// ɾ��
        /// </summary>
        /// <returns></returns>
        public bool Delete()
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                String sql = "delete from JpDepts where deptid=@deptid ";

                SqlParameter[] sqlparam = {
                    db.MakeInParam("@deptid",SqlDbType.VarChar,deptid),
                };

                db.Execute(sql, sqlparam);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Example #5
0
        /// <summary>
        /// ɾ��ij��Ŀ�����й���
        /// </summary>
        /// <returns></returns>
        public bool DeleteBycid(string cid)
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                string sql = " delete JpColumnRelations where cid=@cid ";
                SqlParameter[] sqlparam = {
                    db.MakeInParam("@cid",SqlDbType.VarChar,cid),
                };

                db.Execute(sql, sqlparam);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Example #6
0
        public bool Insert()
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                string sql = " insert into JpPubHtml(id,pages,days,status) values (@id,@pages,@days,@status)";

                SqlParameter[] sqlparam = {
                    db.MakeInParam("@id",SqlDbType.VarChar,id),
                    db.MakeInParam("@pages",SqlDbType.VarChar,pages),
                    db.MakeInParam("@days",SqlDbType.VarChar,days),
                    db.MakeInParam("@status",SqlDbType.VarChar,status),
                };

                db.Execute(sql, sqlparam);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Example #7
0
 public DataTable GetHits()
 {
     String sql = "Select * from JpHits order by  hits_date desc";
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(sql);
     return dt;
 }
Example #8
0
    //提交
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.Session["uid"] == null || this.Session["uid"].ToString() == "")
        {
            this.Response.Redirect("../login.aspx");
        }

        string ls_tip = "审核成功!";

        TPortalClass.JpActivity JpActivity = new TPortalClass.JpActivity();
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.DAO db = new TPortalClass.DAO();
        string sql_cg = "update hy_activity set hy_ifsh=2 where id=" + System.Int32.Parse(this.txtid.Value) + "";
        db.Execute(sql_cg);
        //写系统日志
        string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (userip == null || userip == "")
        {
            userip = Request.ServerVariables["REMOTE_ADDR"];
        }
        JpCommon.WriteLog(userip, "审核", "审核活动记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());
        JpActivity.Update();

        Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
    }
Example #9
0
    //审核
    protected void btnAudit_Click(object sender, EventArgs e)
    {
        TPortalClass.DAO db = new TPortalClass.DAO();
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpActivityusers JpActivityusers = new TPortalClass.JpActivityusers();
        string ls_tip = "审核成功!";
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                string sql = "update hy_activityusers set hy_ifsh=1 where id=" + System.Int32.Parse(id) + "";
                db.Execute(sql);
            }
        }
        string pageUrl = "";

        pageUrl = JpCommon.CombUrlTxt("list_activityusers.aspx", "page={0}&rnd={1}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "");
        //写系统日志
        string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (userip == null || userip == "")
        {
            userip = Request.ServerVariables["REMOTE_ADDR"];
        }
        JpCommon.WriteLog(userip, "审核人员", "批量审核活动报名人员", Session["uid"].ToString(), Session["uname"].ToString());
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }
Example #10
0
        /// <summary>
        /// ɾ�����
        /// </summary>
        /// <returns></returns>
        public bool DeleteAll(string uids)
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                String sql = "delete from JpStudents where @uid like '%,'+uid+',%'";

                SqlParameter[] sqlparam = {
                    db.MakeInParam("@uid",SqlDbType.VarChar,uids),
                };

                db.Execute(sql, sqlparam);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Example #11
0
        /// <summary>
        /// ɾ��
        /// </summary>
        /// <returns></returns>
        public bool Delete()
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                string sql = "delete from JpTemplate where url=@url ";
                SqlParameter[] sqlparam = {
                    db.MakeInParam("@url",SqlDbType.VarChar,url),
                };

                db.Execute(sql, sqlparam);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Example #12
0
        /// <summary>
        /// ɾ��
        /// </summary>
        /// <returns></returns>
        public bool Delete()
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                String sql = "delete from JpOpinionHF where id=@id ";
                SqlParameter[] sqlparam = {
                    db.MakeInParam("@id",SqlDbType.Int,id),
                };
                db.Execute(sql, sqlparam);

            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Example #13
0
        /// <summary>
        /// ����
        /// </summary>
        /// <returns></returns>
        public bool Insert()
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                string sql = " insert into JpColumnsStyle(url,tclass,cid) values ";
                sql += " (@url,@tclass,@cid) ";
                SqlParameter[] sqlparam = {
                    db.MakeInParam("@url",SqlDbType.VarChar,url),
                    db.MakeInParam("@tclass",SqlDbType.VarChar,tclass),
                    db.MakeInParam("@cid",SqlDbType.VarChar,cid),
                };

                db.Execute(sql, sqlparam);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Example #14
0
 //答复
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Session["uid"] == null || this.Session["uid"].ToString() == "")
     {
         this.Response.Redirect("../login.aspx");
     }
     string ls_tip = "答复成功!";
     TPortalClass.DAO db = new TPortalClass.DAO();
     TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
     string ls_ = txthy_reply.Text;
     int ls_hy_ifsh = 2;
     //写系统日志
     string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
     if (userip == null || userip == "")
     {
         userip = Request.ServerVariables["REMOTE_ADDR"];
     }
     JpCommon.WriteLog(userip, "答复", "答复求助记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());
     string sql_Update = "  UPDATE  hy_help SET";
     sql_Update += "   hy_reply  ='" + txthy_reply.Text + "'";
     sql_Update += " , hy_replytime ='" + DateTime.Now.ToString("yyyy-MM-dd") + "'";
     sql_Update += " , hy_ifsh =" + ls_hy_ifsh + "   where id=" + Convert.ToInt32(txtid.Value.Trim()) + "";
     db.Execute(sql_Update);
     Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
 }
Example #15
0
        public bool Update()
        {
            bool ret = true;
            DAO db = new DAO();
            try
            {
                String sql = "UPDATE JpPubHtml SET pages=@pages,days=@days,status=@status where id=@id";
                SqlParameter[] sqlparam = {
                    db.MakeInParam("@id",SqlDbType.VarChar,id),
                    db.MakeInParam("@pages",SqlDbType.VarChar,pages),
                    db.MakeInParam("@days",SqlDbType.VarChar,days),
                    db.MakeInParam("@status",SqlDbType.VarChar,status),
                };
                db.Execute(sql, sqlparam);

            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Example #16
0
        /// <summary>
        /// ɾ��
        /// </summary>
        /// <returns></returns>
        public bool Delete()
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                //��ɾ��ѡ��
                String sql_option = "delete from hy_favorite where id=@id ";
                SqlParameter[] sqlparam_option = {
                    db.MakeInParam("@id",SqlDbType.Int,id),
                };
                db.Execute(sql_option, sqlparam_option);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Example #17
0
        public bool DeleteImg(string id)
        {
            bool ret = true;
            DAO db = new DAO();
            try
            {
                string sql = "delete from hy_fileatt where  id=@id  ";
                SqlParameter[] sqlparam = new SqlParameter[]
                {
                    db.MakeInParam("@id", SqlDbType.VarChar, id)
                };

                db.Execute(sql, sqlparam);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Example #18
0
 public JpSite()
 {
     String sql = "Select * from JpSite";
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(sql);
     if (dt.Rows.Count > 0)
     {
         SiteName = dt.Rows[0]["SiteName"].ToString();
         CompName = dt.Rows[0]["CompName"].ToString();
         host = dt.Rows[0]["host"].ToString();
         root = dt.Rows[0]["root"].ToString();
         tel = dt.Rows[0]["tel"].ToString();
         fax = dt.Rows[0]["fax"].ToString();
         adminemail = dt.Rows[0]["adminemail"].ToString();
         bah = dt.Rows[0]["bah"].ToString();
         seo_indextitle = dt.Rows[0]["seo_indextitle"].ToString();
         seo_indexkeyword = dt.Rows[0]["seo_indexkeyword"].ToString();
         seo_indexdescription = dt.Rows[0]["seo_indexdescription"].ToString();
         copyright = dt.Rows[0]["copyright"].ToString();
         homepage = dt.Rows[0]["homepage"].ToString();
         visitors = System.Int32.Parse(dt.Rows[0]["visitors"].ToString());
         dbname = dt.Rows[0]["dbname"].ToString();
         version = dt.Rows[0]["version"].ToString();
         nwyuming = dt.Rows[0]["nwyuming"].ToString();
         wwyuming = dt.Rows[0]["wwyuming"].ToString();
         lan_big5 = dt.Rows[0]["lan_big5"].ToString();
     }
 }
Example #19
0
 public DataTable Getdocs()
 {
     String sql = " select * from HyQzwd  ";
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(sql);
     db.Close();
     return dt;
 }
Example #20
0
 public DataTable getActive(int count)
 {
     string cmdStr = " Select top " + count + " * from hy_activity where hy_ifsh='2'  and hy_starttime <=getdate() and hy_endtime >=getdate() order by hy_addtime desc , hy_sort desc ";
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(cmdStr);
     db.Close();
     db.Dispose();
     return dt;
 }
Example #21
0
 /// <summary>
 /// ��ȡ�̳Ƿ����ĺû�
 /// </summary>
 /// <param name="count">��ȡ����������</param>
 /// <returns></returns>
 public DataTable getBetterGoods(int count)
 {
     String sqlSelect = " select top " + count + " * from hy_goods where (hy_cid = '006001001' or hy_cid='006002001' or  hy_cid='006003001'  or  hy_cid='006004001') and hy_ifsh='2' order by hy_sort ";
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(sqlSelect);
     db.Close();
     db.Dispose();
     return dt;
 }
Example #22
0
 //ɾ��
 public void DeleteAll(String ids)
 {
     DAO db = new DAO();
     String sql = "Delete FROM JpNews where @aids like '%,'+cast(aid as varchar(12))+',%'";
     SqlParameter[] prams ={
         db.MakeInParam("@aids", SqlDbType.VarChar, ids)
     };
     db.Execute(sql, prams);
     db.Close();
 }
Example #23
0
        public void DeleteAll(String cid)
        {
            DAO db = new DAO();
            String sql = "Delete FROM JpColumnsStyle where cid=@cid ";
            SqlParameter[] prams ={
                db.MakeInParam("@cid", SqlDbType.VarChar, cid)
            };

            db.Execute(sql, prams);
            db.Close();
        }
Example #24
0
        public void DeleteAll(String urls)
        {
            DAO db = new DAO();
            String sql = "Delete FROM Jptemplate where @url like '%,'+url+',%'";
            SqlParameter[] prams ={
                db.MakeInParam("@url", SqlDbType.VarChar, urls)
            };

            db.Execute(sql, prams);
            db.Close();
        }
Example #25
0
 //�����ĵ�ID�õ���¼
 public DataTable Getdocbyid(string id)
 {
     String sql = " select * from HyQzwd where id=@id ";
     DAO db = new DAO();
     SqlParameter[] sqlparam = {
             db.MakeInParam("@id",SqlDbType.Int,System.Int32.Parse(id)),
         };
     DataTable dt = db.GetDataTable(sql, sqlparam);
     db.Close();
     return dt;
 }
Example #26
0
 public DataTable GetData(string strWhere)
 {
     String sql = " select * from hy_favorite where 1=1  ";
     if (strWhere != "")
     {
         sql += strWhere;
     }
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(sql);
     db.Close();
     return dt;
 }
Example #27
0
 //获取指定信息
 public DataTable Getdocs(String orderby)
 {
     String sql = " select * from hy_news ";
     sql += " @orderby ";
     DAO db = new DAO();
     SqlParameter[] sqlparam = {
             db.MakeInParam("@orderby",SqlDbType.VarChar,orderby),
         };
     DataTable dt = db.GetDataTable(sql, sqlparam);
     db.Close();
     return dt;
 }
Example #28
0
 //获取指定信息
 public DataTable Getdocbyid(Int32 id)
 {
     String sql = " select * from hy_news  ";
     sql += " where id = @id";
     DAO db = new DAO();
     SqlParameter[] sqlparam = {
             db.MakeInParam("@id",SqlDbType.Int,id),
         };
     DataTable dt = db.GetDataTable(sql, sqlparam);
     db.Close();
     return dt;
 }
Example #29
0
 //��ȡָ����Ϣ
 public DataTable GetNewsbyaid(Int32 aid)
 {
     String sql = " select * from JpNews  ";
     sql += " where aid = @aid";
     DAO db = new DAO();
     SqlParameter[] sqlparam = {
             db.MakeInParam("@aid",SqlDbType.Int,aid),
         };
     DataTable dt = db.GetDataTable(sql, sqlparam);
     db.Close();
     return dt;
 }
Example #30
0
 public JpPubHtml()
 {
     String sql = "Select * from JpPubHtml";
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(sql);
     if (dt.Rows.Count > 0)
     {
         id = dt.Rows[0]["id"].ToString();
         pages = dt.Rows[0]["pages"].ToString();
         days = dt.Rows[0]["days"].ToString();
         status = dt.Rows[0]["status"].ToString();
     }
 }