コード例 #1
0
        /// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tBaseAttributeType_UpdateSet">UpdateSet用户对象</param>
        /// <param name="tBaseAttributeType_UpdateWhere">UpdateWhere用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TBaseAttributeTypeVo tBaseAttributeType_UpdateSet, TBaseAttributeTypeVo tBaseAttributeType_UpdateWhere)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tBaseAttributeType_UpdateSet, TBaseAttributeTypeVo.T_BASE_ATTRIBUTE_TYPE_TABLE);

            strSQL += this.BuildWhereStatement(tBaseAttributeType_UpdateWhere);
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
コード例 #2
0
        /// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tBaseAttributeType">用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TBaseAttributeTypeVo tBaseAttributeType)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tBaseAttributeType, TBaseAttributeTypeVo.T_BASE_ATTRIBUTE_TYPE_TABLE);

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

            strSQL = String.Format(strSQL, BuildWhereStatement(tBaseAttributeType));
            return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount)));
        }
コード例 #4
0
    /// <summary>
    /// 获取属性类别信息
    /// </summary>
    /// <returns></returns>
    private string getAttributeTypeInfo()
    {
        string strSortname  = Request.Params["sortname"];
        string strSortorder = Request.Params["sortorder"];
        //当前页面
        int intPageIndex = Convert.ToInt32(Request.Params["page"]);
        //每页记录数
        int intPageSize = Convert.ToInt32(Request.Params["pagesize"]);

        TBaseAttributeTypeVo TBaseAttributeTypeVo = new TBaseAttributeTypeVo();

        TBaseAttributeTypeVo.IS_DEL     = "0";
        TBaseAttributeTypeVo.SORT_FIELD = strSortname;
        TBaseAttributeTypeVo.SORT_TYPE  = strSortorder;
        int       intTotalCount = 0;
        DataTable dt            = new DataTable();

        if (!String.IsNullOrEmpty(srhSortName) || !String.IsNullOrEmpty(srhMonitorId))
        {
            TBaseAttributeTypeVo.SORT_NAME  = srhSortName;
            TBaseAttributeTypeVo.MONITOR_ID = srhMonitorId;
            intTotalCount = new TBaseAttributeTypeLogic().GetSelecDefinedtResultCount(TBaseAttributeTypeVo);
            dt            = new TBaseAttributeTypeLogic().SelectDefinedTadble(TBaseAttributeTypeVo, intPageIndex, intPageSize);
        }
        else
        {
            dt            = new TBaseAttributeTypeLogic().SelectByTable(TBaseAttributeTypeVo, intPageIndex, intPageSize);
            intTotalCount = new TBaseAttributeTypeLogic().GetSelectResultCount(TBaseAttributeTypeVo);
        }
        string strJson = CreateToJson(dt, intTotalCount);

        return(strJson);
    }
