/// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tEnvPRiverV">用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TEnvPRiverVVo tEnvPRiverV)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tEnvPRiverV, TEnvPRiverVVo.T_ENV_P_RIVER_V_TABLE);

            strSQL += string.Format(" where ID='{0}' ", tEnvPRiverV.ID);
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
        /// <summary>
        /// 获取对象DataTable
        /// </summary>
        /// <param name="tEnvPRiverV">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public DataTable SelectByTable(TEnvPRiverVVo tEnvPRiverV, int iIndex, int iCount)
        {
            string strSQL = " select * from T_ENV_P_RIVER_V {0} ";

            strSQL = String.Format(strSQL, BuildWhereStatement(tEnvPRiverV));
            return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount)));
        }
        /// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tEnvPRiverV_UpdateSet">UpdateSet用户对象</param>
        /// <param name="tEnvPRiverV_UpdateWhere">UpdateWhere用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TEnvPRiverVVo tEnvPRiverV_UpdateSet, TEnvPRiverVVo tEnvPRiverV_UpdateWhere)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tEnvPRiverV_UpdateSet, TEnvPRiverVVo.T_ENV_P_RIVER_V_TABLE);

            strSQL += this.BuildWhereStatement(tEnvPRiverV_UpdateWhere);
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
        /// <summary>
        /// 对象删除
        /// </summary>
        /// <param name="Id">ID</param>
        /// <returns>是否成功</returns>
        public bool Delete(TEnvPRiverVVo tEnvPRiverV)
        {
            string strSQL = "delete from T_ENV_P_RIVER_V ";

            strSQL += this.BuildWhereStatement(tEnvPRiverV);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
    /// <summary>
    /// 加载数据
    /// </summary>
    /// <returns></returns>
    public string frmLoadData()
    {
        TEnvPRiverVVo TEnvPRiverV = new TEnvPRiverVVo();

        TEnvPRiverV.ID = Request["id"].ToString();
        TEnvPRiverVVo TEnvPRiverVTemp = new TEnvPRiverVLogic().Details(TEnvPRiverV);

        return(ToJson(TEnvPRiverVTemp));
    }
    /// <summary>
    /// 修改数据
    /// </summary>
    /// <returns></returns>
    public string frmUpdate()
    {
        TEnvPRiverVVo TEnvPRiverV = autoBindRequest(Request, new TEnvPRiverVVo());

        TEnvPRiverV.ID = Request["id"].ToString();
        bool isSuccess = new TEnvPRiverVLogic().Edit(TEnvPRiverV);

        if (isSuccess)
        {
            WriteLog("编辑河流垂线", "", LogInfo.UserInfo.USER_NAME + "编辑河流垂线" + TEnvPRiverV.ID);
        }
        return(isSuccess == true ? "1" : "0");
    }
    /// <summary>
    /// 增加数据
    /// </summary>
    /// <returns></returns>
    public string frmAdd()
    {
        TEnvPRiverVVo TEnvPRiverV = autoBindRequest(Request, new TEnvPRiverVVo());

        TEnvPRiverV.ID         = GetSerialNumber(SerialType.T_ENV_P_RIVER_V);
        TEnvPRiverV.SECTION_ID = this.formId.Value;
        bool isSuccess = new TEnvPRiverVLogic().Create(TEnvPRiverV);

        if (isSuccess)
        {
            WriteLog("添加河流垂线", "", LogInfo.UserInfo.USER_NAME + "添加河流垂线" + TEnvPRiverV.ID);
        }
        return(isSuccess == true ? "1" : "0");
    }
        /// <summary>
        /// 根据对象构造条件语句
        /// </summary>
        /// <param name="tEnvPRiverV"></param>
        /// <returns></returns>
        public string BuildWhereStatement(TEnvPRiverVVo tEnvPRiverV)
        {
            StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 ");

            if (null != tEnvPRiverV)
            {
                //主键ID
                if (!String.IsNullOrEmpty(tEnvPRiverV.ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND ID = '{0}'", tEnvPRiverV.ID.ToString()));
                }
                //河流断面ID
                if (!String.IsNullOrEmpty(tEnvPRiverV.SECTION_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND SECTION_ID = '{0}'", tEnvPRiverV.SECTION_ID.ToString()));
                }
                //垂线名称
                if (!String.IsNullOrEmpty(tEnvPRiverV.VERTICAL_NAME.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND VERTICAL_NAME = '{0}'", tEnvPRiverV.VERTICAL_NAME.ToString()));
                }
                //备注1
                if (!String.IsNullOrEmpty(tEnvPRiverV.REMARK1.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK1 = '{0}'", tEnvPRiverV.REMARK1.ToString()));
                }
                //备注2
                if (!String.IsNullOrEmpty(tEnvPRiverV.REMARK2.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK2 = '{0}'", tEnvPRiverV.REMARK2.ToString()));
                }
                //备注3
                if (!String.IsNullOrEmpty(tEnvPRiverV.REMARK3.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK3 = '{0}'", tEnvPRiverV.REMARK3.ToString()));
                }
                //备注4
                if (!String.IsNullOrEmpty(tEnvPRiverV.REMARK4.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK4 = '{0}'", tEnvPRiverV.REMARK4.ToString()));
                }
                //备注5
                if (!String.IsNullOrEmpty(tEnvPRiverV.REMARK5.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK5 = '{0}'", tEnvPRiverV.REMARK5.ToString()));
                }
            }
            return(strWhereStatement.ToString());
        }
    /// <summary>
    /// 获取垂线信息
    /// </summary>
    /// <param name="oneGridId">断面ID</param>
    /// <returns></returns>
    public string getTwoGridInfo(string oneGridId)
    {
        string strSortname  = Request.Params["sortname"];
        string strSortorder = Request.Params["sortorder"];
        //当前页面
        int intPageIndex = Convert.ToInt32(Request.Params["page"]);
        //每页记录数
        int intPageSize = Convert.ToInt32(Request.Params["pagesize"]);

        TEnvPRiverVVo TEnvPRiverV = new TEnvPRiverVVo();

        TEnvPRiverV.SECTION_ID = oneGridId;
        TEnvPRiverV.SORT_FIELD = strSortname;
        TEnvPRiverV.SORT_TYPE  = strSortorder;
        DataTable dt            = new TEnvPRiverVLogic().SelectByTable(TEnvPRiverV, intPageIndex, intPageSize);
        int       intTotalCount = new TEnvPRiverVLogic().GetSelectResultCount(TEnvPRiverV);
        string    strJson       = CreateToJson(dt, intTotalCount);

        return(strJson);
    }
Exemplo n.º 10
0
 /// <summary>
 /// 获得查询结果总行数,用于分页
 /// </summary>
 /// <param name="tEnvPRiverV">对象</param>
 /// <returns>返回行数</returns>
 public int GetSelectResultCount(TEnvPRiverVVo tEnvPRiverV)
 {
     return(access.GetSelectResultCount(tEnvPRiverV));
 }
        /// <summary>
        /// 对象添加
        /// </summary>
        /// <param name="tEnvPRiverV">对象</param>
        /// <returns>是否成功</returns>
        public bool Create(TEnvPRiverVVo tEnvPRiverV)
        {
            string strSQL = SqlHelper.BuildInsertExpress(tEnvPRiverV, TEnvPRiverVVo.T_ENV_P_RIVER_V_TABLE);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
        /// <summary>
        /// 根据对象特征获取单一对象
        /// </summary>
        /// <param name="tEnvPRiverV">对象</param>
        /// <returns></returns>
        public TEnvPRiverVVo SelectByObject(TEnvPRiverVVo tEnvPRiverV)
        {
            string strSQL = "select * from T_ENV_P_RIVER_V " + this.BuildWhereStatement(tEnvPRiverV);

            return(SqlHelper.ExecuteObject(new TEnvPRiverVVo(), strSQL));
        }
Exemplo n.º 13
0
 /// <summary>
 /// 根据对象获取全部数据,用Table承载
 ///  数据量较小时使用【不推荐】
 /// </summary>
 /// <param name="tEnvPRiverV"></param>
 /// <returns></returns>
 public DataTable SelectByTable(TEnvPRiverVVo tEnvPRiverV)
 {
     return(access.SelectByTable(tEnvPRiverV));
 }
Exemplo n.º 14
0
 /// <summary>
 /// 根据对象特征获取单一对象
 /// </summary>
 /// <param name="tEnvPRiverV">对象</param>
 /// <returns></returns>
 public TEnvPRiverVVo SelectByObject(TEnvPRiverVVo tEnvPRiverV)
 {
     return(access.SelectByObject(tEnvPRiverV));
 }
Exemplo n.º 15
0
 /// <summary>
 /// 对象添加
 /// </summary>
 /// <param name="sysRole">对象</param>
 /// <returns>是否成功</returns>
 public bool Create(TEnvPRiverVVo tEnvPRiverV)
 {
     return(access.Create(tEnvPRiverV));
 }
        /// <summary>
        /// 对象明细
        /// </summary>
        /// <param name="tEnvPRiverV">对象条件</param>
        /// <returns>对象</returns>
        public TEnvPRiverVVo Details(TEnvPRiverVVo tEnvPRiverV)
        {
            string strSQL = String.Format("select * from  T_ENV_P_RIVER_V " + this.BuildWhereStatement(tEnvPRiverV));

            return(SqlHelper.ExecuteObject(new TEnvPRiverVVo(), strSQL));
        }
Exemplo n.º 17
0
 public TEnvPRiverVLogic(TEnvPRiverVVo _tEnvPRiverV)
 {
     tEnvPRiverV = _tEnvPRiverV;
     access      = new TEnvPRiverVAccess();
 }
Exemplo n.º 18
0
 /// <summary>
 /// 对象删除
 /// </summary>
 /// <param name="Id">ID</param>
 /// <returns>是否成功</returns>
 public bool Delete(TEnvPRiverVVo tEnvPRiverV)
 {
     return(access.Delete(tEnvPRiverV));
 }
Exemplo n.º 19
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tEnvPRiverV_UpdateSet">UpdateSet用户对象</param>
 /// <param name="tEnvPRiverV_UpdateWhere">UpdateWhere用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TEnvPRiverVVo tEnvPRiverV_UpdateSet, TEnvPRiverVVo tEnvPRiverV_UpdateWhere)
 {
     return(access.Edit(tEnvPRiverV_UpdateSet, tEnvPRiverV_UpdateWhere));
 }
Exemplo n.º 20
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tEnvPRiverV">用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TEnvPRiverVVo tEnvPRiverV)
 {
     return(access.Edit(tEnvPRiverV));
 }
        /// <summary>
        /// 获得查询结果总行数,用于分页
        /// </summary>
        /// <param name="tEnvPRiverV">对象</param>
        /// <returns>返回行数</returns>
        public int GetSelectResultCount(TEnvPRiverVVo tEnvPRiverV)
        {
            string strSQL = "select Count(*) from T_ENV_P_RIVER_V " + this.BuildWhereStatement(tEnvPRiverV);

            return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL)));
        }
Exemplo n.º 22
0
 /// <summary>
 /// 对象明细
 /// </summary>
 /// <param name="tEnvPRiverV">对象条件</param>
 /// <returns>对象</returns>
 public TEnvPRiverVVo Details(TEnvPRiverVVo tEnvPRiverV)
 {
     return(access.Details(tEnvPRiverV));
 }
        /// <summary>
        /// 获取对象List
        /// </summary>
        /// <param name="tEnvPRiverV">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public List <TEnvPRiverVVo> SelectByObject(TEnvPRiverVVo tEnvPRiverV, int iIndex, int iCount)
        {
            string strSQL = String.Format("select * from  T_ENV_P_RIVER_V " + this.BuildWhereStatement(tEnvPRiverV));

            return(SqlHelper.ExecuteObjectList(tEnvPRiverV, BuildPagerExpress(strSQL, iIndex, iCount)));
        }
Exemplo n.º 24
0
 /// <summary>
 /// 获取对象List
 /// </summary>
 /// <param name="tEnvPRiverV">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public List <TEnvPRiverVVo> SelectByObject(TEnvPRiverVVo tEnvPRiverV, int iIndex, int iCount)
 {
     return(access.SelectByObject(tEnvPRiverV, iIndex, iCount));
 }
        /// <summary>
        /// 根据对象获取全部数据,用Table承载
        ///  数据量较小时使用【不推荐】
        /// </summary>
        /// <param name="tEnvPRiverV"></param>
        /// <returns></returns>
        public DataTable SelectByTable(TEnvPRiverVVo tEnvPRiverV)
        {
            string strSQL = "select * from T_ENV_P_RIVER_V " + this.BuildWhereStatement(tEnvPRiverV);

            return(SqlHelper.ExecuteDataTable(strSQL));
        }
Exemplo n.º 26
0
 /// <summary>
 /// 获取对象DataTable
 /// </summary>
 /// <param name="tEnvPRiverV">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public DataTable SelectByTable(TEnvPRiverVVo tEnvPRiverV, int iIndex, int iCount)
 {
     return(access.SelectByTable(tEnvPRiverV, iIndex, iCount));
 }