/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tEnvPLake">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TEnvPLakeVo tEnvPLake, int iIndex, int iCount) { string strSQL = " select * from T_ENV_P_LAKE {0} order by YEAR desc,len(MONTH) desc,MONTH desc "; strSQL = String.Format(strSQL, BuildWhereStatement(tEnvPLake)); return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvPLake_UpdateSet">UpdateSet用户对象</param> /// <param name="tEnvPLake_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvPLakeVo tEnvPLake_UpdateSet, TEnvPLakeVo tEnvPLake_UpdateWhere) { string strSQL = SqlHelper.BuildUpdateExpress(tEnvPLake_UpdateSet, TEnvPLakeVo.T_ENV_P_LAKE_TABLE); strSQL += this.BuildWhereStatement(tEnvPLake_UpdateWhere); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 增加数据 /// </summary> /// <returns></returns> public string frmAdd() { TEnvPLakeVo EnvPLake = autoBindRequest(Request, new TEnvPLakeVo()); EnvPLake.IS_DEL = "0"; string strMsg = ""; bool isSuccess = false; //验证数据是否重复 strMsg = new CommonLogic().isExistDatas(TEnvPLakeVo.T_ENV_P_LAKE_TABLE, EnvPLake.YEAR, EnvPLake.SelectMonths, TEnvPLakeVo.SECTION_NAME_FIELD, EnvPLake.SECTION_NAME, TEnvPLakeVo.SECTION_CODE_FIELD, EnvPLake.SECTION_CODE, TEnvPLakeVo.ID_FIELD, EnvPLake.ID, 0); if (strMsg == "") { isSuccess = new TEnvPLakeLogic().Create(EnvPLake, SerialType.T_ENV_P_LAKE); if (isSuccess) { WriteLog("添湖库断面信息", "", LogInfo.UserInfo.USER_NAME + "添加湖库断面信息" + EnvPLake.ID); strMsg = "数据保存成功"; } else { strMsg = "数据保存失败"; } } return(isSuccess == true ? "{\"result\":\"success\",\"msg\":\"" + strMsg + "\"}" : "{\"result\":\"fail\",\"msg\":\"" + strMsg + "\"}"); }
/// <summary> /// 修改数据 /// </summary> /// <returns></returns> public string frmUpdate() { TEnvPLakeVo TEnvPLake = autoBindRequest(Request, new TEnvPLakeVo()); TEnvPLake.ID = Request["id"].ToString(); TEnvPLake.IS_DEL = "0"; string strMsg = ""; bool isSuccess = false; if (hidYear.Value.Trim() != TEnvPLake.YEAR || hidMonth.Value.Trim() != TEnvPLake.MONTH || hidValue.Value.Trim() != TEnvPLake.SECTION_NAME || hidCode.Value.Trim() != TEnvPLake.SECTION_CODE) { //验证数据是否重复 strMsg = new CommonLogic().isExistDatas(TEnvPLakeVo.T_ENV_P_LAKE_TABLE, TEnvPLake.YEAR, TEnvPLake.MONTH, TEnvPLakeVo.SECTION_NAME_FIELD, TEnvPLake.SECTION_NAME, TEnvPLakeVo.SECTION_CODE_FIELD, TEnvPLake.SECTION_CODE, TEnvPLakeVo.ID_FIELD, TEnvPLake.ID, 0); } if (strMsg == "") { isSuccess = new TEnvPLakeLogic().Edit(TEnvPLake); if (isSuccess) { WriteLog("编辑湖库断面监测点", "", LogInfo.UserInfo.USER_NAME + "编辑湖库断面监测点" + TEnvPLake.ID); strMsg = "数据更新成功"; } else { strMsg = "数据更新失败"; } } return(isSuccess == true ? "{\"result\":\"success\",\"msg\":\"" + strMsg + "\"}" : "{\"result\":\"fail\",\"msg\":\"" + strMsg + "\"}"); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvPLake">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvPLakeVo tEnvPLake) { string strSQL = SqlHelper.BuildUpdateExpress(tEnvPLake, TEnvPLakeVo.T_ENV_P_LAKE_TABLE); strSQL += string.Format(" where ID='{0}' ", tEnvPLake.ID); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 加载数据 /// </summary> /// <returns></returns> public string frmLoadData() { TEnvPLakeVo TEnvPLake = new TEnvPLakeVo(); TEnvPLake.ID = Request["id"].ToString(); TEnvPLake.IS_DEL = "0"; TEnvPLakeVo TEnvPLakeTemp = new TEnvPLakeLogic().Details(TEnvPLake); //条件项ID string strConditionId = TEnvPLakeTemp.CONDITION_ID; //根据条件项获取评价标准名称 //string strStanderId = new i3.BusinessLogic.Channels.Base.Evaluation.TBaseEvaluationConInfoLogic().Details(strConditionId).STANDARD_ID; //根据评价标准ID获取评价标准名称 string strStanderName = new i3.BusinessLogic.Channels.Base.Evaluation.TBaseEvaluationInfoLogic().Details(strConditionId).STANDARD_NAME; TEnvPLakeTemp.REMARK1 = strStanderName; //获取流域名称 string strValley = new i3.BusinessLogic.Sys.Resource.TSysDictLogic().Details(TEnvPLakeTemp.VALLEY_ID).DICT_TEXT; TEnvPLakeTemp.REMARK2 = strValley; //获取河流名称 string strRiver = new i3.BusinessLogic.Sys.Resource.TSysDictLogic().Details(TEnvPLakeTemp.RIVER_ID).DICT_TEXT; TEnvPLakeTemp.REMARK3 = strRiver; return(ToJson(TEnvPLakeTemp)); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TEnvPLakeVo tEnvPLake) { string strSQL = "delete from T_ENV_P_LAKE "; strSQL += this.BuildWhereStatement(tEnvPLake); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
public static string deleteOneGridInfo(string strValue) { TEnvPLakeVo EnvPLake = new TEnvPLakeVo(); EnvPLake.ID = strValue; EnvPLake.IS_DEL = "1"; bool isSuccess = new TEnvPLakeLogic().Edit(EnvPLake); if (isSuccess) { new PageBase().WriteLog("删除湖库断面监测点", "", new UserLogInfo().UserInfo.USER_NAME + "删除湖库断面监测点" + EnvPLake.ID); } return(isSuccess == true ? "1" : "0"); }
/// <summary> /// 对象添加 /// </summary> /// <param name="tEnvPDrinkSrc">对象</param> /// <param name="strSerial">序列类型</param> /// <returns>是否成功</returns> public bool Create(TEnvPLakeVo TEnvPLake, string strSerial) { ArrayList list = new ArrayList(); string strSQL = string.Empty; List <string> values = TEnvPLake.SelectMonths.Split(';').ToList(); TEnvPLake.SelectMonths = ""; foreach (string valueTemp in values) { TEnvPLake.ID = GetSerialNumber(strSerial); TEnvPLake.MONTH = valueTemp; strSQL = SqlHelper.BuildInsertExpress(TEnvPLake, TEnvPLakeVo.T_ENV_P_LAKE_TABLE); list.Add(strSQL); } return(SqlHelper.ExecuteSQLByTransaction(list)); }
/// <summary> /// 获取断面信息 /// </summary> /// <returns></returns> private string getOneGridInfo() { string strSortname = Request.Params["sortname"]; string strSortorder = Request.Params["sortorder"]; //当前页面 int intPageIndex = Convert.ToInt32(Request.Params["page"]); //每页记录数 int intPageSize = Convert.ToInt32(Request.Params["pagesize"]); TEnvPLakeVo TEnvPLake = new TEnvPLakeVo(); TEnvPLake.IS_DEL = "0"; TEnvPLake.SORT_FIELD = strSortname; TEnvPLake.SORT_TYPE = strSortorder; DataTable dt = new DataTable(); int intTotalCount = 0; if (!String.IsNullOrEmpty(srhYear) || !String.IsNullOrEmpty(srhMonth) || !String.IsNullOrEmpty(srhName) || !String.IsNullOrEmpty(srhArea)) { TEnvPLake.YEAR = srhYear; TEnvPLake.MONTH = srhMonth; TEnvPLake.SECTION_NAME = srhName; TEnvPLake.AREA_ID = srhArea; dt = new TEnvPLakeLogic().SelectByTable(TEnvPLake, intPageIndex, intPageSize); intTotalCount = new TEnvPLakeLogic().GetSelectResultCount(TEnvPLake); } else { dt = new TEnvPLakeLogic().SelectByTable(TEnvPLake, intPageIndex, intPageSize); intTotalCount = new TEnvPLakeLogic().GetSelectResultCount(TEnvPLake); } string strJson = CreateToJson(dt, intTotalCount); return(strJson); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tEnvPLake">对象条件</param> /// <returns>对象</returns> public TEnvPLakeVo Details(TEnvPLakeVo tEnvPLake) { string strSQL = String.Format("select * from T_ENV_P_LAKE " + this.BuildWhereStatement(tEnvPLake)); return(SqlHelper.ExecuteObject(new TEnvPLakeVo(), strSQL)); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tEnvPLake">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TEnvPLakeVo tEnvPLake) { string strSQL = "select Count(*) from T_ENV_P_LAKE " + this.BuildWhereStatement(tEnvPLake); return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL))); }
/// <summary> /// 根据对象构造条件语句 /// </summary> /// <param name="tEnvPLake"></param> /// <returns></returns> public string BuildWhereStatement(TEnvPLakeVo tEnvPLake) { StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 "); if (null != tEnvPLake) { //主键ID if (!String.IsNullOrEmpty(tEnvPLake.ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND ID = '{0}'", tEnvPLake.ID.ToString())); } //年度 if (!String.IsNullOrEmpty(tEnvPLake.YEAR.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND YEAR = '{0}'", tEnvPLake.YEAR.ToString())); } //月度 if (!String.IsNullOrEmpty(tEnvPLake.MONTH.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND MONTH = '{0}'", tEnvPLake.MONTH.ToString())); } //测站ID(字典项) if (!String.IsNullOrEmpty(tEnvPLake.SATAIONS_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SATAIONS_ID = '{0}'", tEnvPLake.SATAIONS_ID.ToString())); } //断面代码 if (!String.IsNullOrEmpty(tEnvPLake.SECTION_CODE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SECTION_CODE = '{0}'", tEnvPLake.SECTION_CODE.ToString())); } //断面名称 if (!String.IsNullOrEmpty(tEnvPLake.SECTION_NAME.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SECTION_NAME = '{0}'", tEnvPLake.SECTION_NAME.ToString())); } //所在地区ID(字典项) if (!String.IsNullOrEmpty(tEnvPLake.AREA_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND AREA_ID = '{0}'", tEnvPLake.AREA_ID.ToString())); } //所属省份ID(字典项) if (!String.IsNullOrEmpty(tEnvPLake.PROVINCE_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND PROVINCE_ID = '{0}'", tEnvPLake.PROVINCE_ID.ToString())); } //控制级别ID(字典项) if (!String.IsNullOrEmpty(tEnvPLake.CONTRAL_LEVEL.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND CONTRAL_LEVEL = '{0}'", tEnvPLake.CONTRAL_LEVEL.ToString())); } //河流ID(字典项) if (!String.IsNullOrEmpty(tEnvPLake.RIVER_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND RIVER_ID = '{0}'", tEnvPLake.RIVER_ID.ToString())); } //流域ID(字典项) if (!String.IsNullOrEmpty(tEnvPLake.VALLEY_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND VALLEY_ID = '{0}'", tEnvPLake.VALLEY_ID.ToString())); } //水库ID(字典项) if (!String.IsNullOrEmpty(tEnvPLake.LAKE_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LAKE_ID = '{0}'", tEnvPLake.LAKE_ID.ToString())); } //水质目标ID(字典项) if (!String.IsNullOrEmpty(tEnvPLake.WATER_QUALITY_GOALS_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND WATER_QUALITY_GOALS_ID = '{0}'", tEnvPLake.WATER_QUALITY_GOALS_ID.ToString())); } //每月监测、单月监测 if (!String.IsNullOrEmpty(tEnvPLake.MONITOR_TIMES.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND MONITOR_TIMES = '{0}'", tEnvPLake.MONITOR_TIMES.ToString())); } //类别ID(字典项) if (!String.IsNullOrEmpty(tEnvPLake.CATEGORY_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND CATEGORY_ID = '{0}'", tEnvPLake.CATEGORY_ID.ToString())); } //是否交接(0-否,1-是) if (!String.IsNullOrEmpty(tEnvPLake.IS_HANDOVER.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND IS_HANDOVER = '{0}'", tEnvPLake.IS_HANDOVER.ToString())); } //经度(度) if (!String.IsNullOrEmpty(tEnvPLake.LONGITUDE_DEGREE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LONGITUDE_DEGREE = '{0}'", tEnvPLake.LONGITUDE_DEGREE.ToString())); } //经度(分) if (!String.IsNullOrEmpty(tEnvPLake.LONGITUDE_MINUTE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LONGITUDE_MINUTE = '{0}'", tEnvPLake.LONGITUDE_MINUTE.ToString())); } //经度(秒) if (!String.IsNullOrEmpty(tEnvPLake.LONGITUDE_SECOND.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LONGITUDE_SECOND = '{0}'", tEnvPLake.LONGITUDE_SECOND.ToString())); } //纬度(度) if (!String.IsNullOrEmpty(tEnvPLake.LATITUDE_DEGREE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LATITUDE_DEGREE = '{0}'", tEnvPLake.LATITUDE_DEGREE.ToString())); } //纬度(分) if (!String.IsNullOrEmpty(tEnvPLake.LATITUDE_MINUTE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LATITUDE_MINUTE = '{0}'", tEnvPLake.LATITUDE_MINUTE.ToString())); } //纬度(秒) if (!String.IsNullOrEmpty(tEnvPLake.LATITUDE_SECOND.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LATITUDE_SECOND = '{0}'", tEnvPLake.LATITUDE_SECOND.ToString())); } //条件项 if (!String.IsNullOrEmpty(tEnvPLake.CONDITION_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND CONDITION_ID = '{0}'", tEnvPLake.CONDITION_ID.ToString())); } //删除标记 if (!String.IsNullOrEmpty(tEnvPLake.IS_DEL.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND IS_DEL = '{0}'", tEnvPLake.IS_DEL.ToString())); } //断面性质 if (!String.IsNullOrEmpty(tEnvPLake.SECTION_PORPERTIES_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SECTION_PORPERTIES_ID = '{0}'", tEnvPLake.SECTION_PORPERTIES_ID.ToString())); } //序号 if (!String.IsNullOrEmpty(tEnvPLake.NUM.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND NUM = '{0}'", tEnvPLake.NUM.ToString())); } //备注1 if (!String.IsNullOrEmpty(tEnvPLake.REMARK1.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK1 = '{0}'", tEnvPLake.REMARK1.ToString())); } //备注2 if (!String.IsNullOrEmpty(tEnvPLake.REMARK2.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK2 = '{0}'", tEnvPLake.REMARK2.ToString())); } //备注3 if (!String.IsNullOrEmpty(tEnvPLake.REMARK3.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK3 = '{0}'", tEnvPLake.REMARK3.ToString())); } //备注4 if (!String.IsNullOrEmpty(tEnvPLake.REMARK4.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK4 = '{0}'", tEnvPLake.REMARK4.ToString())); } //备注5 if (!String.IsNullOrEmpty(tEnvPLake.REMARK5.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK5 = '{0}'", tEnvPLake.REMARK5.ToString())); } } return(strWhereStatement.ToString()); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tEnvPLake">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TEnvPLakeVo tEnvPLake) { return(access.GetSelectResultCount(tEnvPLake)); }
/// <summary> /// 根据对象特征获取单一对象 /// </summary> /// <param name="tEnvPLake">对象</param> /// <returns></returns> public TEnvPLakeVo SelectByObject(TEnvPLakeVo tEnvPLake) { return(access.SelectByObject(tEnvPLake)); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tEnvPLake"></param> /// <returns></returns> public DataTable SelectByTable(TEnvPLakeVo tEnvPLake) { string strSQL = "select * from T_ENV_P_LAKE " + this.BuildWhereStatement(tEnvPLake); return(SqlHelper.ExecuteDataTable(strSQL)); }
/// <summary> /// 对象添加 /// </summary> /// <param name="tEnvPLake">对象</param> /// <returns>是否成功</returns> public bool Create(TEnvPLakeVo tEnvPLake) { string strSQL = SqlHelper.BuildInsertExpress(tEnvPLake, TEnvPLakeVo.T_ENV_P_LAKE_TABLE); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tEnvPLake"></param> /// <returns></returns> public DataTable SelectByTable(TEnvPLakeVo tEnvPLake) { return(access.SelectByTable(tEnvPLake)); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tEnvPLake">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TEnvPLakeVo tEnvPLake, int iIndex, int iCount) { return(access.SelectByTable(tEnvPLake, iIndex, iCount)); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tEnvPLake">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TEnvPLakeVo> SelectByObject(TEnvPLakeVo tEnvPLake, int iIndex, int iCount) { return(access.SelectByObject(tEnvPLake, iIndex, iCount)); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tEnvPLake">对象条件</param> /// <returns>对象</returns> public TEnvPLakeVo Details(TEnvPLakeVo tEnvPLake) { return(access.Details(tEnvPLake)); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tEnvPLake">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TEnvPLakeVo> SelectByObject(TEnvPLakeVo tEnvPLake, int iIndex, int iCount) { string strSQL = String.Format("select * from T_ENV_P_LAKE " + this.BuildWhereStatement(tEnvPLake)); return(SqlHelper.ExecuteObjectList(tEnvPLake, BuildPagerExpress(strSQL, iIndex, iCount))); }
public TEnvPLakeLogic(TEnvPLakeVo _tEnvPLake) { tEnvPLake = _tEnvPLake; access = new TEnvPLakeAccess(); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvPLake">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvPLakeVo tEnvPLake) { return(access.Edit(tEnvPLake)); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TEnvPLakeVo tEnvPLake) { return(access.Delete(tEnvPLake)); }
/// <summary> /// 对象添加 /// </summary> /// <param name="sysRole">对象</param> /// <returns>是否成功</returns> public bool Create(TEnvPLakeVo tEnvPLake) { return(access.Create(tEnvPLake)); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvPLake_UpdateSet">UpdateSet用户对象</param> /// <param name="tEnvPLake_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvPLakeVo tEnvPLake_UpdateSet, TEnvPLakeVo tEnvPLake_UpdateWhere) { return(access.Edit(tEnvPLake_UpdateSet, tEnvPLake_UpdateWhere)); }
/// <summary> /// 根据对象特征获取单一对象 /// </summary> /// <param name="tEnvPLake">对象</param> /// <returns></returns> public TEnvPLakeVo SelectByObject(TEnvPLakeVo tEnvPLake) { string strSQL = "select * from T_ENV_P_LAKE " + this.BuildWhereStatement(tEnvPLake); return(SqlHelper.ExecuteObject(new TEnvPLakeVo(), strSQL)); }
/// <summary> /// 对象添加 /// </summary> /// <param name="sysRole">对象</param> /// <returns>是否成功</returns> public bool Create(TEnvPLakeVo TEnvPLake, string strSerial) { return(access.Create(TEnvPLake, strSerial)); }