Exemplo n.º 1
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;
        }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
        /// <summary>
        /// ɾ��
        /// </summary>
        /// <returns></returns>
        public bool Delete()
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                String sql = "delete from JpStudents where uid=@uid ";

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

                db.Execute(sql, sqlparam);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Exemplo n.º 4
0
        //ɾ��һ������
        public bool Delete()
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                string sql = " delete JpColumnRelations where cid=@cid and cid_relation=@cid_relation and relation=@relation ";

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

                db.Execute(sql, sqlparam);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Exemplo n.º 5
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;
        }
Exemplo n.º 6
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;
        }
Exemplo n.º 7
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;
        }
Exemplo n.º 8
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;
        }
Exemplo n.º 9
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;
 }
Exemplo n.º 10
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;
 }
Exemplo n.º 11
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();
 }
Exemplo n.º 12
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;
 }
Exemplo n.º 13
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();
        }
Exemplo n.º 14
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;
 }
Exemplo n.º 15
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;
 }
Exemplo n.º 16
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;
 }
Exemplo n.º 17
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;
 }
Exemplo n.º 18
0
        /// <summary>
        /// 根据手机号查询最新一条验证码
        /// </summary>
        /// <param name="hy_tel"></param>
        /// <returns></returns>
        public DataTable GetCodesByTel(string hy_tel)
        {
            String sql = " select top 1 * from hy_verifycode where hy_tel=@hy_tel  ";
            sql += " order by hy_addtime desc";

            DAO db = new DAO();
            SqlParameter[] sqlparam = {
                    db.MakeInParam("@hy_tel",SqlDbType.VarChar,hy_tel),
                };
            DataTable dt = db.GetDataTable(sql, sqlparam);
            db.Close();
            return dt;
        }
Exemplo n.º 19
0
 public DataTable Getdocbyid(string id)
 {
     string sql = " select * from hy_fileatt where id=@id ";
     DAO db = new DAO();
     SqlParameter[] sqlparam = new SqlParameter[]
     {
         db.MakeInParam("@id", SqlDbType.VarChar, id)
     };
     DataTable dt = db.GetDataTable(sql, sqlparam);
     db.Close();
     db.Dispose();
     return dt;
 }
Exemplo n.º 20
0
        public DataTable GetDocbyhyid(string hy_id)
        {
            String sql = " select * from hy_user  ";
            sql += " where hy_id = @hy_id";

            DAO db = new DAO();

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

            DataTable dt = db.GetDataTable(sql, sqlparam);
            db.Close();
            return dt;
        }
Exemplo n.º 21
0
        //����IP���ؽ��������˼���ͶƱ��Ϣ  ls_date:yyyy-MM-dd��ʽ
        public DataTable Getdocsbyip(int id, string ip)
        {
            String sql = " select * from JpVoteIP  ";
            sql += " where id = @id and ip = @ip and convert(char(10),addtime,120)=convert(char(10),getdate(),120) ";

            DAO db = new DAO();

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

            DataTable dt = db.GetDataTable(sql, sqlparam);
            db.Close();
            return dt;
        }
Exemplo n.º 22
0
        //��ȡָ����Ϣ
        public DataTable Getdocbyid(String id)
        {
            String sql = " select a.id,a.fid,a.recName,a.recTel,a.recEmail,a.recTime,a.recContent,a.recip,a.ispub,a.islook, ";
            sql += " b.title,b.content,b.addTime,b.startTime,b.endTime,b.sort,b.by1,b.by2,b.by3,b.by4,b.by5,b.type,b.state,b.online";
            sql += " from JpOpinionHF a,JpOpinion b where a.fid=b.id and a.id = @id ";

            DAO db = new DAO();

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

            DataTable dt = db.GetDataTable(sql, sqlparam);
            db.Close();
            return dt;
        }
