/// <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> /// <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); }
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 + "\"}"); }
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(); }