/// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Maticsoft.Model.HIS_MEASURAND_DischargeAmount_Month model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update HIS_MEASURAND_DischargeAmount_Month set ");
            strSql.Append("id=@id,");
            strSql.Append("station_name=@station_name,");
            strSql.Append("YYYY_MM=@YYYY_MM,");
            strSql.Append("CODMn=@CODMn,");
            strSql.Append("NH3_N=@NH3_N,");
            strSql.Append("TP=@TP,");
            strSql.Append("TN=@TN,");
            strSql.Append("flow=@flow");
            strSql.Append(" where ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id",           SqlDbType.BigInt,   8),
                new SqlParameter("@station_name", SqlDbType.VarChar, 50),
                new SqlParameter("@YYYY_MM",      SqlDbType.VarChar,  7),
                new SqlParameter("@CODMn",        SqlDbType.Decimal, 17),
                new SqlParameter("@NH3_N",        SqlDbType.Decimal, 17),
                new SqlParameter("@TP",           SqlDbType.Decimal, 17),
                new SqlParameter("@TN",           SqlDbType.Decimal, 17),
                new SqlParameter("@flow",         SqlDbType.Decimal, 17)
            };
            parameters[0].Value = model.id;
            parameters[1].Value = model.station_name;
            parameters[2].Value = model.YYYY_MM;
            parameters[3].Value = model.CODMn;
            parameters[4].Value = model.NH3_N;
            parameters[5].Value = model.TP;
            parameters[6].Value = model.TN;
            parameters[7].Value = model.flow;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Maticsoft.Model.HIS_MEASURAND_DischargeAmount_Month DataRowToModel(DataRow row)
 {
     Maticsoft.Model.HIS_MEASURAND_DischargeAmount_Month model = new Maticsoft.Model.HIS_MEASURAND_DischargeAmount_Month();
     if (row != null)
     {
         if (row["id"] != null && row["id"].ToString() != "")
         {
             model.id = long.Parse(row["id"].ToString());
         }
         if (row["station_name"] != null)
         {
             model.station_name = row["station_name"].ToString();
         }
         if (row["YYYY_MM"] != null)
         {
             model.YYYY_MM = row["YYYY_MM"].ToString();
         }
         if (row["CODMn"] != null && row["CODMn"].ToString() != "")
         {
             model.CODMn = decimal.Parse(row["CODMn"].ToString());
         }
         if (row["NH3_N"] != null && row["NH3_N"].ToString() != "")
         {
             model.NH3_N = decimal.Parse(row["NH3_N"].ToString());
         }
         if (row["TP"] != null && row["TP"].ToString() != "")
         {
             model.TP = decimal.Parse(row["TP"].ToString());
         }
         if (row["TN"] != null && row["TN"].ToString() != "")
         {
             model.TN = decimal.Parse(row["TN"].ToString());
         }
         if (row["flow"] != null && row["flow"].ToString() != "")
         {
             model.flow = decimal.Parse(row["flow"].ToString());
         }
     }
     return(model);
 }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Maticsoft.Model.HIS_MEASURAND_DischargeAmount_Month model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into HIS_MEASURAND_DischargeAmount_Month(");
            strSql.Append("id,station_name,YYYY_MM,CODMn,NH3_N,TP,TN,flow)");
            strSql.Append(" values (");
            strSql.Append("@id,@station_name,@YYYY_MM,@CODMn,@NH3_N,@TP,@TN,@flow)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id",           SqlDbType.BigInt,   8),
                new SqlParameter("@station_name", SqlDbType.VarChar, 50),
                new SqlParameter("@YYYY_MM",      SqlDbType.VarChar,  7),
                new SqlParameter("@CODMn",        SqlDbType.Decimal, 17),
                new SqlParameter("@NH3_N",        SqlDbType.Decimal, 17),
                new SqlParameter("@TP",           SqlDbType.Decimal, 17),
                new SqlParameter("@TN",           SqlDbType.Decimal, 17),
                new SqlParameter("@flow",         SqlDbType.Decimal, 17)
            };
            parameters[0].Value = model.id;
            parameters[1].Value = model.station_name;
            parameters[2].Value = model.YYYY_MM;
            parameters[3].Value = model.CODMn;
            parameters[4].Value = model.NH3_N;
            parameters[5].Value = model.TP;
            parameters[6].Value = model.TN;
            parameters[7].Value = model.flow;

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

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

            strSql.Append("select  top 1 id,station_name,YYYY_MM,CODMn,NH3_N,TP,TN,flow from HIS_MEASURAND_DischargeAmount_Month ");
            strSql.Append(" where ");
            SqlParameter[] parameters =
            {
            };

            Maticsoft.Model.HIS_MEASURAND_DischargeAmount_Month model = new Maticsoft.Model.HIS_MEASURAND_DischargeAmount_Month();
            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.HIS_MEASURAND_DischargeAmount_Month DataRowToModel(DataRow row)
		{
			Maticsoft.Model.HIS_MEASURAND_DischargeAmount_Month model=new Maticsoft.Model.HIS_MEASURAND_DischargeAmount_Month();
			if (row != null)
			{
				if(row["id"]!=null && row["id"].ToString()!="")
				{
					model.id=long.Parse(row["id"].ToString());
				}
				if(row["station_name"]!=null)
				{
					model.station_name=row["station_name"].ToString();
				}
				if(row["YYYY_MM"]!=null)
				{
					model.YYYY_MM=row["YYYY_MM"].ToString();
				}
				if(row["CODMn"]!=null && row["CODMn"].ToString()!="")
				{
					model.CODMn=decimal.Parse(row["CODMn"].ToString());
				}
				if(row["NH3_N"]!=null && row["NH3_N"].ToString()!="")
				{
					model.NH3_N=decimal.Parse(row["NH3_N"].ToString());
				}
				if(row["TP"]!=null && row["TP"].ToString()!="")
				{
					model.TP=decimal.Parse(row["TP"].ToString());
				}
				if(row["TN"]!=null && row["TN"].ToString()!="")
				{
					model.TN=decimal.Parse(row["TN"].ToString());
				}
				if(row["flow"]!=null && row["flow"].ToString()!="")
				{
					model.flow=decimal.Parse(row["flow"].ToString());
				}
			}
			return model;
		}
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public Maticsoft.Model.HIS_MEASURAND_DischargeAmount_Month GetModel()
		{
			//该表无主键信息,请自定义主键/条件字段
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select  top 1 id,station_name,YYYY_MM,CODMn,NH3_N,TP,TN,flow from HIS_MEASURAND_DischargeAmount_Month ");
			strSql.Append(" where ");
			SqlParameter[] parameters = {
			};

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