Exemplo n.º 23
0
        public Int32 Insert()
        {
            try
            {
                String sql = "INSERT INTO JpNews(cid,kcid,title,subhead,content,authorid,author,status,crtime,modtime,pubtime,hits,GUID)";
                sql += " VALUES(@cid,@kcid,@title,@subhead,@content,@authorid,@author,@status,getdate(),getdate(),getdate(),0,@GUID)";
                GUID = System.Guid.NewGuid().ToString();
                DAO db = new DAO();
                SqlParameter[] prams ={
                db.MakeInParam("@cid",SqlDbType.VarChar,cid),
                db.MakeInParam("@kcid",SqlDbType.VarChar,kcid),
                db.MakeInParam("@title",SqlDbType.VarChar,title),
                db.MakeInParam("@subhead",SqlDbType.VarChar,subhead),
                db.MakeInParam("@content",SqlDbType.VarChar,content),
                db.MakeInParam("@authorid",SqlDbType.VarChar,authorid),
                db.MakeInParam("@author",SqlDbType.VarChar,author),
                db.MakeInParam("@status",SqlDbType.VarChar,status),
                db.MakeInParam("@GUID",SqlDbType.VarChar,GUID),
            };
                db.Execute(sql, prams);

                db.Close();
                sql = "Select aid from JpNews where GUID=@GUID";
                SqlParameter[] prams1 ={
                db.MakeInParam("@GUID",SqlDbType.VarChar,GUID),
            };
                DataTable dt = db.GetDataTable(sql, prams1);
                if (dt.Rows.Count > 0)
                {
                    this.aid = System.Int32.Parse(dt.Rows[0]["aid"].ToString());
                }
                return aid;
            }
            catch
            {
                return -2;
            }
            finally
            {

            }
        }
Exemplo n.º 24
0
 /// <summary>
 /// 获取
 /// </summary>
 /// <param name="keyWord">关键字</param>
 /// <param name="count">数据条数   0为不限条数</param>
 /// <returns></returns>
 public DataTable getData(string keyWord, int count)
 {
     string sqlSelect = "";
     sqlSelect = " select ";
     if (count != 0)
     {
         sqlSelect += " top " + count + "  ";
     }
     sqlSelect += "  * from hy_searchArt where 1=1  ";
     if (keyWord != "")
     {
         sqlSelect += "  and hy_title like '%" + keyWord + "%'  ";
     }
     sqlSelect += " order by addTime desc ";
     DAO db = new DAO();
      DataTable dt = db.GetDataTable(sqlSelect);
       //  DataTable dt = new DataTable();
     db.Close();
     db.Dispose();
     return dt;
 }
Exemplo n.º 25
0
 /// <summary>
 /// ɾ�����
 /// roleids��ʽ��,1111,2222,33333,
 /// </summary>
 /// <returns></returns>
 public bool DeleteAll(string roleids)
 {
     bool ret = true;
     String sql = "delete from JpRole where @hy_roleid like '%,'+hy_roleid+',%'";
     DAO db = new DAO();
     SqlParameter[] prams ={
             db.MakeInParam("@hy_roleid",SqlDbType.VarChar,roleids),
         };
     try
     {
         db.Execute(sql, prams);
     }
     catch
     {
         ret = false;
     }
     finally
     {
         db.Close();
         db.Dispose();
     }
     return ret;
 }
Exemplo n.º 26
0
        //ɾ����ɫ�е���Ա
        public bool Delete(string groupid,string uid)
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                String sql = " delete from JpGroupUser ";
                sql += " where groupid='" + groupid + "'";
                sql += " and uid='" + uid + "'";
                db.Execute(sql);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Exemplo n.º 27
0
        /// <summary>
        /// ɾ������
        /// </summary>
        /// <returns></returns>
        public bool DeleteByDate(String hits_date)
        {
            bool ret = true;

            String sql = "delete from JpHits where hits_date=@hits_date ";
            DAO db = new DAO();
            SqlParameter[] prams ={
                    db.MakeInParam("@hits_date",SqlDbType.VarChar,hits_date),
                };
            try
            {
                db.Execute(sql, prams);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Exemplo n.º 28
0
        /// <summary>
        /// ɾ������
        /// </summary>
        /// <returns></returns>
        public bool Delete()
        {
            bool ret = true;

            String sql = "delete from JpLog where ID=@ID ";
            DAO db = new DAO();
            SqlParameter[] prams ={
                    db.MakeInParam("@ID",SqlDbType.VarChar,ID),
                };
            try
            {
                db.Execute(sql, prams);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Exemplo n.º 29
0
        /// <summary>
        /// ɾ������
        /// </summary>
        /// <returns></returns>
        public bool DeleteById(String id)
        {
            bool ret = true;

            String sql = "delete from JpHits where id=@id ";
            DAO db = new DAO();
            SqlParameter[] prams ={
                    db.MakeInParam("@id",SqlDbType.VarChar,id),
                };
            try
            {
                db.Execute(sql, prams);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Exemplo n.º 30
0
        /// <summary>
        /// ����
        /// </summary>
        /// <returns></returns>
        public DataTable Getlog(String id)
        {
            string cmdStr = "";

            DataTable dt = new DataTable();
            cmdStr = "Select * from JpLog where ID = @ID ";
            DAO db = new DAO();
            SqlParameter[] prams ={
                    db.MakeInParam("@ID",SqlDbType.VarChar,id)
                };
            dt = db.GetDataTable(cmdStr, prams);
            db.Close();
            db.Dispose();
            return dt;
        }