/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvPointOffshore">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvPointOffshoreVo tEnvPointOffshore) { string strSQL = SqlHelper.BuildUpdateExpress(tEnvPointOffshore, TEnvPointOffshoreVo.T_ENV_POINT_OFFSHORE_TABLE); strSQL += string.Format(" where ID='{0}' ", tEnvPointOffshore.ID); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <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"]); TEnvPointOffshoreVo TEnvPointOffshoreVo = new TEnvPointOffshoreVo(); TEnvPointOffshoreVo.IS_DEL = "0"; TEnvPointOffshoreVo.SORT_FIELD = strSortname; TEnvPointOffshoreVo.SORT_TYPE = strSortorder; DataTable dt = new DataTable(); int intTotalCount = 0; if (!String.IsNullOrEmpty(srhYear) || !String.IsNullOrEmpty(srhName) || !String.IsNullOrEmpty(srhLocation)) { TEnvPointOffshoreVo.YEAR = srhYear; TEnvPointOffshoreVo.COMPANY_NAME = srhName; TEnvPointOffshoreVo.LOCATION = srhLocation; dt = new TEnvPointOffshoreLogic().SelectDefinedTadble(TEnvPointOffshoreVo, intPageIndex, intPageSize); intTotalCount = new TEnvPointOffshoreLogic().GetSelecDefinedtResultCount(TEnvPointOffshoreVo); } else { dt = new TEnvPointOffshoreLogic().SelectByTable(TEnvPointOffshoreVo, intPageIndex, intPageSize); intTotalCount = new TEnvPointOffshoreLogic().GetSelectResultCount(TEnvPointOffshoreVo); } string strJson = CreateToJson(dt, intTotalCount); return(strJson); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tEnvPointOffshore">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TEnvPointOffshoreVo tEnvPointOffshore, int iIndex, int iCount) { string strSQL = " select * from T_ENV_P_OFFSHORE {0} "; strSQL = String.Format(strSQL, BuildWhereStatement(tEnvPointOffshore)); return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvPointOffshore_UpdateSet">UpdateSet用户对象</param> /// <param name="tEnvPointOffshore_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvPointOffshoreVo tEnvPointOffshore_UpdateSet, TEnvPointOffshoreVo tEnvPointOffshore_UpdateWhere) { string strSQL = SqlHelper.BuildUpdateExpress(tEnvPointOffshore_UpdateSet, TEnvPointOffshoreVo.T_ENV_POINT_OFFSHORE_TABLE); strSQL += this.BuildWhereStatement(tEnvPointOffshore_UpdateWhere); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 获取自定义查询结果总数 Create By Castle(胡方扬) 2012-11-19 /// </summary> /// <param name="tEnvPointOffshore">对象</param> /// <returns></returns> public int GetSelecDefinedtResultCount(TEnvPointOffshoreVo tEnvPointOffshore) { string strSQL = " select * from T_ENV_P_OFFSHORE {0} "; strSQL = String.Format(strSQL, BuildWhereLikeStatement(tEnvPointOffshore)); return(SqlHelper.ExecuteDataTable(strSQL).Rows.Count); }
/// <summary> /// 增加数据 /// </summary> /// <returns></returns> public string frmAdd() { string strMsg = ""; bool isSuccess = true; TEnvPointOffshoreVo TEnvPointOffshoreVo = autoBindRequest(Request, new TEnvPointOffshoreVo()); // TEnvPointOffshoreVo.ID = GetSerialNumber("offshorepoint_id"); TEnvPointOffshoreVo.IS_DEL = "0"; string Meg = new CommonLogic().isExistDatas(TEnvPointOffshoreVo.T_ENV_POINT_OFFSHORE_TABLE, TEnvPointOffshoreVo.YEAR, TEnvPointOffshoreVo.SelectMonths, TEnvPointOffshoreVo.POINT_NAME_FIELD, TEnvPointOffshoreVo.POINT_NAME, TEnvPointOffshoreVo.POINT_CODE_FIELD, TEnvPointOffshoreVo.POINT_CODE, TEnvPointOffshoreVo.ID_FIELD, TEnvPointOffshoreVo.ID, 0); if (!string.IsNullOrEmpty(Meg)) { strMsg = Meg; isSuccess = false; } else { isSuccess = new TEnvPointOffshoreLogic().Create(TEnvPointOffshoreVo, SerialType.T_ENV_POINT_OFFSHORE_TABLE); if (isSuccess) { WriteLog("添加近岸直排监测点", "", LogInfo.UserInfo.USER_NAME + "添加近岸直排监测点:" + TEnvPointOffshoreVo.ID); strMsg = "数据保存成功"; } else { strMsg = "数据保存失败"; } } return(isSuccess == true ? "{\"result\":\"success\",\"msg\":\"" + strMsg + "\"}" : "{\"result\":\"fail\",\"msg\":\"" + strMsg + "\"}"); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TEnvPointOffshoreVo tEnvPointOffshore) { string strSQL = "delete from T_ENV_P_OFFSHORE "; strSQL += this.BuildWhereStatement(tEnvPointOffshore); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
public static string deleteOneGridInfo(string strValue) { TEnvPointOffshoreVo TEnvPointOffshoreVo = new TEnvPointOffshoreVo(); TEnvPointOffshoreVo.ID = strValue; TEnvPointOffshoreVo.IS_DEL = "1"; bool isSuccess = new TEnvPointOffshoreLogic().Edit(TEnvPointOffshoreVo); if (isSuccess) { new PageBase().WriteLog("删除近岸直排监测点", "", new UserLogInfo().UserInfo.USER_NAME + "删除近岸直排监测点" + TEnvPointOffshoreVo.ID); } return(isSuccess == true ? "1" : "0"); }
/// <summary> /// 加载数据 /// </summary> /// <returns></returns> public string frmLoadData() { TEnvPointOffshoreVo TEnvPointOffshoreVo = new TEnvPointOffshoreVo(); TEnvPointOffshoreVo.ID = Request["id"].ToString(); TEnvPointOffshoreVo.IS_DEL = "0"; TEnvPointOffshoreVo TEnvPointOffshoreVoTemp = new TEnvPointOffshoreLogic().Details(TEnvPointOffshoreVo); //条件项ID string strConditionId = TEnvPointOffshoreVoTemp.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(strStanderId).STANDARD_NAME; TEnvPointOffshoreVoTemp.REMARK1 = strStanderName; return(ToJson(TEnvPointOffshoreVoTemp)); }
/// <summary> /// 修改数据 /// </summary> /// <returns></returns> public string frmUpdate() { TEnvPointOffshoreVo TEnvPointOffshoreVo = autoBindRequest(Request, new TEnvPointOffshoreVo()); TEnvPointOffshoreVo.ID = Request["id"].ToString(); TEnvPointOffshoreVo.IS_DEL = "0"; //bool isSuccess = new TEnvPointOffshoreLogic().Edit(TEnvPointOffshoreVo); //if (isSuccess) // WriteLog("编辑近岸直排监测点", "", LogInfo.UserInfo.USER_NAME + "编辑近岸直排监测点" + TEnvPointOffshoreVo.ID); //return isSuccess == true ? "1" : "0"; string strMsg = ""; bool isSuccess = true; if (hidYear.Value.Trim() != TEnvPointOffshoreVo.YEAR || hidMonth.Value.Trim() != TEnvPointOffshoreVo.MONTH || hidValue.Value.Trim() != TEnvPointOffshoreVo.POINT_NAME || hidValues.Value.Trim() != TEnvPointOffshoreVo.POINT_CODE) { //验证数据是否重复 strMsg = new CommonLogic().isExistDatas(TEnvPointOffshoreVo.T_ENV_POINT_OFFSHORE_TABLE, TEnvPointOffshoreVo.YEAR, TEnvPointOffshoreVo.MONTH, TEnvPointOffshoreVo.POINT_NAME_FIELD, TEnvPointOffshoreVo.POINT_NAME, TEnvPointOffshoreVo.POINT_CODE_FIELD, TEnvPointOffshoreVo.POINT_CODE, TEnvPointOffshoreVo.ID_FIELD, TEnvPointOffshoreVo.ID, 0); if (string.IsNullOrEmpty(strMsg)) { isSuccess = true; } else { isSuccess = false; } } if (isSuccess) { isSuccess = new TEnvPointOffshoreLogic().Edit(TEnvPointOffshoreVo); if (isSuccess) { WriteLog("编辑近岸直排监测点", "", LogInfo.UserInfo.USER_NAME + "编辑近岸直排监测点" + TEnvPointOffshoreVo.ID); strMsg = "数据更新成功"; } else { strMsg = "数据更新失败"; } } return(isSuccess == true ? "{\"result\":\"success\",\"msg\":\"" + strMsg + "\"}" : "{\"result\":\"fail\",\"msg\":\"" + strMsg + "\"}"); }
/// <summary> /// 对象添加(ljn.2013/6/14) /// </summary> /// <param name="tEnvPAir">对象</param> /// <returns>是否成功</returns> public bool Create(TEnvPointOffshoreVo tEnvPointOffshore, string Number) { ArrayList list = new ArrayList(); string strSQL = string.Empty; List <string> values = tEnvPointOffshore.SelectMonths.Split(';').ToList(); tEnvPointOffshore.SelectMonths = string.Empty; foreach (string valueTemp in values) { tEnvPointOffshore.ID = GetSerialNumber(Number); tEnvPointOffshore.MONTH = valueTemp; strSQL = SqlHelper.BuildInsertExpress(tEnvPointOffshore, TEnvPointOffshoreVo.T_ENV_POINT_OFFSHORE_TABLE); list.Add(strSQL); } return(SqlHelper.ExecuteSQLByTransaction(list)); //string strSQL = SqlHelper.BuildInsertExpress(tEnvPAir, TEnvPAirVo.T_ENV_P_AIR_TABLE); //return SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false; }
private void GetPoint() { string year = Request["year"]; string month = Request["month"]; TEnvPointOffshoreVo model = new TEnvPointOffshoreVo(); model.YEAR = year; model.MONTH = month; model.IS_DEL = "0"; DataTable dt = new TEnvPointOffshoreLogic().SelectByTable(model); //加入全部 DataRow dr = dt.NewRow(); dr["company_name"] = "--全部--"; dt.Rows.InsertAt(dr, 0); string json = DataTableToJson(dt); Response.ContentType = "application/json;charset=utf-8"; Response.Write(json); Response.End(); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvPointOffshore">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvPointOffshoreVo tEnvPointOffshore) { return(access.Edit(tEnvPointOffshore)); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tEnvPointOffshore"></param> /// <returns></returns> public DataTable SelectByTable(TEnvPointOffshoreVo tEnvPointOffshore) { string strSQL = "select * from T_ENV_P_OFFSHORE " + this.BuildWhereStatement(tEnvPointOffshore); return(SqlHelper.ExecuteDataTable(strSQL)); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tEnvPointOffshore_UpdateSet">UpdateSet用户对象</param> /// <param name="tEnvPointOffshore_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TEnvPointOffshoreVo tEnvPointOffshore_UpdateSet, TEnvPointOffshoreVo tEnvPointOffshore_UpdateWhere) { return(access.Edit(tEnvPointOffshore_UpdateSet, tEnvPointOffshore_UpdateWhere)); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tEnvPointOffshore">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TEnvPointOffshoreVo> SelectByObject(TEnvPointOffshoreVo tEnvPointOffshore, int iIndex, int iCount) { string strSQL = String.Format("select * from T_ENV_P_OFFSHORE " + this.BuildWhereStatement(tEnvPointOffshore)); return(SqlHelper.ExecuteObjectList(tEnvPointOffshore, BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TEnvPointOffshoreVo tEnvPointOffshore) { return(access.Delete(tEnvPointOffshore)); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tEnvPointOffshore">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TEnvPointOffshoreVo tEnvPointOffshore, int iIndex, int iCount) { return(access.SelectByTable(tEnvPointOffshore, iIndex, iCount)); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tEnvPointOffshore">对象条件</param> /// <returns>对象</returns> public TEnvPointOffshoreVo Details(TEnvPointOffshoreVo tEnvPointOffshore) { string strSQL = String.Format("select * from T_ENV_P_OFFSHORE " + this.BuildWhereStatement(tEnvPointOffshore)); return(SqlHelper.ExecuteObject(new TEnvPointOffshoreVo(), strSQL)); }
public TEnvPointOffshoreLogic(TEnvPointOffshoreVo _tEnvPointOffshore) { tEnvPointOffshore = _tEnvPointOffshore; access = new TEnvPointOffshoreAccess(); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tEnvPointOffshore">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TEnvPointOffshoreVo tEnvPointOffshore) { string strSQL = "select Count(*) from T_ENV_P_OFFSHORE " + this.BuildWhereStatement(tEnvPointOffshore); return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL))); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tEnvPointOffshore">对象条件</param> /// <returns>对象</returns> public TEnvPointOffshoreVo Details(TEnvPointOffshoreVo tEnvPointOffshore) { return(access.Details(tEnvPointOffshore)); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tEnvPointOffshore">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TEnvPointOffshoreVo tEnvPointOffshore) { return(access.GetSelectResultCount(tEnvPointOffshore)); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tEnvPointOffshore">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TEnvPointOffshoreVo> SelectByObject(TEnvPointOffshoreVo tEnvPointOffshore, int iIndex, int iCount) { return(access.SelectByObject(tEnvPointOffshore, iIndex, iCount)); }
/// <summary> /// 对象添加 /// </summary> /// <param name="sysRole">对象</param> /// <returns>是否成功</returns> public bool Create(TEnvPointOffshoreVo tEnvPointOffshore) { return(access.Create(tEnvPointOffshore)); }
/// <summary> /// 对象添加 /// </summary> /// <param name="tEnvPointOffshore">对象</param> /// <returns>是否成功</returns> public bool Create(TEnvPointOffshoreVo tEnvPointOffshore) { string strSQL = SqlHelper.BuildInsertExpress(tEnvPointOffshore, TEnvPointOffshoreVo.T_ENV_POINT_OFFSHORE_TABLE); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 对象添加(ljn.2013/6/14) /// </summary> /// <param name="sysRole">对象</param> /// <returns>是否成功</returns> public bool Create(TEnvPointOffshoreVo tEnvPointOffshore, string Number) { return(access.Create(tEnvPointOffshore, Number)); }
/// <summary> /// 根据对象构造条件语句 模糊查询 Create By Castle(胡方扬) 2012-11-22 /// </summary> /// <param name="tEnvPointOffshore"></param> /// <returns></returns> public string BuildWhereLikeStatement(TEnvPointOffshoreVo tEnvPointOffshore) { StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 "); if (null != tEnvPointOffshore) { //ID if (!String.IsNullOrEmpty(tEnvPointOffshore.ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND ID = '{0}'", tEnvPointOffshore.ID.ToString())); } //年度 if (!String.IsNullOrEmpty(tEnvPointOffshore.YEAR.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND YEAR = '{0}'", tEnvPointOffshore.YEAR.ToString())); } //月度 if (!String.IsNullOrEmpty(tEnvPointOffshore.MONTH.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND MONTH = '{0}'", tEnvPointOffshore.MONTH.ToString())); } //企业名称 if (!String.IsNullOrEmpty(tEnvPointOffshore.COMPANY_NAME.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND COMPANY_NAME LIKE '%{0}%'", tEnvPointOffshore.COMPANY_NAME.ToString())); } //功能属性 if (!String.IsNullOrEmpty(tEnvPointOffshore.FUNCTION_ATTRIBUTE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND FUNCTION_ATTRIBUTE = '{0}'", tEnvPointOffshore.FUNCTION_ATTRIBUTE.ToString())); } //经度(度) if (!String.IsNullOrEmpty(tEnvPointOffshore.LONGITUDE_DEGREE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LONGITUDE_DEGREE = '{0}'", tEnvPointOffshore.LONGITUDE_DEGREE.ToString())); } //经度(分) if (!String.IsNullOrEmpty(tEnvPointOffshore.LONGITUDE_MINUTE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LONGITUDE_MINUTE = '{0}'", tEnvPointOffshore.LONGITUDE_MINUTE.ToString())); } //经度(秒) if (!String.IsNullOrEmpty(tEnvPointOffshore.LONGITUDE_SECOND.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LONGITUDE_SECOND = '{0}'", tEnvPointOffshore.LONGITUDE_SECOND.ToString())); } //纬度(度) if (!String.IsNullOrEmpty(tEnvPointOffshore.LATITUDE_DEGREE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LATITUDE_DEGREE = '{0}'", tEnvPointOffshore.LATITUDE_DEGREE.ToString())); } //纬度(分) if (!String.IsNullOrEmpty(tEnvPointOffshore.LATITUDE_MINUTE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LATITUDE_MINUTE = '{0}'", tEnvPointOffshore.LATITUDE_MINUTE.ToString())); } //纬度(秒) if (!String.IsNullOrEmpty(tEnvPointOffshore.LATITUDE_SECOND.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LATITUDE_SECOND = '{0}'", tEnvPointOffshore.LATITUDE_SECOND.ToString())); } //具体位置 if (!String.IsNullOrEmpty(tEnvPointOffshore.LOCATION.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND LOCATION LIKE '%{0}%'", tEnvPointOffshore.LOCATION.ToString())); } //条件项 if (!String.IsNullOrEmpty(tEnvPointOffshore.CONDITION_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND CONDITION_ID = '{0}'", tEnvPointOffshore.CONDITION_ID.ToString())); } //使用状态(0为启用、1为停用) if (!String.IsNullOrEmpty(tEnvPointOffshore.IS_DEL.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND IS_DEL = '{0}'", tEnvPointOffshore.IS_DEL.ToString())); } //序号 if (!String.IsNullOrEmpty(tEnvPointOffshore.NUM.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND NUM = '{0}'", tEnvPointOffshore.NUM.ToString())); } //备注1 if (!String.IsNullOrEmpty(tEnvPointOffshore.REMARK1.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK1 = '{0}'", tEnvPointOffshore.REMARK1.ToString())); } //备注2 if (!String.IsNullOrEmpty(tEnvPointOffshore.REMARK2.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK2 = '{0}'", tEnvPointOffshore.REMARK2.ToString())); } //备注3 if (!String.IsNullOrEmpty(tEnvPointOffshore.REMARK3.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK3 = '{0}'", tEnvPointOffshore.REMARK3.ToString())); } //备注4 if (!String.IsNullOrEmpty(tEnvPointOffshore.REMARK4.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK4 = '{0}'", tEnvPointOffshore.REMARK4.ToString())); } //备注5 if (!String.IsNullOrEmpty(tEnvPointOffshore.REMARK5.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK5 = '{0}'", tEnvPointOffshore.REMARK5.ToString())); } } return(strWhereStatement.ToString()); }
/// <summary> /// 根据对象特征获取单一对象 /// </summary> /// <param name="tEnvPointOffshore">对象</param> /// <returns></returns> public TEnvPointOffshoreVo SelectByObject(TEnvPointOffshoreVo tEnvPointOffshore) { return(access.SelectByObject(tEnvPointOffshore)); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tEnvPointOffshore"></param> /// <returns></returns> public DataTable SelectByTable(TEnvPointOffshoreVo tEnvPointOffshore) { return(access.SelectByTable(tEnvPointOffshore)); }