Ejemplo n.º 1
0
        /// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tBaseIndustryItem">用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TBaseIndustryItemVo tBaseIndustryItem)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tBaseIndustryItem, TBaseIndustryItemVo.T_BASE_INDUSTRY_ITEM_TABLE);

            strSQL += string.Format(" where ID='{0}' ", tBaseIndustryItem.ID);
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
Ejemplo n.º 2
0
    public static string SaveDataItem(string strIndustryID, string strSelItem_IDs)
    {
        bool isSuccess = true;

        string[] arrSelItemId = strSelItem_IDs.Split(',');

        TBaseIndustryItemVo objItemWhere = new TBaseIndustryItemVo();

        objItemWhere.INDUSTRY_ID = strIndustryID;
        new TBaseIndustryItemLogic().Delete(objItemWhere);

        for (int i = 0; i < arrSelItemId.Length; i++)
        {
            TBaseIndustryItemVo objItem = new TBaseIndustryItemVo();
            objItem.ID          = GetSerialNumber("t_base_industry_item_id");
            objItem.INDUSTRY_ID = strIndustryID;
            objItem.ITEM_ID     = arrSelItemId[i];

            isSuccess = new TBaseIndustryItemLogic().Create(objItem);
            if (isSuccess)
            {
                new PageBase().WriteLog("新增行业项目", "", new PageBase().LogInfo.UserInfo.USER_NAME + "新增行业项目" + objItem.ID + "成功");
            }
        }

        if (isSuccess)
        {
            return("1");
        }
        else
        {
            return("0");
        }
    }
Ejemplo n.º 3
0
    //获取指定行业的监测项目信息
    private string GetSubData()
    {
        string strSortname  = Request.Params["sortname"];
        string strSortorder = Request.Params["sortorder"];
        int    intPageIdx   = Convert.ToInt32(Request.Params["page"]);
        int    intPagesize  = Convert.ToInt32(Request.Params["pagesize"]);

        string selIndustryID = (Request.Params["selIndustryID"] != null) ? Request.Params["selIndustryID"] : "";

        if (selIndustryID.Length <= 0)
        {
            return("");
        }

        if (strSortname == null || strSortname.Length < 0)
        {
            strSortname = TBaseIndustryItemVo.ID_FIELD;
        }

        TBaseIndustryItemVo objItem = new TBaseIndustryItemVo();

        objItem.INDUSTRY_ID = selIndustryID;
        objItem.SORT_FIELD  = strSortname;
        objItem.SORT_TYPE   = strSortorder;
        TBaseIndustryItemLogic logicItem = new TBaseIndustryItemLogic();

        int       intTotalCount = logicItem.GetSelectResultCount(objItem);;//总计的数据条数
        DataTable dt            = logicItem.SelectByTable(objItem, intPageIdx, intPagesize);

        string strJson = CreateToJson(dt, intTotalCount);

        return(strJson);
    }
Ejemplo n.º 4
0
        /// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tBaseIndustryItem_UpdateSet">UpdateSet用户对象</param>
        /// <param name="tBaseIndustryItem_UpdateWhere">UpdateWhere用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TBaseIndustryItemVo tBaseIndustryItem_UpdateSet, TBaseIndustryItemVo tBaseIndustryItem_UpdateWhere)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tBaseIndustryItem_UpdateSet, TBaseIndustryItemVo.T_BASE_INDUSTRY_ITEM_TABLE);

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

            strSQL = String.Format(strSQL, BuildWhereStatement(tBaseIndustryItem));
            return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount)));
        }
