Beispiel #1
0
    /// <summary>
    /// 增加数据
    /// </summary>
    /// <returns></returns>
    public string frmAdd()
    {
        string         strMsg       = "";
        bool           isSuccess    = true;
        TEnvPPolluteVo TEnvPPollute = autoBindRequest(Request, new TEnvPPolluteVo());

        TEnvPPollute.TYPE_ID = this.TypeId.Value;
        TEnvPPollute.IS_DEL  = "0";
        string Meg = new CommonLogic().isExistRepeat(TEnvPPolluteVo.T_ENV_P_POLLUTE_TABLE, TEnvPPollute.YEAR, TEnvPPollute.SelectMonths, TEnvPPolluteVo.POINT_NAME_FIELD, TEnvPPollute.POINT_NAME, TEnvPPolluteVo.POINT_CODE_FIELD, TEnvPPollute.POINT_CODE, TEnvPPolluteVo.ID_FIELD, TEnvPPollute.ID, TEnvPPollute.TYPE_ID);

        if (!string.IsNullOrEmpty(Meg))
        {
            strMsg = Meg; isSuccess = false;
        }
        else
        {
            isSuccess = new TEnvPPolluteLogic().CreateInfo(TEnvPPollute, SerialType.T_ENV_POINT_POLLUTE);
            if (isSuccess)
            {
                WriteLog("添加监测点", "", LogInfo.UserInfo.USER_NAME + "添加监测点" + TEnvPPollute.ID);
                strMsg = "数据保存成功";
            }
            else
            {
                strMsg = "数据保存失败";
            }
        }
        return(isSuccess == true ? "{\"result\":\"success\",\"msg\":\"" + strMsg + "\"}" : "{\"result\":\"fail\",\"msg\":\"" + strMsg + "\"}");
    }
Beispiel #2
0
    /// <summary>
    /// 修改数据
    /// </summary>
    /// <returns></returns>
    public string frmUpdate()
    {
        string         strMsg       = "";
        bool           isSuccess    = true;
        TEnvPPolluteVo TEnvPPollute = autoBindRequest(Request, new TEnvPPolluteVo());

        TEnvPPollute.ID     = Request["id"].ToString();
        TEnvPPollute.IS_DEL = "0";
        string Meg = new CommonLogic().isExistRepeat(TEnvPPolluteVo.T_ENV_P_POLLUTE_TABLE, TEnvPPollute.YEAR, TEnvPPollute.MONTH, TEnvPPolluteVo.POINT_NAME_FIELD, TEnvPPollute.POINT_NAME, TEnvPPolluteVo.POINT_CODE_FIELD, TEnvPPollute.POINT_CODE, TEnvPPolluteVo.ID_FIELD, TEnvPPollute.ID, null);

        if (!string.IsNullOrEmpty(Meg))
        {
            strMsg = Meg; isSuccess = false;
        }
        else
        {
            isSuccess = new TEnvPPolluteLogic().Edit(TEnvPPollute);
            if (isSuccess)
            {
                WriteLog("编辑监测点", "", LogInfo.UserInfo.USER_NAME + "编辑监测点" + TEnvPPollute.ID);
                strMsg = "数据保存成功";
            }
            else
            {
                strMsg = "数据保存失败";
            }
        }
        return(isSuccess == true ? "{\"result\":\"success\",\"msg\":\"" + strMsg + "\"}" : "{\"result\":\"fail\",\"msg\":\"" + strMsg + "\"}");
    }
Beispiel #3
0
    /// <summary>
    /// 加载数据
    /// </summary>
    /// <returns></returns>
    public string frmLoadData()
    {
        TEnvPPolluteVo TEnvPPollute = new TEnvPPolluteVo();
        string         str          = this.formStatus.Value;

        TEnvPPollute.ID = Request["id"].ToString();
        TEnvPPolluteVo TEnvPRiverVTemp = new TEnvPPolluteLogic().Details(TEnvPPollute);

        return(ToJson(TEnvPRiverVTemp));
    }
Beispiel #4
0
    public static string deleteThreeGridInfo(string strValue)
    {
        TEnvPPolluteVo TEnvPEnterInfo = new TEnvPPolluteVo();

        TEnvPEnterInfo.ID     = strValue;
        TEnvPEnterInfo.IS_DEL = "1";
        bool isSuccess = new TEnvPPolluteLogic().Edit(TEnvPEnterInfo);

        if (isSuccess)
        {
            new PageBase().WriteLog("删除监测点信息", "", new UserLogInfo().UserInfo.USER_NAME + "删除监测点信息" + strValue);
        }
        return(isSuccess == true ? "1" : "0");
    }
Beispiel #5
0
    public string getThreeGridInfo(string twoGridId)
    {
        string strSortname  = Request.Params["sortname"];
        string strSortorder = Request.Params["sortorder"];
        //当前页面
        int intPageIndex = Convert.ToInt32(Request.Params["page"]);
        //每页记录数
        int            intPageSize      = Convert.ToInt32(Request.Params["pagesize"]);
        TEnvPPolluteVo TEnvPPolluteType = new TEnvPPolluteVo();

        TEnvPPolluteType.TYPE_ID    = twoGridId;
        TEnvPPolluteType.IS_DEL     = "0";
        TEnvPPolluteType.SORT_FIELD = strSortname;
        TEnvPPolluteType.SORT_TYPE  = strSortorder;
        DataTable dt            = new TEnvPPolluteLogic().SelectByTable(TEnvPPolluteType, intPageIndex, intPageSize);
        int       intTotalCount = new TEnvPPolluteLogic().GetSelectResultCount(TEnvPPolluteType);
        string    strJson       = CreateToJson(dt, intTotalCount);

        return(strJson);
    }
    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();
    }