/// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012 model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into MEASURAND_PREDICT_SECTION_2012(");
            strSql.Append("TT,II,COD,NH4,TN,TP)");
            strSql.Append(" values (");
            strSql.Append("@TT,@II,@COD,@NH4,@TN,@TP)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@TT",  SqlDbType.Int,     4),
                new SqlParameter("@II",  SqlDbType.Int,     4),
                new SqlParameter("@COD", SqlDbType.Decimal, 9),
                new SqlParameter("@NH4", SqlDbType.Decimal, 9),
                new SqlParameter("@TN",  SqlDbType.Decimal, 9),
                new SqlParameter("@TP",  SqlDbType.Decimal, 9)
            };
            parameters[0].Value = model.TT;
            parameters[1].Value = model.II;
            parameters[2].Value = model.COD;
            parameters[3].Value = model.NH4;
            parameters[4].Value = model.TN;
            parameters[5].Value = model.TP;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012 DataRowToModel(DataRow row)
 {
     Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012 model = new Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012();
     if (row != null)
     {
         if (row["TT"] != null && row["TT"].ToString() != "")
         {
             model.TT = int.Parse(row["TT"].ToString());
         }
         if (row["II"] != null && row["II"].ToString() != "")
         {
             model.II = int.Parse(row["II"].ToString());
         }
         if (row["COD"] != null && row["COD"].ToString() != "")
         {
             model.COD = decimal.Parse(row["COD"].ToString());
         }
         if (row["NH4"] != null && row["NH4"].ToString() != "")
         {
             model.NH4 = decimal.Parse(row["NH4"].ToString());
         }
         if (row["TN"] != null && row["TN"].ToString() != "")
         {
             model.TN = decimal.Parse(row["TN"].ToString());
         }
         if (row["TP"] != null && row["TP"].ToString() != "")
         {
             model.TP = decimal.Parse(row["TP"].ToString());
         }
     }
     return(model);
 }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012 model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update MEASURAND_PREDICT_SECTION_2012 set ");
            strSql.Append("TT=@TT,");
            strSql.Append("II=@II,");
            strSql.Append("COD=@COD,");
            strSql.Append("NH4=@NH4,");
            strSql.Append("TN=@TN,");
            strSql.Append("TP=@TP");
            strSql.Append(" where ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@TT",  SqlDbType.Int,     4),
                new SqlParameter("@II",  SqlDbType.Int,     4),
                new SqlParameter("@COD", SqlDbType.Decimal, 9),
                new SqlParameter("@NH4", SqlDbType.Decimal, 9),
                new SqlParameter("@TN",  SqlDbType.Decimal, 9),
                new SqlParameter("@TP",  SqlDbType.Decimal, 9)
            };
            parameters[0].Value = model.TT;
            parameters[1].Value = model.II;
            parameters[2].Value = model.COD;
            parameters[3].Value = model.NH4;
            parameters[4].Value = model.TN;
            parameters[5].Value = model.TP;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012 GetModel()
        {
            //该表无主键信息,请自定义主键/条件字段
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 TT,II,COD,NH4,TN,TP from MEASURAND_PREDICT_SECTION_2012 ");
            strSql.Append(" where ");
            SqlParameter[] parameters =
            {
            };

            Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012 model = new Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012 DataRowToModel(DataRow row)
		{
			Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012 model=new Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012();
			if (row != null)
			{
				if(row["TT"]!=null && row["TT"].ToString()!="")
				{
					model.TT=int.Parse(row["TT"].ToString());
				}
				if(row["II"]!=null && row["II"].ToString()!="")
				{
					model.II=int.Parse(row["II"].ToString());
				}
				if(row["COD"]!=null && row["COD"].ToString()!="")
				{
					model.COD=decimal.Parse(row["COD"].ToString());
				}
				if(row["NH4"]!=null && row["NH4"].ToString()!="")
				{
					model.NH4=decimal.Parse(row["NH4"].ToString());
				}
				if(row["TN"]!=null && row["TN"].ToString()!="")
				{
					model.TN=decimal.Parse(row["TN"].ToString());
				}
				if(row["TP"]!=null && row["TP"].ToString()!="")
				{
					model.TP=decimal.Parse(row["TP"].ToString());
				}
			}
			return model;
		}
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012 GetModel()
		{
			//该表无主键信息,请自定义主键/条件字段
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select  top 1 TT,II,COD,NH4,TN,TP from MEASURAND_PREDICT_SECTION_2012 ");
			strSql.Append(" where ");
			SqlParameter[] parameters = {
			};

			Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012 model=new Maticsoft.Model.MEASURAND_PREDICT_SECTION_2012();
			DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
			if(ds.Tables[0].Rows.Count>0)
			{
				return DataRowToModel(ds.Tables[0].Rows[0]);
			}
			else
			{
				return null;
			}
		}