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

            strSQL += string.Format(" where ID='{0}' ", tEnvPMudSeaV.ID);
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
        /// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tEnvPMudSeaV_UpdateSet">UpdateSet用户对象</param>
        /// <param name="tEnvPMudSeaV_UpdateWhere">UpdateWhere用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TEnvPMudSeaVVo tEnvPMudSeaV_UpdateSet, TEnvPMudSeaVVo tEnvPMudSeaV_UpdateWhere)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tEnvPMudSeaV_UpdateSet, TEnvPMudSeaVVo.T_ENV_P_MUD_SEA_V_TABLE);

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

            strSQL = String.Format(strSQL, BuildWhereStatement(tEnvPMudSeaV));
            return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount)));
        }
        /// <summary>
        /// 对象删除
        /// </summary>
        /// <param name="Id">ID</param>
        /// <returns>是否成功</returns>
        public bool Delete(TEnvPMudSeaVVo tEnvPMudSeaV)
        {
            string strSQL = "delete from T_ENV_P_MUD_SEA_V ";

            strSQL += this.BuildWhereStatement(tEnvPMudSeaV);

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

        TEnvPMudSeaV.ID = Request["id"].ToString();
        TEnvPMudSeaVVo TEnvPRiverVTemp = new TEnvPMudSeaVLogic().Details(TEnvPMudSeaV);

        return(ToJson(TEnvPRiverVTemp));
    }
示例#6
0
    /// <summary>
    /// 修改数据
    /// </summary>
    /// <returns></returns>
    public string frmUpdate()
    {
        TEnvPMudSeaVVo TEnvPMudSeaV = autoBindRequest(Request, new TEnvPMudSeaVVo());

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

        if (isSuccess)
        {
            WriteLog("编辑沉积物(海水)垂线", "", LogInfo.UserInfo.USER_NAME + "编辑沉积物(海水)垂线" + TEnvPMudSeaV.ID);
        }
        return(isSuccess == true ? "1" : "0");
    }