コード例 #5
0
        /// <summary>
        /// 对象删除
        /// </summary>
        /// <param name="Id">ID</param>
        /// <returns>是否成功</returns>
        public bool Delete(TBaseAttributeTypeVo tBaseAttributeType)
        {
            string strSQL = "delete from T_BASE_ATTRIBUTE_TYPE ";

            strSQL += this.BuildWhereStatement(tBaseAttributeType);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
コード例 #6
0
    /// <summary>
    /// 获取属性类别信息
    /// </summary>
    /// <returns></returns>
    public static string getAttributeTypeInfo()
    {
        TBaseAttributeTypeVo TBaseAttributeTypeVo = new TBaseAttributeTypeVo();

        TBaseAttributeTypeVo.IS_DEL = "0";
        DataTable dt = new TBaseAttributeTypeLogic().SelectByTable(TBaseAttributeTypeVo);

        return(DataTableToJson(dt));
    }
コード例 #7
0
    /// <summary>
    /// 加载数据
    /// </summary>
    /// <returns></returns>
    public string frmLoadData()
    {
        TBaseAttributeTypeVo TBaseAttributeTypeVo = new TBaseAttributeTypeVo();

        TBaseAttributeTypeVo.ID     = Request["id"].ToString();
        TBaseAttributeTypeVo.IS_DEL = "0";
        TBaseAttributeTypeVo TBaseAttributeTypeVoTemp = new TBaseAttributeTypeLogic().Details(TBaseAttributeTypeVo);

        return(ToJson(TBaseAttributeTypeVoTemp));
    }
コード例 #8
0
    /// <summary>
    /// 修改数据
    /// </summary>
    /// <returns></returns>
    public string frmUpdate()
    {
        TBaseAttributeTypeVo TBaseAttributeTypeVo = autoBindRequest(Request, new TBaseAttributeTypeVo());

        TBaseAttributeTypeVo.ID     = Request["id"].ToString();
        TBaseAttributeTypeVo.IS_DEL = "0";
        bool isSuccess = new TBaseAttributeTypeLogic().Edit(TBaseAttributeTypeVo);

        if (isSuccess)
        {
            new PageBase().WriteLog("修改属性类别", "", new PageBase().LogInfo.UserInfo.USER_NAME + "修改属性类别" + TBaseAttributeTypeVo.ID + "成功");
        }
        return(isSuccess == true ? "1" : "0");
    }
コード例 #9
0
    public static string deleteAttributeTypeInfo(string strValue)
    {
        TBaseAttributeTypeVo TBaseAttributeTypeVo = new TBaseAttributeTypeVo();

        TBaseAttributeTypeVo.ID     = strValue;
        TBaseAttributeTypeVo.IS_DEL = "1";
        bool isSuccess = new TBaseAttributeTypeLogic().Edit(TBaseAttributeTypeVo);

        if (isSuccess)
        {
            new PageBase().WriteLog("删除属性类别", "", new PageBase().LogInfo.UserInfo.USER_NAME + "删除属性类别" + TBaseAttributeTypeVo.ID + "成功");
        }
        return(isSuccess == true ? "1" : "0");
    }
コード例 #10
0
    /// <summary>
    /// 增加数据
    /// </summary>
    /// <returns></returns>
    public string frmAdd()
    {
        TBaseAttributeTypeVo TBaseAttributeTypeVo = autoBindRequest(Request, new TBaseAttributeTypeVo());

        TBaseAttributeTypeVo.ID     = GetSerialNumber("AttributeType_Id");
        TBaseAttributeTypeVo.IS_DEL = "0";
        bool isSuccess = new TBaseAttributeTypeLogic().Create(TBaseAttributeTypeVo);

        if (isSuccess)
        {
            new PageBase().WriteLog("增加属性类别", "", new PageBase().LogInfo.UserInfo.USER_NAME + "增加属性类别" + TBaseAttributeTypeVo.ID + "成功");
        }
        return(isSuccess == true ? "1" : "0");
    }
コード例 #11
0
        /// <summary>
        /// 自定义查询  Create By Castle(胡方扬)  2012-11-19
        /// </summary>
        /// <param name="tBaseAttributeType">对象</param>
        /// <param name="iIndex">起始页</param>
        /// <param name="iCount">条数</param>
        /// <returns></returns>
        public DataTable SelectDefinedTadble(TBaseAttributeTypeVo tBaseAttributeType, int iIndex, int iCount)
        {
            string strSQL = String.Format("SELECT * FROM T_BASE_ATTRIBUTE_TYPE WHERE IS_DEL='{0}'", tBaseAttributeType.IS_DEL);

            if (!String.IsNullOrEmpty(tBaseAttributeType.SORT_NAME))
            {
                strSQL += String.Format("  AND SORT_NAME LIKE '%{0}%'", tBaseAttributeType.SORT_NAME);
            }
            if (!String.IsNullOrEmpty(tBaseAttributeType.MONITOR_ID))
            {
                strSQL += String.Format("  AND MONITOR_ID ='{0}'", tBaseAttributeType.MONITOR_ID);
            }

            return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount)));
        }
コード例 #12
0
        /// <summary>
        /// 获取自定义查询结果总数  Create By Castle(胡方扬)  2012-11-19
        /// </summary>
        /// <param name="tBaseAttributeType">对象</param>
        /// <returns></returns>
        public int GetSelecDefinedtResultCount(TBaseAttributeTypeVo tBaseAttributeType)
        {
            string strSQL = String.Format("SELECT * FROM T_BASE_ATTRIBUTE_TYPE WHERE IS_DEL='{0}'", tBaseAttributeType.IS_DEL);

            if (!String.IsNullOrEmpty(tBaseAttributeType.SORT_NAME))
            {
                strSQL += String.Format("  AND SORT_NAME LIKE '%{0}%'", tBaseAttributeType.SORT_NAME);
            }
            if (!String.IsNullOrEmpty(tBaseAttributeType.MONITOR_ID))
            {
                strSQL += String.Format("  AND MONITOR_ID ='{0}'", tBaseAttributeType.MONITOR_ID);
            }

            return(SqlHelper.ExecuteDataTable(strSQL).Rows.Count);
        }