Ejemplo n.º 6
0
    protected void BindList()
    {
        TBaseItemInfoVo objItem = new TBaseItemInfoVo();

        objItem.IS_DEL = "0";
        List <TBaseItemInfoVo> lstItem = new TBaseItemInfoLogic().SelectByObject(objItem, 0, 0);

        lstItem.Sort(delegate(TBaseItemInfoVo a, TBaseItemInfoVo b) {
            if (a.MONITOR_ID.CompareTo(b.MONITOR_ID) == 0)
            {
                return(a.ORDER_NUM.CompareTo(b.ORDER_NUM));
            }
            else
            {
                return(a.MONITOR_ID.CompareTo(b.MONITOR_ID));
            }
        });

        for (int i = 0; i < lstItem.Count; i++)
        {
            lstItem[i].ITEM_NAME = new TBaseMonitorTypeInfoLogic().Details(lstItem[i].MONITOR_ID).MONITOR_TYPE_NAME + "—" + lstItem[i].ITEM_NAME;
        }

        this.ListBox1.DataSource     = lstItem;
        this.ListBox1.DataValueField = TBaseItemInfoVo.ID_FIELD;
        this.ListBox1.DataTextField  = TBaseItemInfoVo.ITEM_NAME_FIELD;
        this.ListBox1.DataBind();

        TBaseIndustryItemVo objIndustryItem = new TBaseIndustryItemVo();

        objIndustryItem.INDUSTRY_ID = this.Request["IndustryID"].ToString();
        List <TBaseIndustryItemVo> lstIndustryItem = new TBaseIndustryItemLogic().SelectByObject(objIndustryItem, 0, 0);

        string strIndustryItemIDs = "";

        for (int i = 0; i < lstIndustryItem.Count; i++)
        {
            strIndustryItemIDs += "," + lstIndustryItem[i].ITEM_ID;
        }
        strIndustryItemIDs += ",";

        for (int i = lstItem.Count - 1; i >= 0; i--)
        {
            if (!strIndustryItemIDs.Contains(lstItem[i].ID))
            {
                lstItem.RemoveAt(i);
            }
        }

        this.ListBox2.DataSource     = lstItem;
        this.ListBox2.DataValueField = TBaseItemInfoVo.ID_FIELD;
        this.ListBox2.DataTextField  = TBaseItemInfoVo.ITEM_NAME_FIELD;
        this.ListBox2.DataBind();

        for (int i = 0; i < ListBox2.Items.Count; i++)
        {
            ListItem item = ListBox2.Items[i];
            ListBox1.Items.Remove(item);
        }
    }