示例#7
0
    /// <summary>
    /// 增加数据
    /// </summary>
    /// <returns></returns>
    public string frmAdd()
    {
        TEnvPMudSeaVVo TEnvPMudSeaV = autoBindRequest(Request, new TEnvPMudSeaVVo());

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

        if (isSuccess)
        {
            WriteLog("添加沉积物(海水)垂线", "", LogInfo.UserInfo.USER_NAME + "添加沉积物(海水)垂线" + TEnvPMudSeaV.ID);
        }
        return(isSuccess == true ? "1" : "0");
    }
        /// <summary>
        /// 根据对象构造条件语句
        /// </summary>
        /// <param name="tEnvPMudSeaV"></param>
        /// <returns></returns>
        public string BuildWhereStatement(TEnvPMudSeaVVo tEnvPMudSeaV)
        {
            StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 ");

            if (null != tEnvPMudSeaV)
            {
                //主键ID
                if (!String.IsNullOrEmpty(tEnvPMudSeaV.ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND ID = '{0}'", tEnvPMudSeaV.ID.ToString()));
                }
                //断面ID
                if (!String.IsNullOrEmpty(tEnvPMudSeaV.SECTION_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND SECTION_ID = '{0}'", tEnvPMudSeaV.SECTION_ID.ToString()));
                }
                //垂线名称
                if (!String.IsNullOrEmpty(tEnvPMudSeaV.VERTICAL_NAME.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND VERTICAL_NAME = '{0}'", tEnvPMudSeaV.VERTICAL_NAME.ToString()));
                }
                //备注1
                if (!String.IsNullOrEmpty(tEnvPMudSeaV.REMARK1.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK1 = '{0}'", tEnvPMudSeaV.REMARK1.ToString()));
                }
                //备注2
                if (!String.IsNullOrEmpty(tEnvPMudSeaV.REMARK2.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK2 = '{0}'", tEnvPMudSeaV.REMARK2.ToString()));
                }
                //备注3
                if (!String.IsNullOrEmpty(tEnvPMudSeaV.REMARK3.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK3 = '{0}'", tEnvPMudSeaV.REMARK3.ToString()));
                }
                //备注4
                if (!String.IsNullOrEmpty(tEnvPMudSeaV.REMARK4.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK4 = '{0}'", tEnvPMudSeaV.REMARK4.ToString()));
                }
                //备注5
                if (!String.IsNullOrEmpty(tEnvPMudSeaV.REMARK5.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK5 = '{0}'", tEnvPMudSeaV.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"]);

        TEnvPMudSeaVVo TEnvPMudSeaV = new TEnvPMudSeaVVo();

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

        return(strJson);
    }
 /// <summary>
 /// 根据对象获取全部数据,用Table承载
 ///  数据量较小时使用【不推荐】
 /// </summary>
 /// <param name="tEnvPMudSeaV"></param>
 /// <returns></returns>
 public DataTable SelectByTable(TEnvPMudSeaVVo tEnvPMudSeaV)
 {
     return(access.SelectByTable(tEnvPMudSeaV));
 }
 /// <summary>
 /// 获取对象List
 /// </summary>
 /// <param name="tEnvPMudSeaV">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public List <TEnvPMudSeaVVo> SelectByObject(TEnvPMudSeaVVo tEnvPMudSeaV, int iIndex, int iCount)
 {
     return(access.SelectByObject(tEnvPMudSeaV, iIndex, iCount));
 }
 /// <summary>
 /// 获取对象DataTable
 /// </summary>
 /// <param name="tEnvPMudSeaV">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public DataTable SelectByTable(TEnvPMudSeaVVo tEnvPMudSeaV, int iIndex, int iCount)
 {
     return(access.SelectByTable(tEnvPMudSeaV, iIndex, iCount));
 }
 /// <summary>
 /// 获得查询结果总行数,用于分页
 /// </summary>
 /// <param name="tEnvPMudSeaV">对象</param>
 /// <returns>返回行数</returns>
 public int GetSelectResultCount(TEnvPMudSeaVVo tEnvPMudSeaV)
 {
     return(access.GetSelectResultCount(tEnvPMudSeaV));
 }
 /// <summary>
 /// 对象明细
 /// </summary>
 /// <param name="tEnvPMudSeaV">对象条件</param>
 /// <returns>对象</returns>
 public TEnvPMudSeaVVo Details(TEnvPMudSeaVVo tEnvPMudSeaV)
 {
     return(access.Details(tEnvPMudSeaV));
 }
 /// <summary>
 /// 对象删除
 /// </summary>
 /// <param name="Id">ID</param>
 /// <returns>是否成功</returns>
 public bool Delete(TEnvPMudSeaVVo tEnvPMudSeaV)
 {
     return(access.Delete(tEnvPMudSeaV));
 }
 public TEnvPMudSeaVLogic(TEnvPMudSeaVVo _tEnvPMudSeaV)
 {
     tEnvPMudSeaV = _tEnvPMudSeaV;
     access       = new TEnvPMudSeaVAccess();
 }
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tEnvPMudSeaV">用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TEnvPMudSeaVVo tEnvPMudSeaV)
 {
     return(access.Edit(tEnvPMudSeaV));
 }
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tEnvPMudSeaV_UpdateSet">UpdateSet用户对象</param>
 /// <param name="tEnvPMudSeaV_UpdateWhere">UpdateWhere用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TEnvPMudSeaVVo tEnvPMudSeaV_UpdateSet, TEnvPMudSeaVVo tEnvPMudSeaV_UpdateWhere)
 {
     return(access.Edit(tEnvPMudSeaV_UpdateSet, tEnvPMudSeaV_UpdateWhere));
 }
 /// <summary>
 /// 根据对象特征获取单一对象
 /// </summary>
 /// <param name="tEnvPMudSeaV">对象</param>
 /// <returns></returns>
 public TEnvPMudSeaVVo SelectByObject(TEnvPMudSeaVVo tEnvPMudSeaV)
 {
     return(access.SelectByObject(tEnvPMudSeaV));
 }
 /// <summary>
 /// 对象添加
 /// </summary>
 /// <param name="sysRole">对象</param>
 /// <returns>是否成功</returns>
 public bool Create(TEnvPMudSeaVVo tEnvPMudSeaV)
 {
     return(access.Create(tEnvPMudSeaV));
 }
        /// <summary>
        /// 根据对象获取全部数据,用Table承载
        ///  数据量较小时使用【不推荐】
        /// </summary>
        /// <param name="tEnvPMudSeaV"></param>
        /// <returns></returns>
        public DataTable SelectByTable(TEnvPMudSeaVVo tEnvPMudSeaV)
        {
            string strSQL = "select * from T_ENV_P_MUD_SEA_V " + this.BuildWhereStatement(tEnvPMudSeaV);

            return(SqlHelper.ExecuteDataTable(strSQL));
        }
        /// <summary>
        /// 对象添加
        /// </summary>
        /// <param name="tEnvPMudSeaV">对象</param>
        /// <returns>是否成功</returns>
        public bool Create(TEnvPMudSeaVVo tEnvPMudSeaV)
        {
            string strSQL = SqlHelper.BuildInsertExpress(tEnvPMudSeaV, TEnvPMudSeaVVo.T_ENV_P_MUD_SEA_V_TABLE);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
        /// <summary>
        /// 获取对象List
        /// </summary>
        /// <param name="tEnvPMudSeaV">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public List <TEnvPMudSeaVVo> SelectByObject(TEnvPMudSeaVVo tEnvPMudSeaV, int iIndex, int iCount)
        {
            string strSQL = String.Format("select * from  T_ENV_P_MUD_SEA_V " + this.BuildWhereStatement(tEnvPMudSeaV));

            return(SqlHelper.ExecuteObjectList(tEnvPMudSeaV, BuildPagerExpress(strSQL, iIndex, iCount)));
        }
        /// <summary>
        /// 对象明细
        /// </summary>
        /// <param name="tEnvPMudSeaV">对象条件</param>
        /// <returns>对象</returns>
        public TEnvPMudSeaVVo Details(TEnvPMudSeaVVo tEnvPMudSeaV)
        {
            string strSQL = String.Format("select * from  T_ENV_P_MUD_SEA_V " + this.BuildWhereStatement(tEnvPMudSeaV));

            return(SqlHelper.ExecuteObject(new TEnvPMudSeaVVo(), strSQL));
        }
        /// <summary>
        /// 获得查询结果总行数,用于分页
        /// </summary>
        /// <param name="tEnvPMudSeaV">对象</param>
        /// <returns>返回行数</returns>
        public int GetSelectResultCount(TEnvPMudSeaVVo tEnvPMudSeaV)
        {
            string strSQL = "select Count(*) from T_ENV_P_MUD_SEA_V " + this.BuildWhereStatement(tEnvPMudSeaV);

            return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL)));
        }