/// <summary>
		/// 增加一条数据
		/// </summary>
		public bool Add(KiwiCrawler.Model.Extractionconfig_k model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into extractionconfig_k(");
			strSql.Append("KId,KUrl,KTitle,KPublishDateTime,KContent,KAddressBusinessType,KKeyword,KPercent)");
			strSql.Append(" values (");
			strSql.Append("@KId,@KUrl,@KTitle,@KPublishDateTime,@KContent,@KAddressBusinessType,@KKeyword,@KPercent)");
			MySqlParameter[] parameters = {
					new MySqlParameter("@KId", MySqlDbType.Int32,11),
					new MySqlParameter("@KUrl", MySqlDbType.Text),
					new MySqlParameter("@KTitle", MySqlDbType.Text),
					new MySqlParameter("@KPublishDateTime", MySqlDbType.DateTime),
					new MySqlParameter("@KContent", MySqlDbType.Text),
					new MySqlParameter("@KAddressBusinessType", MySqlDbType.Text),
					new MySqlParameter("@KKeyword", MySqlDbType.Text),
					new MySqlParameter("@KPercent", MySqlDbType.Float)};
			parameters[0].Value = model.KId;
			parameters[1].Value = model.KUrl;
			parameters[2].Value = model.KTitle;
			parameters[3].Value = model.KPublishDateTime;
			parameters[4].Value = model.KContent;
			parameters[5].Value = model.KAddressBusinessType;
			parameters[6].Value = model.KKeyword;
			parameters[7].Value = model.KPercent;

			int rows=DbHelperMySQL.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public bool Add(KiwiCrawler.Model.Extractdata_k model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into extractdata_k(");
			strSql.Append("kUrl,kPublishDateTime,kContent,kAddress,kType,kCaptureDateTime)");
			strSql.Append(" values (");
			strSql.Append("@kUrl,@kPublishDateTime,@kContent,@kAddress,@kType,@kCaptureDateTime)");
			MySqlParameter[] parameters = {
					new MySqlParameter("@kUrl", MySqlDbType.Text),
					new MySqlParameter("@kPublishDateTime", MySqlDbType.DateTime),
					new MySqlParameter("@kContent", MySqlDbType.Text),
					new MySqlParameter("@kAddress", MySqlDbType.Text),
					new MySqlParameter("@kType", MySqlDbType.VarChar,255),
					new MySqlParameter("@kCaptureDateTime", MySqlDbType.DateTime)};
			parameters[0].Value = model.kUrl;
			parameters[1].Value = model.kPublishDateTime;
			parameters[2].Value = model.kContent;
			parameters[3].Value = model.kAddress;
			parameters[4].Value = model.kType;
			parameters[5].Value = model.kCaptureDateTime;

			int rows=DbHelperMySQL.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public bool Add(KiwiCrawler.Model.Deletedrecord_k model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into deletedrecord_k(");
			strSql.Append("kId,kCapturedataId,kDeleteDatetime,kNotes)");
			strSql.Append(" values (");
			strSql.Append("@kId,@kCapturedataId,@kDeleteDatetime,@kNotes)");
			MySqlParameter[] parameters = {
					new MySqlParameter("@kId", MySqlDbType.Int32,11),
					new MySqlParameter("@kCapturedataId", MySqlDbType.Int32,11),
					new MySqlParameter("@kDeleteDatetime", MySqlDbType.DateTime),
					new MySqlParameter("@kNotes", MySqlDbType.Text)};
			parameters[0].Value = model.kId;
			parameters[1].Value = model.kCapturedataId;
			parameters[2].Value = model.kDeleteDatetime;
			parameters[3].Value = model.kNotes;

			int rows=DbHelperMySQL.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(KiwiCrawler.Model.Deletedrecord_k model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update deletedrecord_k set ");
			strSql.Append("kCapturedataId=@kCapturedataId,");
			strSql.Append("kDeleteDatetime=@kDeleteDatetime,");
			strSql.Append("kNotes=@kNotes");
			strSql.Append(" where kId=@kId ");
			MySqlParameter[] parameters = {
					new MySqlParameter("@kCapturedataId", MySqlDbType.Int32,11),
					new MySqlParameter("@kDeleteDatetime", MySqlDbType.DateTime),
					new MySqlParameter("@kNotes", MySqlDbType.Text),
					new MySqlParameter("@kId", MySqlDbType.Int32,11)};
			parameters[0].Value = model.kCapturedataId;
			parameters[1].Value = model.kDeleteDatetime;
			parameters[2].Value = model.kNotes;
			parameters[3].Value = model.kId;

			int rows=DbHelperMySQL.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(KiwiCrawler.Model.Urlconfigs_k model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("insert into urlconfigs_k(");
     strSql.Append("kUrl,kPageTotal,kCaptureType,kDetailPattern,kDetailPatternType,kNextPagePattern,kNextPagePatternType,kComplateDegree,kAddressBusinessType,kKeyWords,kNotes)");
     strSql.Append(" values (");
     strSql.Append("@kUrl,@kPageTotal,@kCaptureType,@kDetailPattern,@kDetailPatternType,@kNextPagePattern,@kNextPagePatternType,@kComplateDegree,@kAddressBusinessType,@kKeyWords,@kNotes)");
     MySqlParameter[] parameters = {
             new MySqlParameter("@kUrl", MySqlDbType.Text),
             new MySqlParameter("@kPageTotal", MySqlDbType.Int32,11),
             new MySqlParameter("@kCaptureType", MySqlDbType.Text),
             new MySqlParameter("@kDetailPattern", MySqlDbType.Text),
             new MySqlParameter("@kDetailPatternType", MySqlDbType.VarChar,255),
             new MySqlParameter("@kNextPagePattern", MySqlDbType.Text),
             new MySqlParameter("@kNextPagePatternType", MySqlDbType.VarChar,255),
             new MySqlParameter("@kComplateDegree", MySqlDbType.Float),
             new MySqlParameter("@kAddressBusinessType", MySqlDbType.Text),
             new MySqlParameter("@kKeyWords", MySqlDbType.Text),
             new MySqlParameter("@kNotes", MySqlDbType.VarChar, 255)};
     parameters[0].Value = model.kUrl;
     parameters[1].Value = model.kPageTotal;
     parameters[2].Value = model.kCaptureType;
     parameters[3].Value = model.kDetailPattern;
     parameters[4].Value = model.kDetailPatternType;
     parameters[5].Value = model.kNextPagePattern;
     parameters[6].Value = model.kNextPagePatternType;
     parameters[7].Value = model.kComplateDegree;
     parameters[8].Value = model.kAddressBusinessType;
     parameters[9].Value = model.kKeyWords;
     parameters[10].Value = model.kNotes;
     int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);
     if (rows > 0)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(KiwiCrawler.Model.Extractdata_k model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update extractdata_k set ");
			strSql.Append("kUrl=@kUrl,");
			strSql.Append("kPublishDateTime=@kPublishDateTime,");
			strSql.Append("kContent=@kContent,");
			strSql.Append("kAddress=@kAddress,");
			strSql.Append("kType=@kType,");
			strSql.Append("kCaptureDateTime=@kCaptureDateTime");
			strSql.Append(" where kId=@kId");
			MySqlParameter[] parameters = {
					new MySqlParameter("@kUrl", MySqlDbType.Text),
					new MySqlParameter("@kPublishDateTime", MySqlDbType.DateTime),
					new MySqlParameter("@kContent", MySqlDbType.Text),
					new MySqlParameter("@kAddress", MySqlDbType.Text),
					new MySqlParameter("@kType", MySqlDbType.VarChar,255),
					new MySqlParameter("@kCaptureDateTime", MySqlDbType.DateTime),
					new MySqlParameter("@kId", MySqlDbType.Int32,11)};
			parameters[0].Value = model.kUrl;
			parameters[1].Value = model.kPublishDateTime;
			parameters[2].Value = model.kContent;
			parameters[3].Value = model.kAddress;
			parameters[4].Value = model.kType;
			parameters[5].Value = model.kCaptureDateTime;
			parameters[6].Value = model.kId;

			int rows=DbHelperMySQL.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(KiwiCrawler.Model.Extractdata_k model)
		{
			return dal.Update(model);
		}
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public bool Add(KiwiCrawler.Model.Extractdata_k model)
		{
			return dal.Add(model);
		}
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(KiwiCrawler.Model.Deletedrecord_k model)
		{
			return dal.Update(model);
		}
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public bool Add(KiwiCrawler.Model.Deletedrecord_k model)
		{
			return dal.Add(model);
		}
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(KiwiCrawler.Model.Urlconfigs_k model)
		{
			return dal.Update(model);
		}
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public bool Add(KiwiCrawler.Model.Urlconfigs_k model)
		{
			return dal.Add(model);
		}      
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod
        #region  ExtensionMethod
        /// <summary>
        /// 添加一条信息,返回添加数据的主键
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddBringId(KiwiCrawler.Model.Urlconfigs_k model)
        {
            return dal.AddBringId(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(KiwiCrawler.Model.Urlconfigs_k model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update urlconfigs_k set ");
            strSql.Append("kUrl=@kUrl,");
            strSql.Append("kPageTotal=@kPageTotal,");
            strSql.Append("kCaptureType=@kCaptureType,");
            strSql.Append("kDetailPattern=@kDetailPattern,");
            strSql.Append("kDetailPatternType=@kDetailPatternType,");
            strSql.Append("kNextPagePattern=@kNextPagePattern,");
            strSql.Append("kNextPagePatternType=@kNextPagePatternType,");
            strSql.Append("kComplateDegree=@kComplateDegree,");
            strSql.Append("kAddressBusinessType=@kAddressBusinessType,");
            strSql.Append("kKeyWords=@kKeyWords,");
            strSql.Append("kNotes=@kNotes");
            strSql.Append(" where kId=@kId");
            MySqlParameter[] parameters = {
                    new MySqlParameter("@kUrl", MySqlDbType.Text),
                    new MySqlParameter("@kPageTotal", MySqlDbType.Int32,11),
                    new MySqlParameter("@kCaptureType", MySqlDbType.Text),
                    new MySqlParameter("@kDetailPattern", MySqlDbType.Text),
                    new MySqlParameter("@kDetailPatternType", MySqlDbType.VarChar,255),
                    new MySqlParameter("@kNextPagePattern", MySqlDbType.Text),
                    new MySqlParameter("@kNextPagePatternType", MySqlDbType.VarChar,255),
                    new MySqlParameter("@kComplateDegree", MySqlDbType.Float),
                    new MySqlParameter("@kAddressBusinessType", MySqlDbType.Text),
                    new MySqlParameter("@kKeyWords", MySqlDbType.Text),
                    new MySqlParameter("@kNotes", MySqlDbType.VarChar, 255),
                    new MySqlParameter("@kId", MySqlDbType.Int32,11)};
          
            parameters[0].Value = model.kUrl;
            parameters[1].Value = model.kPageTotal;
            parameters[2].Value = model.kCaptureType;
            parameters[3].Value = model.kDetailPattern;
            parameters[4].Value = model.kDetailPatternType;
            parameters[5].Value = model.kNextPagePattern;
            parameters[6].Value = model.kNextPagePatternType;
            parameters[7].Value = model.kComplateDegree;
            parameters[8].Value = model.kAddressBusinessType;
            parameters[9].Value = model.kKeyWords;
            parameters[10].Value = model.kNotes;
            parameters[11].Value = model.kId;

            int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        /*
		/// <summary>
		/// 分页获取数据列表
		/// </summary>
		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
		{
			MySqlParameter[] parameters = {
					new MySqlParameter("@tblName", MySqlDbType.VarChar, 255),
					new MySqlParameter("@fldName", MySqlDbType.VarChar, 255),
					new MySqlParameter("@PageSize", MySqlDbType.Int32),
					new MySqlParameter("@PageIndex", MySqlDbType.Int32),
					new MySqlParameter("@IsReCount", MySqlDbType.Bit),
					new MySqlParameter("@OrderType", MySqlDbType.Bit),
					new MySqlParameter("@strWhere", MySqlDbType.VarChar,1000),
					};
			parameters[0].Value = "urlconfigs_k";
			parameters[1].Value = "kId";
			parameters[2].Value = PageSize;
			parameters[3].Value = PageIndex;
			parameters[4].Value = 0;
			parameters[5].Value = 0;
			parameters[6].Value = strWhere;	
			return DbHelperMySQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
		}*/

        #endregion  BasicMethod
        #region  ExtensionMethod
        public int AddBringId(KiwiCrawler.Model.Urlconfigs_k model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into urlconfigs_k(");
            strSql.Append("kUrl,kPageTotal,kCaptureType,kDetailPattern,kDetailPatternType,kNextPagePattern,kNextPagePatternType,kComplateDegree,kAddressBusinessType,kKeyWords,kNotes)");
            strSql.Append(" output inserted.kId");
            strSql.Append(" values (");
            strSql.Append("@kUrl,@kPageTotal,@kCaptureType,@kDetailPattern,@kDetailPatternType,@kNextPagePattern,@kNextPagePatternType,@kComplateDegree,@kAddressBusinessType,@kKeyWords,@kNotes)");
            MySqlParameter[] parameters = {
                    new MySqlParameter("@kUrl", MySqlDbType.Text),
                    new MySqlParameter("@kPageTotal", MySqlDbType.Int32,11),
                    new MySqlParameter("@kCaptureType", MySqlDbType.Text),
                    new MySqlParameter("@kDetailPattern", MySqlDbType.Text),
                    new MySqlParameter("@kDetailPatternType", MySqlDbType.VarChar,255),
                    new MySqlParameter("@kNextPagePattern", MySqlDbType.Text),
                    new MySqlParameter("@kNextPagePatternType", MySqlDbType.VarChar,255),
                    new MySqlParameter("@kComplateDegree", MySqlDbType.Float),
                    new MySqlParameter("@kAddressBusinessType", MySqlDbType.Text),
                    new MySqlParameter("@kKeyWords", MySqlDbType.Text),
                    new MySqlParameter("@kNotes", MySqlDbType.VarChar, 255)};
            parameters[0].Value = model.kUrl;
            parameters[1].Value = model.kPageTotal;
            parameters[2].Value = model.kCaptureType;
            parameters[3].Value = model.kDetailPattern;
            parameters[4].Value = model.kDetailPatternType;
            parameters[5].Value = model.kNextPagePattern;
            parameters[6].Value = model.kNextPagePatternType;
            parameters[7].Value = model.kComplateDegree;
            parameters[8].Value = model.kAddressBusinessType;
            parameters[9].Value = model.kKeyWords;
            parameters[10].Value = model.kNotes;
            int id =Convert.ToInt32(DbHelperMySQL.GetSingle(strSql.ToString(), parameters));
            return id;
      
        }
Exemplo n.º 16
0
 public frmEdit(KiwiCrawler.Model.Urlconfigs_k model)
     : this()
 {
     editFrmModel = new KiwiCrawler.Model.Urlconfigs_k();
     editFrmModel = model;
 }