Пример #1
0
        /// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tEnvPAir_UpdateSet">UpdateSet用户对象</param>
        /// <param name="tEnvPAir_UpdateWhere">UpdateWhere用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TEnvPAirVo tEnvPAir_UpdateSet, TEnvPAirVo tEnvPAir_UpdateWhere)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tEnvPAir_UpdateSet, TEnvPAirVo.T_ENV_P_AIR_TABLE);

            strSQL += this.BuildWhereStatement(tEnvPAir_UpdateWhere);
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
Пример #2
0
        /// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tEnvPAir">用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TEnvPAirVo tEnvPAir)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tEnvPAir, TEnvPAirVo.T_ENV_P_AIR_TABLE);

            strSQL += string.Format(" where ID='{0}' ", tEnvPAir.ID);
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
Пример #3
0
        /// <summary>
        /// 获取对象DataTable
        /// </summary>
        /// <param name="tEnvPAir">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public DataTable SelectByTable(TEnvPAirVo tEnvPAir, int iIndex, int iCount)
        {
            string strSQL = " select * from T_ENV_P_AIR {0} order by YEAR desc,len(MONTH) desc,MONTH desc ";

            strSQL = String.Format(strSQL, BuildWhereStatement(tEnvPAir));
            return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount)));
        }
Пример #4
0
    /// <summary>
    /// 增加数据
    /// </summary>
    /// <returns></returns>
    public string frmAdd()
    {
        string     strMsg          = "";
        bool       isSuccess       = true;
        TEnvPAirVo TEnvPointRainVo = autoBindRequest(Request, new TEnvPAirVo());

        //TEnvPointRainVo.ID = GetSerialNumber("rainpoint_id");
        TEnvPointRainVo.IS_DEL = "0";

        string Meg = new CommonLogic().isExistDatas(TEnvPAirVo.T_ENV_P_AIR_TABLE, TEnvPointRainVo.YEAR, TEnvPointRainVo.SelectMonths, TEnvPAirVo.POINT_NAME_FIELD, TEnvPointRainVo.POINT_NAME, TEnvPAirVo.POINT_CODE_FIELD, TEnvPointRainVo.POINT_CODE, TEnvPAirVo.ID_FIELD, TEnvPointRainVo.ID, 0);

        //string Meg = new CommonLogic().isExistDatas(TEnvPAirVo.T_ENV_P_AIR_TABLE, TEnvPointRainVo.YEAR, TEnvPointRainVo.SelectMonths, TEnvPAirVo.POINT_CODE_FIELD, TEnvPointRainVo.POINT_CODE);
        if (!string.IsNullOrEmpty(Meg))
        {
            strMsg = Meg; isSuccess = false;
        }
        else
        {
            isSuccess = new T_ENV_P_AIR().Create(TEnvPointRainVo, SerialType.T_ENV_P_AIR);
            if (isSuccess)
            {
                WriteLog("添加环境空气监测点", "", LogInfo.UserInfo.USER_NAME + "添加环境空气监测点:" + TEnvPointRainVo.ID);
                strMsg = "数据保存成功";
            }
            else
            {
                strMsg = "数据保存失败";
            }
        }
        return(isSuccess == true ? "{\"result\":\"success\",\"msg\":\"" + strMsg + "\"}" : "{\"result\":\"fail\",\"msg\":\"" + strMsg + "\"}");
    }
