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

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

            strSQL = String.Format(strSQL, BuildWhereStatement(tEnvFillDrinkSrc));
            return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount)));
        }
Пример #3
0
        /// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tEnvFillDrinkSrc_UpdateSet">UpdateSet用户对象</param>
        /// <param name="tEnvFillDrinkSrc_UpdateWhere">UpdateWhere用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TEnvFillDrinkSrcVo tEnvFillDrinkSrc_UpdateSet, TEnvFillDrinkSrcVo tEnvFillDrinkSrc_UpdateWhere)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tEnvFillDrinkSrc_UpdateSet, TEnvFillDrinkSrcVo.T_ENV_FILL_DRINK_SRC_TABLE);

            strSQL += this.BuildWhereStatement(tEnvFillDrinkSrc_UpdateWhere);
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
Пример #4
0
        /// <summary>
        /// 对象删除
        /// </summary>
        /// <param name="Id">ID</param>
        /// <returns>是否成功</returns>
        public bool Delete(TEnvFillDrinkSrcVo tEnvFillDrinkSrc)
        {
            string strSQL = "delete from T_ENV_FILL_DRINK_SRC ";

            strSQL += this.BuildWhereStatement(tEnvFillDrinkSrc);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
    private void GetFillID()
    {
        string year  = Request["year"];
        string month = Request["month"];

        TEnvFillDrinkSrcVo envFillDrinkSrcVo = new TEnvFillDrinkSrcVo();

        envFillDrinkSrcVo.YEAR  = year;
        envFillDrinkSrcVo.MONTH = month;

        envFillDrinkSrcVo = new TEnvFillDrinkSrcLogic().Details(envFillDrinkSrcVo);

        string json = "{\"ID\":\"" + envFillDrinkSrcVo.ID + "\",\"STATUS\":\"" + envFillDrinkSrcVo.STATUS + "\"}";

        Response.ContentType = "application/json;charset=utf-8";
        Response.Write(json);
        Response.End();
    }
    private string SaveFWData(string save, string filltype, string ID)
    {
        bool   flag      = false;
        string head      = string.Empty;
        string strResult = string.Empty;

        if (!string.IsNullOrEmpty(filltype))
        {
            switch (filltype)
            {
            case "SeaFill":
                TEnvFillSeaVo sea = new TEnvFillSeaVo();
                sea.ID = GetSerialNumber(SerialType.T_ENV_FILL_SEA);
                head   = sea.ID;
                flag   = new TEnvFillSeaLogic().Create(sea);
                break;

            case "DrinkSource":
                TEnvFillDrinkSrcVo Drink = new TEnvFillDrinkSrcVo();
                Drink.ID = GetSerialNumber(SerialType.T_ENV_FILL_DRINK_SRC);
                head     = Drink.ID;
                flag     = new TEnvFillDrinkSrcLogic().Create(Drink);
                break;

            case "Payfor":
                TEnvFillPayforVo payfor = new TEnvFillPayforVo();
                payfor.ID = GetSerialNumber(SerialType.T_ENV_FILL_PAYFOR);
                head      = payfor.ID;
                flag      = new TEnvFillPayforLogic().Create(payfor);
                break;
            }
            if (flag == true)
            {
                strResult = head;
            }
            else
            {
                strResult = "";
            }
        }
        return(strResult);
    }
Пример #7
0
 /// <summary>
 /// 获得查询结果总行数,用于分页
 /// </summary>
 /// <param name="tEnvFillDrinkSrc">对象</param>
 /// <returns>返回行数</returns>
 public int GetSelectResultCount(TEnvFillDrinkSrcVo tEnvFillDrinkSrc)
 {
     return(access.GetSelectResultCount(tEnvFillDrinkSrc));
 }
Пример #8
0
 /// <summary>
 /// 根据对象特征获取单一对象
 /// </summary>
 /// <param name="tEnvFillDrinkSrc">对象</param>
 /// <returns></returns>
 public TEnvFillDrinkSrcVo SelectByObject(TEnvFillDrinkSrcVo tEnvFillDrinkSrc)
 {
     return(access.SelectByObject(tEnvFillDrinkSrc));
 }
Пример #9
0
 /// <summary>
 /// 对象添加
 /// </summary>
 /// <param name="sysRole">对象</param>
 /// <returns>是否成功</returns>
 public bool Create(TEnvFillDrinkSrcVo tEnvFillDrinkSrc)
 {
     return(access.Create(tEnvFillDrinkSrc));
 }
Пример #10
0
        /// <summary>
        /// 对象添加
        /// </summary>
        /// <param name="tEnvFillDrinkSrc">对象</param>
        /// <returns>是否成功</returns>
        public bool Create(TEnvFillDrinkSrcVo tEnvFillDrinkSrc)
        {
            string strSQL = SqlHelper.BuildInsertExpress(tEnvFillDrinkSrc, TEnvFillDrinkSrcVo.T_ENV_FILL_DRINK_SRC_TABLE);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
Пример #11
0
 /// <summary>
 /// 根据对象获取全部数据,用Table承载
 ///  数据量较小时使用【不推荐】
 /// </summary>
 /// <param name="tEnvFillDrinkSrc"></param>
 /// <returns></returns>
 public DataTable SelectByTable(TEnvFillDrinkSrcVo tEnvFillDrinkSrc)
 {
     return(access.SelectByTable(tEnvFillDrinkSrc));
 }
Пример #12
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tEnvFillDrinkSrc">用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TEnvFillDrinkSrcVo tEnvFillDrinkSrc)
 {
     return(access.Edit(tEnvFillDrinkSrc));
 }
Пример #13
0
        /// <summary>
        /// 对象明细
        /// </summary>
        /// <param name="tEnvFillDrinkSrc">对象条件</param>
        /// <returns>对象</returns>
        public TEnvFillDrinkSrcVo Details(TEnvFillDrinkSrcVo tEnvFillDrinkSrc)
        {
            string strSQL = String.Format("select * from  T_ENV_FILL_DRINK_SRC " + this.BuildWhereStatement(tEnvFillDrinkSrc));

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

            if (null != tEnvFillDrinkSrc)
            {
                //主键ID
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND ID = '{0}'", tEnvFillDrinkSrc.ID.ToString()));
                }
                //断面ID
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.SECTION_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND SECTION_ID = '{0}'", tEnvFillDrinkSrc.SECTION_ID.ToString()));
                }
                //监测点ID
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.POINT_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND POINT_ID = '{0}'", tEnvFillDrinkSrc.POINT_ID.ToString()));
                }
                //采样日期
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.SAMPLING_DAY.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND SAMPLING_DAY = '{0}'", tEnvFillDrinkSrc.SAMPLING_DAY.ToString()));
                }
                //年度
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.YEAR.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND YEAR = '{0}'", tEnvFillDrinkSrc.YEAR.ToString()));
                }
                //月份
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.MONTH.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND MONTH = '{0}'", tEnvFillDrinkSrc.MONTH.ToString()));
                }
                //日
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.DAY.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND DAY = '{0}'", tEnvFillDrinkSrc.DAY.ToString()));
                }
                //时
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.HOUR.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND HOUR = '{0}'", tEnvFillDrinkSrc.HOUR.ToString()));
                }
                //分
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.MINUTE.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND MINUTE = '{0}'", tEnvFillDrinkSrc.MINUTE.ToString()));
                }
                //枯水期、平水期、枯水期
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.KPF.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND KPF = '{0}'", tEnvFillDrinkSrc.KPF.ToString()));
                }
                //评价
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.JUDGE.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND JUDGE = '{0}'", tEnvFillDrinkSrc.JUDGE.ToString()));
                }
                //超标污染类别污染物
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.OVERPROOF.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND OVERPROOF = '{0}'", tEnvFillDrinkSrc.OVERPROOF.ToString()));
                }
                //备注1
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.REMARK1.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK1 = '{0}'", tEnvFillDrinkSrc.REMARK1.ToString()));
                }
                //备注2
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.REMARK2.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK2 = '{0}'", tEnvFillDrinkSrc.REMARK2.ToString()));
                }
                //备注3
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.REMARK3.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK3 = '{0}'", tEnvFillDrinkSrc.REMARK3.ToString()));
                }
                //备注4
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.REMARK4.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK4 = '{0}'", tEnvFillDrinkSrc.REMARK4.ToString()));
                }
                //备注5
                if (!String.IsNullOrEmpty(tEnvFillDrinkSrc.REMARK5.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK5 = '{0}'", tEnvFillDrinkSrc.REMARK5.ToString()));
                }
            }
            return(strWhereStatement.ToString());
        }
