Beispiel #1
0
    public static string saveItemData(string strPointId, string strValue)
    {
        i3.BusinessLogic.Channels.Env.Point.Common.CommonLogic com = new i3.BusinessLogic.Channels.Env.Point.Common.CommonLogic();
        bool isSuccess = com.SaveItemInfo(TEnvPSeabathItemVo.T_ENV_P_SEABATH_ITEM_TABLE, strPointId, strValue, SerialType.T_ENV_P_SEABATH_ITEM);

        // bool isSuccess = new i3.BusinessLogic.Channels.Env.Point.River.TEnvPointRiverLogic().SaveItemByTransaction("T_ENV_P_SEABATH_ITEM", "POINT_ID", "rainitem_id", strPointId, strValue);
        if (isSuccess)
        {
            new PageBase().WriteLog("批量保存海水浴场监测点项目信息", "", new UserLogInfo().UserInfo.USER_NAME + "批量保存海水浴场监测点:" + strPointId + "的监测项目信息");
        }
        return(isSuccess == true ? "1" : "0");
    }
    protected void BindList()
    {
        //数据库表名
        string strTableName = Request["TableName"].ToString();
        //数据库列名
        string strColumnName = Request["ColumnName"].ToString();
        //需要查询的数据库列名
        string strWhereColumnName = Request["strWhereColumnName"].ToString();
        //垂线代码
        string strPointCode = Request["PointCode"].ToString();
        //监测类型
        string strMonitorType = Request["MonitorType"].ToString();

        if (strTableName == "T_ENV_P_POLLUTE_ITEM")
        {
            #region                           //常规污染源
            TEnvPPolluteVo TEnvPEnterInfo = new TEnvPPolluteVo();
            TEnvPEnterInfo.ID = strPointCode; //监测项目ID
            string type = new TEnvPPolluteLogic().GetType(TEnvPEnterInfo);
            if (!string.IsNullOrEmpty(type))
            {
                if (type.Equals("废水"))
                {
                    strMonitorType = "000000001";
                }
                if (type.Equals("废气"))
                {
                    strMonitorType = "000000002";
                }
                if (type.Equals("噪声"))
                {
                    strMonitorType = "000000004";
                }
            }
            #endregion
        }
        else
        {
            strMonitorType = new i3.BusinessLogic.Channels.Env.Point.Common.CommonLogic().getNameByID("T_BASE_MONITOR_TYPE_INFO", "REMARK1", "ID", strMonitorType);
        }
        TBaseItemInfoVo objItem = new TBaseItemInfoVo();

        objItem.IS_DEL     = "0";
        objItem.MONITOR_ID = strMonitorType;
        List <TBaseItemInfoVo> lstItem = new TBaseItemInfoLogic().SelectByObject(objItem, 0, 0);
        lstItem.Sort(delegate(TBaseItemInfoVo a, TBaseItemInfoVo b) { return(a.ORDER_NUM.CompareTo(b.ORDER_NUM)); });

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

        DataTable dt = new i3.BusinessLogic.Channels.Env.Point.Common.CommonLogic().getVerticalItem(strTableName, strWhereColumnName, strPointCode);

        string strPointItemIDs = "";
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            strPointItemIDs += "," + dt.Rows[i][strColumnName].ToString();
        }
        strPointItemIDs = strPointItemIDs + ",";

        for (int i = lstItem.Count - 1; i >= 0; i--)
        {
            if (!("," + strPointItemIDs + ",").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);
        }

        lbItemNum.Text = ListBox2.Items.Count.ToString();
    }