/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvFillSea_UpdateSet">UpdateSet用户对象</param> /// <param name="tEnvFillSea_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvFillSeaVo tEnvFillSea_UpdateSet, TEnvFillSeaVo tEnvFillSea_UpdateWhere) { string strSQL = SqlHelper.BuildUpdateExpress(tEnvFillSea_UpdateSet, TEnvFillSeaVo.T_ENV_FILL_SEA_TABLE); strSQL += this.BuildWhereStatement(tEnvFillSea_UpdateWhere); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvFillSea">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvFillSeaVo tEnvFillSea) { string strSQL = SqlHelper.BuildUpdateExpress(tEnvFillSea, TEnvFillSeaVo.T_ENV_FILL_SEA_TABLE); strSQL += string.Format(" where ID='{0}' ", tEnvFillSea.ID); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tEnvFillSea">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TEnvFillSeaVo tEnvFillSea, int iIndex, int iCount) { string strSQL = " select * from T_ENV_FILL_SEA {0} "; strSQL = String.Format(strSQL, BuildWhereStatement(tEnvFillSea)); return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TEnvFillSeaVo tEnvFillSea) { string strSQL = "delete from T_ENV_FILL_SEA "; strSQL += this.BuildWhereStatement(tEnvFillSea); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
private void GetFillID() { string year = Request["year"]; string month = Request["month"]; TEnvFillSeaVo envFillSeaVo = new TEnvFillSeaVo(); envFillSeaVo.YEAR = year; envFillSeaVo.MONTH = month; envFillSeaVo = new TEnvFillSeaLogic().Details(envFillSeaVo); string json = "{\"ID\":\"" + envFillSeaVo.ID + "\",\"STATUS\":\"" + envFillSeaVo.STATUS + "\"}"; Response.ContentType = "application/json;charset=utf-8"; Response.Write(json); Response.End(); }
private string SaveFWData(string save, string filltype, string ID) { bool flag = false; string head = string.Empty; string strResult = string.Empty; if (!string.IsNullOrEmpty(filltype)) { switch (filltype) { case "SeaFill": TEnvFillSeaVo sea = new TEnvFillSeaVo(); sea.ID = GetSerialNumber(SerialType.T_ENV_FILL_SEA); head = sea.ID; flag = new TEnvFillSeaLogic().Create(sea); break; case "DrinkSource": TEnvFillDrinkSrcVo Drink = new TEnvFillDrinkSrcVo(); Drink.ID = GetSerialNumber(SerialType.T_ENV_FILL_DRINK_SRC); head = Drink.ID; flag = new TEnvFillDrinkSrcLogic().Create(Drink); break; case "Payfor": TEnvFillPayforVo payfor = new TEnvFillPayforVo(); payfor.ID = GetSerialNumber(SerialType.T_ENV_FILL_PAYFOR); head = payfor.ID; flag = new TEnvFillPayforLogic().Create(payfor); break; } if (flag == true) { strResult = head; } else { strResult = ""; } } return(strResult); }
/// <summary> /// 对象添加 /// </summary> /// <param name="sysRole">对象</param> /// <returns>是否成功</returns> public bool Create(TEnvFillSeaVo tEnvFillSea) { return(access.Create(tEnvFillSea)); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tEnvFillSea">对象条件</param> /// <returns>对象</returns> public TEnvFillSeaVo Details(TEnvFillSeaVo tEnvFillSea) { string strSQL = String.Format("select * from T_ENV_FILL_SEA " + this.BuildWhereStatement(tEnvFillSea)); return(SqlHelper.ExecuteObject(new TEnvFillSeaVo(), strSQL)); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tEnvFillSea">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TEnvFillSeaVo> SelectByObject(TEnvFillSeaVo tEnvFillSea, int iIndex, int iCount) { string strSQL = String.Format("select * from T_ENV_FILL_SEA " + this.BuildWhereStatement(tEnvFillSea)); return(SqlHelper.ExecuteObjectList(tEnvFillSea, BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tEnvFillSea">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TEnvFillSeaVo tEnvFillSea) { string strSQL = "select Count(*) from T_ENV_FILL_SEA " + this.BuildWhereStatement(tEnvFillSea); return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL))); }
/// <summary> /// 根据对象构造条件语句 /// </summary> /// <param name="tEnvFillSea"></param> /// <returns></returns> public string BuildWhereStatement(TEnvFillSeaVo tEnvFillSea) { StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 "); if (null != tEnvFillSea) { //主键ID if (!String.IsNullOrEmpty(tEnvFillSea.ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND ID = '{0}'", tEnvFillSea.ID.ToString())); } //监测点ID if (!String.IsNullOrEmpty(tEnvFillSea.POINT_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND POINT_ID = '{0}'", tEnvFillSea.POINT_ID.ToString())); } //采样日期 if (!String.IsNullOrEmpty(tEnvFillSea.SAMPLING_DAY.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SAMPLING_DAY = '{0}'", tEnvFillSea.SAMPLING_DAY.ToString())); } //年度 if (!String.IsNullOrEmpty(tEnvFillSea.YEAR.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND YEAR = '{0}'", tEnvFillSea.YEAR.ToString())); } //月份 if (!String.IsNullOrEmpty(tEnvFillSea.MONTH.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND MONTH = '{0}'", tEnvFillSea.MONTH.ToString())); } //日 if (!String.IsNullOrEmpty(tEnvFillSea.DAY.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND DAY = '{0}'", tEnvFillSea.DAY.ToString())); } //时 if (!String.IsNullOrEmpty(tEnvFillSea.HOUR.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND HOUR = '{0}'", tEnvFillSea.HOUR.ToString())); } //分 if (!String.IsNullOrEmpty(tEnvFillSea.MINUTE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND MINUTE = '{0}'", tEnvFillSea.MINUTE.ToString())); } //水深 if (!String.IsNullOrEmpty(tEnvFillSea.DEPTH.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND DEPTH = '{0}'", tEnvFillSea.DEPTH.ToString())); } //海区代码 if (!String.IsNullOrEmpty(tEnvFillSea.SEA_AREA_CODE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SEA_AREA_CODE = '{0}'", tEnvFillSea.SEA_AREA_CODE.ToString())); } //重点海域代码 if (!String.IsNullOrEmpty(tEnvFillSea.KEY_AREA_CODE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND KEY_AREA_CODE = '{0}'", tEnvFillSea.KEY_AREA_CODE.ToString())); } //枯水期、平水期、枯水期 if (!String.IsNullOrEmpty(tEnvFillSea.KPF.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND KPF = '{0}'", tEnvFillSea.KPF.ToString())); } //层次 if (!String.IsNullOrEmpty(tEnvFillSea.LEVEL.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LEVEL = '{0}'", tEnvFillSea.LEVEL.ToString())); } //评价 if (!String.IsNullOrEmpty(tEnvFillSea.JUDGE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND JUDGE = '{0}'", tEnvFillSea.JUDGE.ToString())); } //超标污染物 if (!String.IsNullOrEmpty(tEnvFillSea.OVERPROOF.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND OVERPROOF = '{0}'", tEnvFillSea.OVERPROOF.ToString())); } //备注1 if (!String.IsNullOrEmpty(tEnvFillSea.REMARK1.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK1 = '{0}'", tEnvFillSea.REMARK1.ToString())); } //备注2 if (!String.IsNullOrEmpty(tEnvFillSea.REMARK2.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK2 = '{0}'", tEnvFillSea.REMARK2.ToString())); } //备注3 if (!String.IsNullOrEmpty(tEnvFillSea.REMARK3.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK3 = '{0}'", tEnvFillSea.REMARK3.ToString())); } //备注4 if (!String.IsNullOrEmpty(tEnvFillSea.REMARK4.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK4 = '{0}'", tEnvFillSea.REMARK4.ToString())); } //备注5 if (!String.IsNullOrEmpty(tEnvFillSea.REMARK5.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK5 = '{0}'", tEnvFillSea.REMARK5.ToString())); } } return(strWhereStatement.ToString()); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tEnvFillSea">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TEnvFillSeaVo tEnvFillSea) { return(access.GetSelectResultCount(tEnvFillSea)); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvFillSea">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvFillSeaVo tEnvFillSea) { return(access.Edit(tEnvFillSea)); }
/// <summary> /// 对象添加 /// </summary> /// <param name="tEnvFillSea">对象</param> /// <returns>是否成功</returns> public bool Create(TEnvFillSeaVo tEnvFillSea) { string strSQL = SqlHelper.BuildInsertExpress(tEnvFillSea, TEnvFillSeaVo.T_ENV_FILL_SEA_TABLE); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TEnvFillSeaVo tEnvFillSea) { return(access.Delete(tEnvFillSea)); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tEnvFillSea"></param> /// <returns></returns> public DataTable SelectByTable(TEnvFillSeaVo tEnvFillSea) { return(access.SelectByTable(tEnvFillSea)); }
/// <summary> /// 根据对象特征获取单一对象 /// </summary> /// <param name="tEnvFillSea">对象</param> /// <returns></returns> public TEnvFillSeaVo SelectByObject(TEnvFillSeaVo tEnvFillSea) { return(access.SelectByObject(tEnvFillSea)); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tEnvFillSea">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TEnvFillSeaVo tEnvFillSea, int iIndex, int iCount) { return(access.SelectByTable(tEnvFillSea, iIndex, iCount)); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tEnvFillSea">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TEnvFillSeaVo> SelectByObject(TEnvFillSeaVo tEnvFillSea, int iIndex, int iCount) { return(access.SelectByObject(tEnvFillSea, iIndex, iCount)); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tEnvFillSea">对象条件</param> /// <returns>对象</returns> public TEnvFillSeaVo Details(TEnvFillSeaVo tEnvFillSea) { return(access.Details(tEnvFillSea)); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tEnvFillSea"></param> /// <returns></returns> public DataTable SelectByTable(TEnvFillSeaVo tEnvFillSea) { string strSQL = "select * from T_ENV_FILL_SEA " + this.BuildWhereStatement(tEnvFillSea); return(SqlHelper.ExecuteDataTable(strSQL)); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvFillSea_UpdateSet">UpdateSet用户对象</param> /// <param name="tEnvFillSea_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvFillSeaVo tEnvFillSea_UpdateSet, TEnvFillSeaVo tEnvFillSea_UpdateWhere) { return(access.Edit(tEnvFillSea_UpdateSet, tEnvFillSea_UpdateWhere)); }
/// <summary> /// 根据对象特征获取单一对象 /// </summary> /// <param name="tEnvFillSea">对象</param> /// <returns></returns> public TEnvFillSeaVo SelectByObject(TEnvFillSeaVo tEnvFillSea) { string strSQL = "select * from T_ENV_FILL_SEA " + this.BuildWhereStatement(tEnvFillSea); return(SqlHelper.ExecuteObject(new TEnvFillSeaVo(), strSQL)); }
public TEnvFillSeaLogic(TEnvFillSeaVo _tEnvFillSea) { tEnvFillSea = _tEnvFillSea; access = new TEnvFillSeaAccess(); }