Пример #15
0
 public TEnvFillDrinkSrcLogic(TEnvFillDrinkSrcVo _tEnvFillDrinkSrc)
 {
     tEnvFillDrinkSrc = _tEnvFillDrinkSrc;
     access           = new TEnvFillDrinkSrcAccess();
 }
Пример #16
0
 /// <summary>
 /// 对象删除
 /// </summary>
 /// <param name="Id">ID</param>
 /// <returns>是否成功</returns>
 public bool Delete(TEnvFillDrinkSrcVo tEnvFillDrinkSrc)
 {
     return(access.Delete(tEnvFillDrinkSrc));
 }
Пример #17
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tEnvFillDrinkSrc_UpdateSet">UpdateSet用户对象</param>
 /// <param name="tEnvFillDrinkSrc_UpdateWhere">UpdateWhere用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TEnvFillDrinkSrcVo tEnvFillDrinkSrc_UpdateSet, TEnvFillDrinkSrcVo tEnvFillDrinkSrc_UpdateWhere)
 {
     return(access.Edit(tEnvFillDrinkSrc_UpdateSet, tEnvFillDrinkSrc_UpdateWhere));
 }
Пример #18
0
        /// <summary>
        /// 获得查询结果总行数,用于分页
        /// </summary>
        /// <param name="tEnvFillDrinkSrc">对象</param>
        /// <returns>返回行数</returns>
        public int GetSelectResultCount(TEnvFillDrinkSrcVo tEnvFillDrinkSrc)
        {
            string strSQL = "select Count(*) from T_ENV_FILL_DRINK_SRC " + this.BuildWhereStatement(tEnvFillDrinkSrc);

            return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL)));
        }
