/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvFillAir30">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvFillAir30Vo tEnvFillAir30) { string strSQL = SqlHelper.BuildUpdateExpress(tEnvFillAir30, TEnvFillAir30Vo.T_ENV_FILL_AIR30_TABLE); strSQL += string.Format(" where ID='{0}' ", tEnvFillAir30.ID); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvFillAir30_UpdateSet">UpdateSet用户对象</param> /// <param name="tEnvFillAir30_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvFillAir30Vo tEnvFillAir30_UpdateSet, TEnvFillAir30Vo tEnvFillAir30_UpdateWhere) { string strSQL = SqlHelper.BuildUpdateExpress(tEnvFillAir30_UpdateSet, TEnvFillAir30Vo.T_ENV_FILL_AIR30_TABLE); strSQL += this.BuildWhereStatement(tEnvFillAir30_UpdateWhere); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tEnvFillAir30">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TEnvFillAir30Vo tEnvFillAir30, int iIndex, int iCount) { string strSQL = " select * from T_ENV_FILL_AIR30 {0} "; strSQL = String.Format(strSQL, BuildWhereStatement(tEnvFillAir30)); return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TEnvFillAir30Vo tEnvFillAir30) { string strSQL = "delete from T_ENV_FILL_AIR30 "; strSQL += this.BuildWhereStatement(tEnvFillAir30); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
private void GetFillID() { string year = Request["year"]; string month = Request["month"]; TEnvFillAir30Vo envFillAir30Vo = new TEnvFillAir30Vo(); envFillAir30Vo.YEAR = year; envFillAir30Vo.MONTH = month; envFillAir30Vo = new TEnvFillAir30Logic().Details(envFillAir30Vo); string json = "{\"ID\":\"" + envFillAir30Vo.ID + "\",\"STATUS\":\"" + envFillAir30Vo.STATUS + "\"}"; Response.ContentType = "application/json;charset=utf-8"; Response.Write(json); Response.End(); }
/// <summary> /// 对象添加 /// </summary> /// <param name="tEnvFillAir30">对象</param> /// <returns>是否成功</returns> public bool Create(TEnvFillAir30Vo tEnvFillAir30) { string strSQL = SqlHelper.BuildInsertExpress(tEnvFillAir30, TEnvFillAir30Vo.T_ENV_FILL_AIR30_TABLE); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 根据对象特征获取单一对象 /// </summary> /// <param name="tEnvFillAir30">对象</param> /// <returns></returns> public TEnvFillAir30Vo SelectByObject(TEnvFillAir30Vo tEnvFillAir30) { return(access.SelectByObject(tEnvFillAir30)); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tEnvFillAir30">对象条件</param> /// <returns>对象</returns> public TEnvFillAir30Vo Details(TEnvFillAir30Vo tEnvFillAir30) { string strSQL = String.Format("select * from T_ENV_FILL_AIR30 " + this.BuildWhereStatement(tEnvFillAir30)); return(SqlHelper.ExecuteObject(new TEnvFillAir30Vo(), strSQL)); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tEnvFillAir30">对象条件</param> /// <returns>对象</returns> public TEnvFillAir30Vo Details(TEnvFillAir30Vo tEnvFillAir30) { return(access.Details(tEnvFillAir30)); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tEnvFillAir30">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TEnvFillAir30Vo tEnvFillAir30) { return(access.GetSelectResultCount(tEnvFillAir30)); }
public TEnvFillAir30Logic(TEnvFillAir30Vo _tEnvFillAir30) { tEnvFillAir30 = _tEnvFillAir30; access = new TEnvFillAir30Access(); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TEnvFillAir30Vo tEnvFillAir30) { return(access.Delete(tEnvFillAir30)); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvFillAir30_UpdateSet">UpdateSet用户对象</param> /// <param name="tEnvFillAir30_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvFillAir30Vo tEnvFillAir30_UpdateSet, TEnvFillAir30Vo tEnvFillAir30_UpdateWhere) { return(access.Edit(tEnvFillAir30_UpdateSet, tEnvFillAir30_UpdateWhere)); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvFillAir30">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvFillAir30Vo tEnvFillAir30) { return(access.Edit(tEnvFillAir30)); }
/// <summary> /// 对象添加 /// </summary> /// <param name="sysRole">对象</param> /// <returns>是否成功</returns> public bool Create(TEnvFillAir30Vo tEnvFillAir30) { return(access.Create(tEnvFillAir30)); }
/// <summary> /// 根据对象构造条件语句 /// </summary> /// <param name="tEnvFillAir30"></param> /// <returns></returns> public string BuildWhereStatement(TEnvFillAir30Vo tEnvFillAir30) { StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 "); if (null != tEnvFillAir30) { //主键ID if (!String.IsNullOrEmpty(tEnvFillAir30.ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND ID = '{0}'", tEnvFillAir30.ID.ToString())); } //监测点ID if (!String.IsNullOrEmpty(tEnvFillAir30.POINT_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND POINT_ID = '{0}'", tEnvFillAir30.POINT_ID.ToString())); } //年度 if (!String.IsNullOrEmpty(tEnvFillAir30.YEAR.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND YEAR = '{0}'", tEnvFillAir30.YEAR.ToString())); } //月 if (!String.IsNullOrEmpty(tEnvFillAir30.MONTH.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND MONTH = '{0}'", tEnvFillAir30.MONTH.ToString())); } //日 if (!String.IsNullOrEmpty(tEnvFillAir30.DAY.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND DAY = '{0}'", tEnvFillAir30.DAY.ToString())); } //周 if (!String.IsNullOrEmpty(tEnvFillAir30.WEEK.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND WEEK = '{0}'", tEnvFillAir30.WEEK.ToString())); } //测点号 if (!String.IsNullOrEmpty(tEnvFillAir30.POINT_NUM.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND POINT_NUM = '{0}'", tEnvFillAir30.POINT_NUM.ToString())); } //测点名称 if (!String.IsNullOrEmpty(tEnvFillAir30.POINT_NAME.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND POINT_NAME = '{0}'", tEnvFillAir30.POINT_NAME.ToString())); } //气温 if (!String.IsNullOrEmpty(tEnvFillAir30.TEMPERATRUE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND TEMPERATRUE = '{0}'", tEnvFillAir30.TEMPERATRUE.ToString())); } //气压 if (!String.IsNullOrEmpty(tEnvFillAir30.PRESSURE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND PRESSURE = '{0}'", tEnvFillAir30.PRESSURE.ToString())); } //风速 if (!String.IsNullOrEmpty(tEnvFillAir30.WIND_SPEED.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND WIND_SPEED = '{0}'", tEnvFillAir30.WIND_SPEED.ToString())); } //风向 if (!String.IsNullOrEmpty(tEnvFillAir30.WIND_DIRECTION.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND WIND_DIRECTION = '{0}'", tEnvFillAir30.WIND_DIRECTION.ToString())); } //API指数 if (!String.IsNullOrEmpty(tEnvFillAir30.API_CODE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND API_CODE = '{0}'", tEnvFillAir30.API_CODE.ToString())); } //空气质量指数 if (!String.IsNullOrEmpty(tEnvFillAir30.AQI_CODE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND AQI_CODE = '{0}'", tEnvFillAir30.AQI_CODE.ToString())); } //空气级别 if (!String.IsNullOrEmpty(tEnvFillAir30.AIR_LEVEL.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND AIR_LEVEL = '{0}'", tEnvFillAir30.AIR_LEVEL.ToString())); } //空气质量状况 if (!String.IsNullOrEmpty(tEnvFillAir30.AIR_STATE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND AIR_STATE = '{0}'", tEnvFillAir30.AIR_STATE.ToString())); } //主要污染物 if (!String.IsNullOrEmpty(tEnvFillAir30.MAIN_AIR.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND MAIN_AIR = '{0}'", tEnvFillAir30.MAIN_AIR.ToString())); } //备注1 if (!String.IsNullOrEmpty(tEnvFillAir30.REMARK1.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK1 = '{0}'", tEnvFillAir30.REMARK1.ToString())); } //备注2 if (!String.IsNullOrEmpty(tEnvFillAir30.REMARK2.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK2 = '{0}'", tEnvFillAir30.REMARK2.ToString())); } //备注3 if (!String.IsNullOrEmpty(tEnvFillAir30.REMARK3.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK3 = '{0}'", tEnvFillAir30.REMARK3.ToString())); } //备注4 if (!String.IsNullOrEmpty(tEnvFillAir30.REMARK4.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK4 = '{0}'", tEnvFillAir30.REMARK4.ToString())); } //备注5 if (!String.IsNullOrEmpty(tEnvFillAir30.REMARK5.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK5 = '{0}'", tEnvFillAir30.REMARK5.ToString())); } } return(strWhereStatement.ToString()); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tEnvFillAir30">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TEnvFillAir30Vo tEnvFillAir30) { string strSQL = "select Count(*) from T_ENV_FILL_AIR30 " + this.BuildWhereStatement(tEnvFillAir30); return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL))); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tEnvFillAir30">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TEnvFillAir30Vo> SelectByObject(TEnvFillAir30Vo tEnvFillAir30, int iIndex, int iCount) { return(access.SelectByObject(tEnvFillAir30, iIndex, iCount)); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tEnvFillAir30">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TEnvFillAir30Vo> SelectByObject(TEnvFillAir30Vo tEnvFillAir30, int iIndex, int iCount) { string strSQL = String.Format("select * from T_ENV_FILL_AIR30 " + this.BuildWhereStatement(tEnvFillAir30)); return(SqlHelper.ExecuteObjectList(tEnvFillAir30, BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tEnvFillAir30">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TEnvFillAir30Vo tEnvFillAir30, int iIndex, int iCount) { return(access.SelectByTable(tEnvFillAir30, iIndex, iCount)); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tEnvFillAir30"></param> /// <returns></returns> public DataTable SelectByTable(TEnvFillAir30Vo tEnvFillAir30) { string strSQL = "select * from T_ENV_FILL_AIR30 " + this.BuildWhereStatement(tEnvFillAir30); return(SqlHelper.ExecuteDataTable(strSQL)); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tEnvFillAir30"></param> /// <returns></returns> public DataTable SelectByTable(TEnvFillAir30Vo tEnvFillAir30) { return(access.SelectByTable(tEnvFillAir30)); }