コード例 #13
0
 /// <summary>
 /// 获得查询结果总行数,用于分页
 /// </summary>
 /// <param name="tBaseAttributeType">对象</param>
 /// <returns>返回行数</returns>
 public int GetSelectResultCount(TBaseAttributeTypeVo tBaseAttributeType)
 {
     return(access.GetSelectResultCount(tBaseAttributeType));
 }
コード例 #14
0
 public TBaseAttributeTypeLogic(TBaseAttributeTypeVo _tBaseAttributeType)
 {
     tBaseAttributeType = _tBaseAttributeType;
     access             = new TBaseAttributeTypeAccess();
 }
コード例 #15
0
 /// <summary>
 /// 对象删除
 /// </summary>
 /// <param name="Id">ID</param>
 /// <returns>是否成功</returns>
 public bool Delete(TBaseAttributeTypeVo tBaseAttributeType)
 {
     return(access.Delete(tBaseAttributeType));
 }
コード例 #16
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tBaseAttributeType_UpdateSet">UpdateSet用户对象</param>
 /// <param name="tBaseAttributeType_UpdateWhere">UpdateWhere用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TBaseAttributeTypeVo tBaseAttributeType_UpdateSet, TBaseAttributeTypeVo tBaseAttributeType_UpdateWhere)
 {
     return(access.Edit(tBaseAttributeType_UpdateSet, tBaseAttributeType_UpdateWhere));
 }
コード例 #17
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tBaseAttributeType">用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TBaseAttributeTypeVo tBaseAttributeType)
 {
     return(access.Edit(tBaseAttributeType));
 }
コード例 #18
0
 /// <summary>
 /// 对象添加
 /// </summary>
 /// <param name="sysRole">对象</param>
 /// <returns>是否成功</returns>
 public bool Create(TBaseAttributeTypeVo tBaseAttributeType)
 {
     return(access.Create(tBaseAttributeType));
 }
コード例 #19
0
 /// <summary>
 /// 根据对象特征获取单一对象
 /// </summary>
 /// <param name="tBaseAttributeType">对象</param>
 /// <returns></returns>
 public TBaseAttributeTypeVo SelectByObject(TBaseAttributeTypeVo tBaseAttributeType)
 {
     return(access.SelectByObject(tBaseAttributeType));
 }
コード例 #20
0
        /// <summary>
        /// 获取对象List
        /// </summary>
        /// <param name="tBaseAttributeType">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public List <TBaseAttributeTypeVo> SelectByObject(TBaseAttributeTypeVo tBaseAttributeType, int iIndex, int iCount)
        {
            string strSQL = String.Format("select * from  T_BASE_ATTRIBUTE_TYPE " + this.BuildWhereStatement(tBaseAttributeType));

            return(SqlHelper.ExecuteObjectList(tBaseAttributeType, BuildPagerExpress(strSQL, iIndex, iCount)));
        }
コード例 #21
0
 /// <summary>
 /// 对象明细
 /// </summary>
 /// <param name="tBaseAttributeType">对象条件</param>
 /// <returns>对象</returns>
 public TBaseAttributeTypeVo Details(TBaseAttributeTypeVo tBaseAttributeType)
 {
     return(access.Details(tBaseAttributeType));
 }