Ejemplo n.º 7
0
        /// <summary>
        /// 对象删除
        /// </summary>
        /// <param name="Id">ID</param>
        /// <returns>是否成功</returns>
        public bool Delete(TBaseIndustryItemVo tBaseIndustryItem)
        {
            string strSQL = "delete from T_BASE_INDUSTRY_ITEM ";

            strSQL += this.BuildWhereStatement(tBaseIndustryItem);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
Ejemplo n.º 8
0
    public static string CopyItem(string strCopyID, string strPastID)
    {
        bool isSuccess = true;

        TBaseIndustryItemVo objItemCopy = new TBaseIndustryItemVo();

        objItemCopy.INDUSTRY_ID = strCopyID;
        DataTable dtCopy = new TBaseIndustryItemLogic().SelectByTable(objItemCopy);

        TBaseIndustryItemVo objItemPast = new TBaseIndustryItemVo();

        objItemPast.INDUSTRY_ID = strPastID;
        DataTable dtPast = new TBaseIndustryItemLogic().SelectByTable(objItemPast);

        string strIsExistItem = "";

        for (int i = 0; i < dtPast.Rows.Count; i++)
        {
            strIsExistItem += "," + dtPast.Rows[i]["ITEM_ID"].ToString();
        }
        strIsExistItem += strIsExistItem.Length > 0 ? "," : "";

        for (int i = 0; i < dtCopy.Rows.Count; i++)
        {
            DataRow dr            = dtCopy.Rows[i];
            string  strCopyItemID = dr["ITEM_ID"].ToString();
            if (!strIsExistItem.Contains(strCopyItemID))
            {
                TBaseIndustryItemVo objItem = new TBaseIndustryItemVo();
                objItem.ID          = GetSerialNumber("t_base_industry_item_id");
                objItem.INDUSTRY_ID = strPastID;
                objItem.ITEM_ID     = strCopyItemID;

                isSuccess = new TBaseIndustryItemLogic().Create(objItem);
                if (isSuccess)
                {
                    new PageBase().WriteLog("新增行业项目", "", new PageBase().LogInfo.UserInfo.USER_NAME + "新增行业项目" + objItem.ID + "成功");
                }
            }
        }

        if (isSuccess)
        {
            return("1");
        }
        else
        {
            return("0");
        }
    }
Ejemplo n.º 9
0
        /// <summary>
        /// 根据对象构造条件语句
        /// </summary>
        /// <param name="tBaseIndustryItem"></param>
        /// <returns></returns>
        public string BuildWhereStatement(TBaseIndustryItemVo tBaseIndustryItem)
        {
            StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 ");

            if (null != tBaseIndustryItem)
            {
                //ID
                if (!String.IsNullOrEmpty(tBaseIndustryItem.ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND ID = '{0}'", tBaseIndustryItem.ID.ToString()));
                }
                //行业ID
                if (!String.IsNullOrEmpty(tBaseIndustryItem.INDUSTRY_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND INDUSTRY_ID = '{0}'", tBaseIndustryItem.INDUSTRY_ID.ToString()));
                }
                //监测项目ID
                if (!String.IsNullOrEmpty(tBaseIndustryItem.ITEM_ID.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND ITEM_ID = '{0}'", tBaseIndustryItem.ITEM_ID.ToString()));
                }
                //备注1
                if (!String.IsNullOrEmpty(tBaseIndustryItem.REMARK1.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK1 = '{0}'", tBaseIndustryItem.REMARK1.ToString()));
                }
                //备注2
                if (!String.IsNullOrEmpty(tBaseIndustryItem.REMARK2.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK2 = '{0}'", tBaseIndustryItem.REMARK2.ToString()));
                }
                //备注3
                if (!String.IsNullOrEmpty(tBaseIndustryItem.REMARK3.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK3 = '{0}'", tBaseIndustryItem.REMARK3.ToString()));
                }
                //备注4
                if (!String.IsNullOrEmpty(tBaseIndustryItem.REMARK4.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK4 = '{0}'", tBaseIndustryItem.REMARK4.ToString()));
                }
                //备注5
                if (!String.IsNullOrEmpty(tBaseIndustryItem.REMARK5.ToString().Trim()))
                {
                    strWhereStatement.Append(string.Format(" AND REMARK5 = '{0}'", tBaseIndustryItem.REMARK5.ToString()));
                }
            }
            return(strWhereStatement.ToString());
        }
Ejemplo n.º 10
0
    public static string deleteData(string strValue)
    {
        TBaseIndustryInfoVo objMainVo = new TBaseIndustryInfoVo();

        objMainVo.ID     = strValue;
        objMainVo.IS_DEL = "1";
        bool isSuccess = new TBaseIndustryInfoLogic().Edit(objMainVo);

        TBaseIndustryItemVo objSubVoWhere = new TBaseIndustryItemVo();

        objSubVoWhere.INDUSTRY_ID = strValue;
        if (new TBaseIndustryItemLogic().Delete(objSubVoWhere))
        {
            new PageBase().WriteLog("删除行业信息", "", new PageBase().LogInfo.UserInfo.USER_NAME + "删除行业信息" + objSubVoWhere.ID + "成功");
        }

        return(isSuccess == true ? "1" : "0");
    }
Ejemplo n.º 11
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tBaseIndustryItem">用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TBaseIndustryItemVo tBaseIndustryItem)
 {
     return(access.Edit(tBaseIndustryItem));
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 获取对象DataTable
 /// </summary>
 /// <param name="tBaseIndustryItem">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public DataTable SelectByTable(TBaseIndustryItemVo tBaseIndustryItem, int iIndex, int iCount)
 {
     return(access.SelectByTable(tBaseIndustryItem, iIndex, iCount));
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 根据对象获取全部数据,用Table承载
 ///  数据量较小时使用【不推荐】
 /// </summary>
 /// <param name="tBaseIndustryItem"></param>
 /// <returns></returns>
 public DataTable SelectByTable(TBaseIndustryItemVo tBaseIndustryItem)
 {
     return(access.SelectByTable(tBaseIndustryItem));
 }
Ejemplo n.º 14
0
 /// <summary>
 /// 对象明细
 /// </summary>
 /// <param name="tBaseIndustryItem">对象条件</param>
 /// <returns>对象</returns>
 public TBaseIndustryItemVo Details(TBaseIndustryItemVo tBaseIndustryItem)
 {
     return(access.Details(tBaseIndustryItem));
 }
Ejemplo n.º 15
0
 /// <summary>
 /// 获取对象List
 /// </summary>
 /// <param name="tBaseIndustryItem">对象</param>
 /// <param name="iIndex">起始页码</param>
 /// <param name="iCount">每页数目</param>
 /// <returns>返回结果</returns>
 public List <TBaseIndustryItemVo> SelectByObject(TBaseIndustryItemVo tBaseIndustryItem, int iIndex, int iCount)
 {
     return(access.SelectByObject(tBaseIndustryItem, iIndex, iCount));
 }
Ejemplo n.º 16
0
 public TBaseIndustryItemLogic(TBaseIndustryItemVo _tBaseIndustryItem)
 {
     tBaseIndustryItem = _tBaseIndustryItem;
     access            = new TBaseIndustryItemAccess();
 }
Ejemplo n.º 17
0
 /// <summary>
 /// 获得查询结果总行数,用于分页
 /// </summary>
 /// <param name="tBaseIndustryItem">对象</param>
 /// <returns>返回行数</returns>
 public int GetSelectResultCount(TBaseIndustryItemVo tBaseIndustryItem)
 {
     return(access.GetSelectResultCount(tBaseIndustryItem));
 }
Ejemplo n.º 18
0
        /// <summary>
        /// 获得查询结果总行数,用于分页
        /// </summary>
        /// <param name="tBaseIndustryItem">对象</param>
        /// <returns>返回行数</returns>
        public int GetSelectResultCount(TBaseIndustryItemVo tBaseIndustryItem)
        {
            string strSQL = "select Count(*) from T_BASE_INDUSTRY_ITEM " + this.BuildWhereStatement(tBaseIndustryItem);

            return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL)));
        }
Ejemplo n.º 19
0
 /// <summary>
 /// 对象删除
 /// </summary>
 /// <param name="Id">ID</param>
 /// <returns>是否成功</returns>
 public bool Delete(TBaseIndustryItemVo tBaseIndustryItem)
 {
     return(access.Delete(tBaseIndustryItem));
 }
Ejemplo n.º 20
0
        /// <summary>
        /// 对象明细
        /// </summary>
        /// <param name="tBaseIndustryItem">对象条件</param>
        /// <returns>对象</returns>
        public TBaseIndustryItemVo Details(TBaseIndustryItemVo tBaseIndustryItem)
        {
            string strSQL = String.Format("select * from  T_BASE_INDUSTRY_ITEM " + this.BuildWhereStatement(tBaseIndustryItem));

            return(SqlHelper.ExecuteObject(new TBaseIndustryItemVo(), strSQL));
        }
Ejemplo n.º 21
0
 /// <summary>
 /// 对象添加
 /// </summary>
 /// <param name="sysRole">对象</param>
 /// <returns>是否成功</returns>
 public bool Create(TBaseIndustryItemVo tBaseIndustryItem)
 {
     return(access.Create(tBaseIndustryItem));
 }
Ejemplo n.º 22
0
 /// <summary>
 /// 根据对象特征获取单一对象
 /// </summary>
 /// <param name="tBaseIndustryItem">对象</param>
 /// <returns></returns>
 public TBaseIndustryItemVo SelectByObject(TBaseIndustryItemVo tBaseIndustryItem)
 {
     return(access.SelectByObject(tBaseIndustryItem));
 }
Ejemplo n.º 23
0
        /// <summary>
        /// 根据对象获取全部数据,用Table承载
        ///  数据量较小时使用【不推荐】
        /// </summary>
        /// <param name="tBaseIndustryItem"></param>
        /// <returns></returns>
        public DataTable SelectByTable(TBaseIndustryItemVo tBaseIndustryItem)
        {
            string strSQL = "select * from T_BASE_INDUSTRY_ITEM " + this.BuildWhereStatement(tBaseIndustryItem);

            return(SqlHelper.ExecuteDataTable(strSQL));
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 获取对象List
        /// </summary>
        /// <param name="tBaseIndustryItem">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public List <TBaseIndustryItemVo> SelectByObject(TBaseIndustryItemVo tBaseIndustryItem, int iIndex, int iCount)
        {
            string strSQL = String.Format("select * from  T_BASE_INDUSTRY_ITEM " + this.BuildWhereStatement(tBaseIndustryItem));

            return(SqlHelper.ExecuteObjectList(tBaseIndustryItem, BuildPagerExpress(strSQL, iIndex, iCount)));
        }
Ejemplo n.º 25
0
 /// <summary>
 /// 对象编辑
 /// </summary>
 /// <param name="tBaseIndustryItem_UpdateSet">UpdateSet用户对象</param>
 /// <param name="tBaseIndustryItem_UpdateWhere">UpdateWhere用户对象</param>
 /// <returns>是否成功</returns>
 public bool Edit(TBaseIndustryItemVo tBaseIndustryItem_UpdateSet, TBaseIndustryItemVo tBaseIndustryItem_UpdateWhere)
 {
     return(access.Edit(tBaseIndustryItem_UpdateSet, tBaseIndustryItem_UpdateWhere));
 }
Ejemplo n.º 26
0
        /// <summary>
        /// 对象添加
        /// </summary>
        /// <param name="tBaseIndustryItem">对象</param>
        /// <returns>是否成功</returns>
        public bool Create(TBaseIndustryItemVo tBaseIndustryItem)
        {
            string strSQL = SqlHelper.BuildInsertExpress(tBaseIndustryItem, TBaseIndustryItemVo.T_BASE_INDUSTRY_ITEM_TABLE);

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