Пример #19
0
 /// <summary>
 /// 对象明细
 /// </summary>
 /// <param name="tEnvFillDrinkSrc">对象条件</param>
 /// <returns>对象</returns>
 public TEnvFillDrinkSrcVo Details(TEnvFillDrinkSrcVo tEnvFillDrinkSrc)
 {
     return(access.Details(tEnvFillDrinkSrc));
 }
Пример #20
0
        /// <summary>
        /// 获取对象List
        /// </summary>
        /// <param name="tEnvFillDrinkSrc">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public List <TEnvFillDrinkSrcVo> SelectByObject(TEnvFillDrinkSrcVo tEnvFillDrinkSrc, int iIndex, int iCount)
        {
            string strSQL = String.Format("select * from  T_ENV_FILL_DRINK_SRC " + this.BuildWhereStatement(tEnvFillDrinkSrc));

            return(SqlHelper.ExecuteObjectList(tEnvFillDrinkSrc, BuildPagerExpress(strSQL, iIndex, iCount)));
        }
Пример #21
0
 /// <summary>
 /// 获取对象List
 /// </summary>
 /// <param name="tEnvFillDrinkSrc">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public List <TEnvFillDrinkSrcVo> SelectByObject(TEnvFillDrinkSrcVo tEnvFillDrinkSrc, int iIndex, int iCount)
 {
     return(access.SelectByObject(tEnvFillDrinkSrc, iIndex, iCount));
 }
Пример #22
0
        /// <summary>
        /// 根据对象获取全部数据,用Table承载
        ///  数据量较小时使用【不推荐】
        /// </summary>
        /// <param name="tEnvFillDrinkSrc"></param>
        /// <returns></returns>
        public DataTable SelectByTable(TEnvFillDrinkSrcVo tEnvFillDrinkSrc)
        {
            string strSQL = "select * from T_ENV_FILL_DRINK_SRC " + this.BuildWhereStatement(tEnvFillDrinkSrc);

            return(SqlHelper.ExecuteDataTable(strSQL));
        }
Пример #23
0
 /// <summary>
 /// 获取对象DataTable
 /// </summary>
 /// <param name="tEnvFillDrinkSrc">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public DataTable SelectByTable(TEnvFillDrinkSrcVo tEnvFillDrinkSrc, int iIndex, int iCount)
 {
     return(access.SelectByTable(tEnvFillDrinkSrc, iIndex, iCount));
 }