Пример #5
0
        /// <summary>
        /// 对象删除
        /// </summary>
        /// <param name="Id">ID</param>
        /// <returns>是否成功</returns>
        public bool Delete(TEnvPAirVo tEnvPAir)
        {
            string strSQL = "delete from T_ENV_P_AIR ";

            strSQL += this.BuildWhereStatement(tEnvPAir);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
 public static string deleteOneGridInfo(string strValue)
 {
     TEnvPAirVo TEnvPointRainVo = new TEnvPAirVo();
     TEnvPointRainVo.ID = strValue;
     TEnvPointRainVo.IS_DEL = "1";
     bool isSuccess = new T_ENV_P_AIR().Edit(TEnvPointRainVo);
     if (isSuccess)
         new PageBase().WriteLog("删除环境空气监测点", "", new UserLogInfo().UserInfo.USER_NAME + "删除环境空气监测点" + TEnvPointRainVo.ID);
     return isSuccess == true ? "1" : "0";
 }
Пример #7
0
    /// <summary>
    /// 加载数据
    /// </summary>
    /// <returns></returns>
    public string frmLoadData()
    {
        TEnvPAirVo TEnvPointRainVo = new TEnvPAirVo();

        TEnvPointRainVo.ID     = Request["id"].ToString();
        TEnvPointRainVo.IS_DEL = "0";
        TEnvPAirVo TEnvPointRainVoTemp = new T_ENV_P_AIR().Details(TEnvPointRainVo);

        //条件项ID
        //string strConditionId = TEnvPointRainVoTemp.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;
        //TEnvPointRainVoTemp.REMARK1 = strStanderName;
        return(ToJson(TEnvPointRainVoTemp));
    }
    /// <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"]);

        TEnvPAirVo TEnvPointRainVo = new TEnvPAirVo();
        TEnvPointRainVo.IS_DEL = "0";
        TEnvPointRainVo.SORT_FIELD = strSortname;
        TEnvPointRainVo.SORT_TYPE = strSortorder;
        DataTable dt = new T_ENV_P_AIR().SelectByTable(TEnvPointRainVo, intPageIndex, intPageSize);
        int intTotalCount = new T_ENV_P_AIR().GetSelectResultCount(TEnvPointRainVo);
        string strJson = CreateToJson(dt, intTotalCount);
        return strJson;
    }
Пример #9
0
        /// <summary>
        /// 对象添加(ljn.2013/6/14)
        /// </summary>
        /// <param name="tEnvPAir">对象</param>
        /// <returns>是否成功</returns>
        public bool Create(TEnvPAirVo tEnvPAir, string Number)
        {
            ArrayList     list   = new ArrayList();
            string        strSQL = string.Empty;
            List <string> values = tEnvPAir.SelectMonths.Split(';').ToList();

            tEnvPAir.SelectMonths = string.Empty;
            foreach (string valueTemp in values)
            {
                tEnvPAir.ID    = GetSerialNumber(Number);
                tEnvPAir.MONTH = valueTemp;
                strSQL         = SqlHelper.BuildInsertExpress(tEnvPAir, TEnvPAirVo.T_ENV_P_AIR_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"];
        TEnvPAirVo Dustpoint = new TEnvPAirVo();//降尘点位

        Dustpoint.YEAR   = year;
        Dustpoint.MONTH  = month;
        Dustpoint.IS_DEL = "0";//删除标志
        DataTable dt = new i3.BusinessLogic.Channels.Env.Point.Environment.T_ENV_P_AIR().SelectByTable(Dustpoint);
        //加入全部
        DataRow dr = dt.NewRow();

        dr["POINT_NAME"] = "--全部--";
        dt.Rows.InsertAt(dr, 0);
        string json = DataTableToJson(dt);

        Response.ContentType = "application/json;charset=utf-8";
        Response.Write(json);
        Response.End();
    }
Пример #11
0
    /// <summary>
    /// 修改数据
    /// </summary>
    /// <returns></returns>
    public string frmUpdate()
    {
        TEnvPAirVo TEnvPointRainVo = autoBindRequest(Request, new TEnvPAirVo());

        TEnvPointRainVo.ID     = Request["id"].ToString();
        TEnvPointRainVo.IS_DEL = "0";

        string Meg       = "";
        bool   isSuccess = true;

        if (hidYear.Value.Trim() != TEnvPointRainVo.YEAR || hidMonth.Value.Trim() != TEnvPointRainVo.MONTH || hidValue.Value.Trim() != TEnvPointRainVo.POINT_NAME || hidValues.Value.Trim() != TEnvPointRainVo.POINT_CODE)
        {
            //验证数据是否重复
            Meg = new CommonLogic().isExistDatas(TEnvPAirVo.T_ENV_P_AIR_TABLE, TEnvPointRainVo.YEAR, TEnvPointRainVo.SelectMonths, TEnvPAirVo.POINT_NAME_FIELD, TEnvPointRainVo.POINT_NAME, TEnvPAirVo.POINT_CODE_FIELD, TEnvPointRainVo.POINT_CODE, TEnvPAirVo.ID_FIELD, TEnvPointRainVo.ID, 0);
            if (string.IsNullOrEmpty(Meg))
            {
                isSuccess = true;
            }
            else
            {
                isSuccess = false;
            }
        }

        if (isSuccess)
        {
            isSuccess = new T_ENV_P_AIR().Edit(TEnvPointRainVo);
            if (isSuccess)
            {
                WriteLog("编辑环境空气监测点", "", LogInfo.UserInfo.USER_NAME + "编辑环境空气监测点" + TEnvPointRainVo.ID);
                Meg = "数据更新成功";
            }
            else
            {
                Meg = "数据更新失败";
            }
        }
        return(isSuccess == true ? "{\"result\":\"success\",\"msg\":\"" + Meg + "\"}" : "{\"result\":\"fail\",\"msg\":\"" + Meg + "\"}");
    }
Пример #12
0
 /// <summary>
 /// 对象添加(ljn.2013/6/14)
 /// </summary>
 /// <param name="sysRole">对象</param>
 /// <returns>是否成功</returns>
 public bool Create(TEnvPAirVo tEnvPAir, string Number)
 {
     return(access.Create(tEnvPAir, Number));
 }
Пример #13
0
        /// <summary>
        /// 根据对象获取全部数据,用Table承载
        ///  数据量较小时使用【不推荐】
        /// </summary>
        /// <param name="tEnvPAir"></param>
        /// <returns></returns>
        public DataTable SelectByTable(TEnvPAirVo tEnvPAir)
        {
            string strSQL = "select * from T_ENV_P_AIR " + this.BuildWhereStatement(tEnvPAir);

            return(SqlHelper.ExecuteDataTable(strSQL));
        }
Пример #14
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tEnvPAir">用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TEnvPAirVo tEnvPAir)
 {
     return(access.Edit(tEnvPAir));
 }
Пример #15
0
        /// <summary>
        /// 获取对象List
        /// </summary>
        /// <param name="tEnvPAir">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public List <TEnvPAirVo> SelectByObject(TEnvPAirVo tEnvPAir, int iIndex, int iCount)
        {
            string strSQL = String.Format("select * from  T_ENV_P_AIR " + this.BuildWhereStatement(tEnvPAir));

            return(SqlHelper.ExecuteObjectList(tEnvPAir, BuildPagerExpress(strSQL, iIndex, iCount)));
        }
Пример #16
0
        /// <summary>
        /// 对象明细
        /// </summary>
        /// <param name="tEnvPAir">对象条件</param>
        /// <returns>对象</returns>
        public TEnvPAirVo Details(TEnvPAirVo tEnvPAir)
        {
            string strSQL = String.Format("select * from  T_ENV_P_AIR " + this.BuildWhereStatement(tEnvPAir));

            return(SqlHelper.ExecuteObject(new TEnvPAirVo(), strSQL));
        }
Пример #17
0
        /// <summary>
        /// 根据对象构造条件语句
        /// </summary>
        /// <param name="tEnvPAir"></param>
        /// <returns></returns>
        public string BuildWhereStatement(TEnvPAirVo tEnvPAir)
        {
            StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 ");

            if (null != tEnvPAir)
            {
                //主键ID
                if (!String.IsNullOrEmpty(tEnvPAir.ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND ID = '{0}'", tEnvPAir.ID.ToString()));
                }
                //年度
                if (!String.IsNullOrEmpty(tEnvPAir.YEAR.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND YEAR = '{0}'", tEnvPAir.YEAR.ToString()));
                }
                //月度
                if (!String.IsNullOrEmpty(tEnvPAir.MONTH.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND MONTH = '{0}'", tEnvPAir.MONTH.ToString()));
                }
                //测站
                if (!string.IsNullOrEmpty(tEnvPAir.SATAIONS_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND SATAIONS_ID={0}", tEnvPAir.SATAIONS_ID.ToString()));
                }
                //测点编号
                if (!String.IsNullOrEmpty(tEnvPAir.POINT_CODE.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND POINT_CODE = '{0}'", tEnvPAir.POINT_CODE.ToString()));
                }
                //测点名称
                if (!String.IsNullOrEmpty(tEnvPAir.POINT_NAME.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND POINT_NAME = '{0}'", tEnvPAir.POINT_NAME.ToString()));
                }
                //行政区ID(字典项)
                if (!String.IsNullOrEmpty(tEnvPAir.AREA_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND AREA_ID = '{0}'", tEnvPAir.AREA_ID.ToString()));
                }
                //经度(度)
                if (!String.IsNullOrEmpty(tEnvPAir.LONGITUDE_DEGREE.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND LONGITUDE_DEGREE = '{0}'", tEnvPAir.LONGITUDE_DEGREE.ToString()));
                }
                //经度(分)
                if (!String.IsNullOrEmpty(tEnvPAir.LONGITUDE_MINUTE.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND LONGITUDE_MINUTE = '{0}'", tEnvPAir.LONGITUDE_MINUTE.ToString()));
                }
                //经度(秒)
                if (!String.IsNullOrEmpty(tEnvPAir.LONGITUDE_SECOND.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND LONGITUDE_SECOND = '{0}'", tEnvPAir.LONGITUDE_SECOND.ToString()));
                }
                //纬度(度)
                if (!String.IsNullOrEmpty(tEnvPAir.LATITUDE_DEGREE.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND LATITUDE_DEGREE = '{0}'", tEnvPAir.LATITUDE_DEGREE.ToString()));
                }
                //纬度(分)
                if (!String.IsNullOrEmpty(tEnvPAir.LATITUDE_MINUTE.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND LATITUDE_MINUTE = '{0}'", tEnvPAir.LATITUDE_MINUTE.ToString()));
                }
                //纬度(秒)
                if (!String.IsNullOrEmpty(tEnvPAir.LATITUDE_SECOND.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND LATITUDE_SECOND = '{0}'", tEnvPAir.LATITUDE_SECOND.ToString()));
                }
                //测点位置
                if (!String.IsNullOrEmpty(tEnvPAir.LOCATION.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND LOCATION = '{0}'", tEnvPAir.LOCATION.ToString()));
                }
                //删除标记
                if (!String.IsNullOrEmpty(tEnvPAir.IS_DEL.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND IS_DEL = '{0}'", tEnvPAir.IS_DEL.ToString()));
                }
                //序号
                if (!String.IsNullOrEmpty(tEnvPAir.NUM.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND NUM = '{0}'", tEnvPAir.NUM.ToString()));
                }
                //备注1
                if (!String.IsNullOrEmpty(tEnvPAir.REMARK1.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK1 = '{0}'", tEnvPAir.REMARK1.ToString()));
                }
                //备注2
                if (!String.IsNullOrEmpty(tEnvPAir.REMARK2.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK2 = '{0}'", tEnvPAir.REMARK2.ToString()));
                }
                //备注3
                if (!String.IsNullOrEmpty(tEnvPAir.REMARK3.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK3 = '{0}'", tEnvPAir.REMARK3.ToString()));
                }
                //备注4
                if (!String.IsNullOrEmpty(tEnvPAir.REMARK4.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK4 = '{0}'", tEnvPAir.REMARK4.ToString()));
                }
                //备注5
                if (!String.IsNullOrEmpty(tEnvPAir.REMARK5.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK5 = '{0}'", tEnvPAir.REMARK5.ToString()));
                }
            }
            return(strWhereStatement.ToString());
        }
Пример #18
0
 /// <summary>
 /// 获取对象List
 /// </summary>
 /// <param name="tEnvPAir">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public List <TEnvPAirVo> SelectByObject(TEnvPAirVo tEnvPAir, int iIndex, int iCount)
 {
     return(access.SelectByObject(tEnvPAir, iIndex, iCount));
 }
Пример #19
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tEnvPAir_UpdateSet">UpdateSet用户对象</param>
 /// <param name="tEnvPAir_UpdateWhere">UpdateWhere用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TEnvPAirVo tEnvPAir_UpdateSet, TEnvPAirVo tEnvPAir_UpdateWhere)
 {
     return(access.Edit(tEnvPAir_UpdateSet, tEnvPAir_UpdateWhere));
 }
Пример #20
0
 /// <summary>
 /// 对象删除
 /// </summary>
 /// <param name="Id">ID</param>
 /// <returns>是否成功</returns>
 public bool Delete(TEnvPAirVo tEnvPAir)
 {
     return(access.Delete(tEnvPAir));
 }
Пример #21
0
 public T_ENV_P_AIR(TEnvPAirVo _tEnvPAir)
 {
     tEnvPAir = _tEnvPAir;
     access   = new TEnvPAirAccess();
 }
Пример #22
0
 /// <summary>
 /// 获得查询结果总行数,用于分页
 /// </summary>
 /// <param name="tEnvPAir">对象</param>
 /// <returns>返回行数</returns>
 public int GetSelectResultCount(TEnvPAirVo tEnvPAir)
 {
     return(access.GetSelectResultCount(tEnvPAir));
 }
Пример #23
0
 /// <summary>
 /// 根据对象获取全部数据,用Table承载
 ///  数据量较小时使用【不推荐】
 /// </summary>
 /// <param name="tEnvPAir"></param>
 /// <returns></returns>
 public DataTable SelectByTable(TEnvPAirVo tEnvPAir)
 {
     return(access.SelectByTable(tEnvPAir));
 }
Пример #24
0
 /// <summary>
 /// 获取对象DataTable
 /// </summary>
 /// <param name="tEnvPAir">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public DataTable SelectByTable(TEnvPAirVo tEnvPAir, int iIndex, int iCount)
 {
     return(access.SelectByTable(tEnvPAir, iIndex, iCount));
 }
Пример #25
0
 /// <summary>
 /// 根据对象特征获取单一对象
 /// </summary>
 /// <param name="tEnvPAir">对象</param>
 /// <returns></returns>
 public TEnvPAirVo SelectByObject(TEnvPAirVo tEnvPAir)
 {
     return(access.SelectByObject(tEnvPAir));
 }
Пример #26
0
        /// <summary>
        /// 获得查询结果总行数,用于分页
        /// </summary>
        /// <param name="tEnvPAir">对象</param>
        /// <returns>返回行数</returns>
        public int GetSelectResultCount(TEnvPAirVo tEnvPAir)
        {
            string strSQL = "select Count(*) from T_ENV_P_AIR " + this.BuildWhereStatement(tEnvPAir);

            return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL)));
        }
Пример #27
0
        /// <summary>
        /// 根据对象特征获取单一对象
        /// </summary>
        /// <param name="tEnvPAir">对象</param>
        /// <returns></returns>
        public TEnvPAirVo SelectByObject(TEnvPAirVo tEnvPAir)
        {
            string strSQL = "select * from T_ENV_P_AIR " + this.BuildWhereStatement(tEnvPAir);

            return(SqlHelper.ExecuteObject(new TEnvPAirVo(), strSQL));
        }
Пример #28
0
 /// <summary>
 /// 对象明细
 /// </summary>
 /// <param name="tEnvPAir">对象条件</param>
 /// <returns>对象</returns>
 public TEnvPAirVo Details(TEnvPAirVo tEnvPAir)
 {
     return(access.Details(tEnvPAir));
 }