コード例 #22
0
        /// <summary>
        /// 根据对象构造条件语句
        /// </summary>
        /// <param name="tBaseAttributeType"></param>
        /// <returns></returns>
        public string BuildWhereStatement(TBaseAttributeTypeVo tBaseAttributeType)
        {
            StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 ");

            if (null != tBaseAttributeType)
            {
                //ID
                if (!String.IsNullOrEmpty(tBaseAttributeType.ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND ID = '{0}'", tBaseAttributeType.ID.ToString()));
                }
                //监测类别(废水和废气、环境空气和废气、土壤和固体废弃物、噪声和震动、电磁辐射及放射性、其它)
                if (!String.IsNullOrEmpty(tBaseAttributeType.MONITOR_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND MONITOR_ID = '{0}'", tBaseAttributeType.MONITOR_ID.ToString()));
                }
                //类别名称
                if (!String.IsNullOrEmpty(tBaseAttributeType.SORT_NAME.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND SORT_NAME = '{0}'", tBaseAttributeType.SORT_NAME.ToString()));
                }
                //添加人
                if (!String.IsNullOrEmpty(tBaseAttributeType.INSERT_BY.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND INSERT_BY = '{0}'", tBaseAttributeType.INSERT_BY.ToString()));
                }
                //添加时间
                if (!String.IsNullOrEmpty(tBaseAttributeType.INSERT_DATE.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND INSERT_DATE = '{0}'", tBaseAttributeType.INSERT_DATE.ToString()));
                }
                //使用状态(0为启用、1为停用)
                if (!String.IsNullOrEmpty(tBaseAttributeType.IS_DEL.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND IS_DEL = '{0}'", tBaseAttributeType.IS_DEL.ToString()));
                }
                //备注1
                if (!String.IsNullOrEmpty(tBaseAttributeType.REMARK1.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK1 = '{0}'", tBaseAttributeType.REMARK1.ToString()));
                }
                //备注2
                if (!String.IsNullOrEmpty(tBaseAttributeType.REMARK2.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK2 = '{0}'", tBaseAttributeType.REMARK2.ToString()));
                }
                //备注3
                if (!String.IsNullOrEmpty(tBaseAttributeType.REMARK3.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK3 = '{0}'", tBaseAttributeType.REMARK3.ToString()));
                }
                //备注4
                if (!String.IsNullOrEmpty(tBaseAttributeType.REMARK4.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK4 = '{0}'", tBaseAttributeType.REMARK4.ToString()));
                }
                //备注5
                if (!String.IsNullOrEmpty(tBaseAttributeType.REMARK5.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK5 = '{0}'", tBaseAttributeType.REMARK5.ToString()));
                }
            }
            return(strWhereStatement.ToString());
        }
コード例 #23
0
 /// <summary>
 /// 获取对象DataTable
 /// </summary>
 /// <param name="tBaseAttributeType">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public DataTable SelectByTable(TBaseAttributeTypeVo tBaseAttributeType, int iIndex, int iCount)
 {
     return(access.SelectByTable(tBaseAttributeType, iIndex, iCount));
 }
コード例 #24
0
        /// <summary>
        /// 获得查询结果总行数,用于分页
        /// </summary>
        /// <param name="tBaseAttributeType">对象</param>
        /// <returns>返回行数</returns>
        public int GetSelectResultCount(TBaseAttributeTypeVo tBaseAttributeType)
        {
            string strSQL = "select Count(*) from T_BASE_ATTRIBUTE_TYPE " + this.BuildWhereStatement(tBaseAttributeType);

            return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL)));
        }
コード例 #25
0
        /// <summary>
        /// 根据对象获取全部数据,用Table承载
        ///  数据量较小时使用【不推荐】
        /// </summary>
        /// <param name="tBaseAttributeType"></param>
        /// <returns></returns>
        public DataTable SelectByTable(TBaseAttributeTypeVo tBaseAttributeType)
        {
            string strSQL = "select * from T_BASE_ATTRIBUTE_TYPE " + this.BuildWhereStatement(tBaseAttributeType);

            return(SqlHelper.ExecuteDataTable(strSQL));
        }
コード例 #26
0
 /// <summary>
 /// 获取对象List
 /// </summary>
 /// <param name="tBaseAttributeType">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public List <TBaseAttributeTypeVo> SelectByObject(TBaseAttributeTypeVo tBaseAttributeType, int iIndex, int iCount)
 {
     return(access.SelectByObject(tBaseAttributeType, iIndex, iCount));
 }
コード例 #27
0
        /// <summary>
        /// 对象明细
        /// </summary>
        /// <param name="tBaseAttributeType">对象条件</param>
        /// <returns>对象</returns>
        public TBaseAttributeTypeVo Details(TBaseAttributeTypeVo tBaseAttributeType)
        {
            string strSQL = String.Format("select * from  T_BASE_ATTRIBUTE_TYPE " + this.BuildWhereStatement(tBaseAttributeType));

            return(SqlHelper.ExecuteObject(new TBaseAttributeTypeVo(), strSQL));
        }
コード例 #28
0
 /// <summary>
 /// 根据对象获取全部数据,用Table承载
 ///  数据量较小时使用【不推荐】
 /// </summary>
 /// <param name="tBaseAttributeType"></param>
 /// <returns></returns>
 public DataTable SelectByTable(TBaseAttributeTypeVo tBaseAttributeType)
 {
     return(access.SelectByTable(tBaseAttributeType));
 }
コード例 #29
0
        /// <summary>
        /// 对象添加
        /// </summary>
        /// <param name="tBaseAttributeType">对象</param>
        /// <returns>是否成功</returns>
        public bool Create(TBaseAttributeTypeVo tBaseAttributeType)
        {
            string strSQL = SqlHelper.BuildInsertExpress(tBaseAttributeType, TBaseAttributeTypeVo.T_BASE_ATTRIBUTE_TYPE_TABLE);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }