/// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tBaseItemInfo">用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TBaseItemInfoVo tBaseItemInfo)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tBaseItemInfo, TBaseItemInfoVo.T_BASE_ITEM_INFO_TABLE);

            strSQL += string.Format(" where ID='{0}' ", tBaseItemInfo.ID);
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
Ejemplo n.º 2
0
    public static string deleteItemBag(string strDelIDs)
    {
        if (strDelIDs.Length == 0)
        {
            return("0");
        }

        string[] arrDelIDs = strDelIDs.Split(',');

        bool isSuccess = true;

        for (int i = 0; i < arrDelIDs.Length; i++)
        {
            TBaseItemInfoVo objItem = new TBaseItemInfoVo();
            objItem.ID     = arrDelIDs[i];
            objItem.IS_DEL = "1";
            isSuccess      = new TBaseItemInfoLogic().Edit(objItem);

            TBaseItemSubItemVo objSubItemSet = new TBaseItemSubItemVo();
            objSubItemSet.IS_DEL = "1";
            TBaseItemSubItemVo objSubItemWhere = new TBaseItemSubItemVo();
            objSubItemWhere.PARENT_ITEM_ID = arrDelIDs[i];
            new TBaseItemSubItemLogic().Edit(objSubItemSet, objSubItemWhere);
        }

        if (isSuccess)
        {
            new PageBase().WriteLog("删除项目包", "", new PageBase().LogInfo.UserInfo.USER_NAME + "删除项目包" + arrDelIDs[0].ToString() + "成功");
            return("1");
        }
        else
        {
            return("0");
        }
    }
Ejemplo n.º 3
0
    public static string AddItemBag(string strMONITOR_ID, string strITEM_NAME)
    {
        bool isSuccess = true;

        TBaseItemInfoVo objItem = new TBaseItemInfoVo();

        objItem.ID           = GetSerialNumber("t_base_item_info_id");
        objItem.IS_DEL       = "0";
        objItem.HAS_SUB_ITEM = "1";//监测项目管理默认直接子项目。说明,父项目,在用户界面以项目包形式存在,不属于项目范畴;子项目、项目包,在数据库存一个表,对用户应该是两个概念。
        objItem.IS_SUB       = "0";
        objItem.MONITOR_ID   = strMONITOR_ID;
        objItem.ITEM_NAME    = strITEM_NAME;

        isSuccess = new TBaseItemInfoLogic().Create(objItem);

        if (isSuccess)
        {
            new PageBase().WriteLog("新增项目包", "", new PageBase().LogInfo.UserInfo.USER_NAME + "新增项目包" + objItem.ID + "成功");
            return("1");
        }
        else
        {
            return("0");
        }
    }
        /// <summary>
        /// 获取对象DataTable
        /// </summary>
        /// <param name="tBaseItemInfo">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public DataTable SelectByTable(TBaseItemInfoVo tBaseItemInfo, int iIndex, int iCount)
        {
            string strSQL = " select * from T_BASE_ITEM_INFO {0} ";

            strSQL = String.Format(strSQL, BuildWhereStatement(tBaseItemInfo));
            return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount)));
        }
Ejemplo n.º 5
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.º 6
0
    public static List <object> GetMonitorItems(string strMonitor, string strUserId)
    {
        List <object> reslut = new List <object>();


        DataTable       dtSt  = new DataTable();
        TBaseItemInfoVo objtd = new TBaseItemInfoVo();

        objtd.IS_DEL     = "0";
        objtd.MONITOR_ID = strMonitor;
        dtSt             = new TBaseItemInfoLogic().SelectByTable(objtd);
        DataTable dtnew = new DataTable();

        dtnew = new TSysUserDutyLogic().GetExistMonitor(strMonitor, strUserId, false, false);
        for (int i = 0; i < dtnew.Rows.Count; i++)
        {
            DataRow[] drr = dtSt.Select("ID='" + dtnew.Rows[i]["ITEM_ID"] + "'");
            if (drr.Length > 0)
            {
                foreach (DataRow drow in drr)
                {
                    drow.Delete();
                }
            }
        }

        dtSt.AcceptChanges();

        reslut = LigerGridSelectDataToJson(dtSt, dtSt.Rows.Count);

        return(reslut);
    }
    public static string EditItem(string strID, string strITEM_NAME, string strLAB_CERTIFICATE, string strMEASURE_CERTIFICATE, string strORDER_NUM, string strITEM_NUM, string strIS_SAMPLEDEPT, string strIS_ANYSCENE, string strORI_CATALOG_TABLEID)
    {
        bool isSuccess = true;

        TBaseItemInfoVo objItem = new TBaseItemInfoVo();

        objItem.ID                  = strID;
        objItem.ITEM_NAME           = strITEM_NAME;
        objItem.LAB_CERTIFICATE     = strLAB_CERTIFICATE;
        objItem.MEASURE_CERTIFICATE = strMEASURE_CERTIFICATE;
        objItem.ORDER_NUM           = strORDER_NUM.PadLeft(8, '0');
        objItem.ITEM_NUM            = strITEM_NUM;
        objItem.IS_SAMPLEDEPT       = strIS_SAMPLEDEPT;
        objItem.IS_ANYSCENE_ITEM    = strIS_ANYSCENE;
        objItem.ORI_CATALOG_TABLEID = strORI_CATALOG_TABLEID;
        isSuccess = new TBaseItemInfoLogic().Edit(objItem);

        if (isSuccess)
        {
            new PageBase().WriteLog("修改项目", "", new PageBase().LogInfo.UserInfo.USER_NAME + "修改项目" + objItem.ID + "成功");
            return("1");
        }
        else
        {
            return("0");
        }
    }
Ejemplo n.º 8
0
    public static string EditItem(string strItemID, string strCharge, string strPowerFee, string strPreFree, string strTestAnsyFree, string strTestPointNum, string strAnsyNum)
    {
        bool isSuccess = true;

        TBaseItemInfoVo objItem = new TBaseItemInfoVo();

        objItem.ID               = strItemID;
        objItem.CHARGE           = strCharge;
        objItem.TEST_POWER_FEE   = strPowerFee;
        objItem.PRETREATMENT_FEE = strPreFree;
        objItem.TEST_ANSY_FEE    = strTestAnsyFree;
        objItem.TEST_POINT_NUM   = strTestPointNum;
        objItem.ANALYSE_NUM      = strAnsyNum;

        isSuccess = new TBaseItemInfoLogic().Edit(objItem);

        if (isSuccess)
        {
            return("1");
        }
        else
        {
            return("0");
        }
    }
    //获取监测项目
    private void GetItem()
    {
        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 strSrhMONITOR_ID = (Request.Params["SrhMONITOR_ID"] != null) ? Request.Params["SrhMONITOR_ID"] : "";
        string strSrhITEM_NAME  = (Request.Params["SrhITEM_NAME"] != null) ? Request.Params["SrhITEM_NAME"] : "";

        if (strSortname == null || strSortname.Length == 0)
        {
            strSortname = TBaseItemInfoVo.MONITOR_ID_FIELD + "," + TBaseItemInfoVo.ORDER_NUM_FIELD;
        }

        TBaseItemInfoVo objItem = new TBaseItemInfoVo();

        objItem.IS_DEL       = "0";
        objItem.HAS_SUB_ITEM = "0";//监测项目管理默认直接子项目。说明,父项目,在用户界面以项目包形式存在,不属于项目范畴;子项目、项目包,在数据库存一个表,对用户应该是两个概念。
        objItem.IS_SUB       = "1";

        objItem.MONITOR_ID = strSrhMONITOR_ID;
        objItem.ITEM_NAME  = strSrhITEM_NAME;

        objItem.SORT_FIELD = strSortname;
        objItem.SORT_TYPE  = strSortorder;
        TBaseItemInfoLogic logicItem = new TBaseItemInfoLogic();

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

        string strJson = CreateToJson(dt, intTotalCount);

        Response.Write(strJson);
    }
    public static string AddItem(string strMONITOR_ID, string strITEM_NAME, string strLAB_CERTIFICATE, string strMEASURE_CERTIFICATE, string strORDER_NUM, string strITEM_NUM, string strIS_SAMPLEDEPT, string strIS_ANYSCENE, string strORI_CATALOG_TABLEID)
    {
        bool isSuccess = true;

        TBaseItemInfoVo objItem = new TBaseItemInfoVo();

        objItem.ID                  = GetSerialNumber("t_base_item_info_id");
        objItem.IS_DEL              = "0";
        objItem.HAS_SUB_ITEM        = "0";//监测项目管理默认直接子项目。说明,父项目,在用户界面以项目包形式存在,不属于项目范畴;子项目、项目包,在数据库存一个表,对用户应该是两个概念。
        objItem.IS_SUB              = "1";
        objItem.MONITOR_ID          = strMONITOR_ID;
        objItem.ITEM_NAME           = strITEM_NAME;
        objItem.LAB_CERTIFICATE     = strLAB_CERTIFICATE;
        objItem.MEASURE_CERTIFICATE = strMEASURE_CERTIFICATE;
        objItem.ORDER_NUM           = strORDER_NUM.PadLeft(8, '0');
        objItem.ITEM_NUM            = strITEM_NUM;
        objItem.IS_SAMPLEDEPT       = strIS_SAMPLEDEPT;
        objItem.IS_ANYSCENE_ITEM    = strIS_ANYSCENE;
        objItem.ORI_CATALOG_TABLEID = strORI_CATALOG_TABLEID;
        isSuccess = new TBaseItemInfoLogic().Create(objItem);

        if (isSuccess)
        {
            new PageBase().WriteLog("新增项目", "", new PageBase().LogInfo.UserInfo.USER_NAME + "新增项目" + objItem.ID + "成功");
            return("1");
        }
        else
        {
            return("0");
        }
    }
        /// <summary>
        /// 为监测类别复制监测项目
        /// </summary>
        /// <param name="tBaseItemInfo"></param>
        /// <returns></returns>
        public bool CopySameMonitorItemInfor(TBaseItemInfoVo tBaseItemInfo, string strToId)
        {
            string    strSQL = "";
            ArrayList objArr = new ArrayList();
            DataTable dt     = SelectByTable(tBaseItemInfo);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    string strItemId = GetSerialNumber("t_base_item_info_id");
                    strSQL = string.Format(" INSERT INTO T_BASE_ITEM_INFO (ID,ITEM_NAME,MONITOR_ID,IS_SAMPLEDEPT,HAS_SUB_ITEM,IS_SUB,ITEM_NUM,ANALYSE_NUM,TEST_POINT_NUM,PRETREATMENT_FEE,TEST_ANSY_FEE,CHARGE,TEST_POWER_FEE,LAB_CERTIFICATE,MEASURE_CERTIFICATE,TWIN_VALUE,ADD_MIN,ADD_MAX,ORDER_NUM,IS_DEL)  SELECT '{0}',ITEM_NAME,'{1}',IS_SAMPLEDEPT,HAS_SUB_ITEM,IS_SUB,ITEM_NUM,ANALYSE_NUM,TEST_POINT_NUM,PRETREATMENT_FEE,TEST_ANSY_FEE,CHARGE,TEST_POWER_FEE,LAB_CERTIFICATE,MEASURE_CERTIFICATE,TWIN_VALUE,ADD_MIN,ADD_MAX,ORDER_NUM,IS_DEL FROM T_BASE_ITEM_INFO WHERE ID='{2}'", strItemId, strToId, dr["ID"].ToString());
                    objArr.Add(strSQL);

                    TBaseItemAnalysisVo objAnsy = new TBaseItemAnalysisVo();
                    objAnsy.ITEM_ID = dr["ID"].ToString();

                    DataTable dtAnsy = new TBaseItemAnalysisAccess().SelectByTable(objAnsy);
                    if (dtAnsy.Rows.Count > 0)
                    {
                        foreach (DataRow drr in dtAnsy.Rows)
                        {
                            string strAnsyId = GetSerialNumber("t_base_item_analysis_id");
                            strSQL = string.Format(" INSERT INTO T_BASE_ITEM_ANALYSIS (ID,ITEM_ID,ANALYSIS_METHOD_ID,INSTRUMENT_ID,UNIT,PRECISION,UPPER_LIMIT,LOWER_LIMIT,LOWER_CHECKOUT,IS_DEFAULT,IS_DEL)  SELECT '{0}','{1}',ANALYSIS_METHOD_ID,INSTRUMENT_ID,UNIT,PRECISION,UPPER_LIMIT,LOWER_LIMIT,LOWER_CHECKOUT,IS_DEFAULT,IS_DEL FROM T_BASE_ITEM_ANALYSIS WHERE ID='{2}'", strAnsyId, strItemId, drr["ID"].ToString());
                            objArr.Add(strSQL);
                        }
                    }
                }
            }

            return(SqlHelper.ExecuteSQLByTransaction(objArr));
        }
        /// <summary>
        /// 获得查询结果总行数,用于分页
        /// </summary>
        /// <param name="tBaseItemInfo">对象</param>
        /// <returns>返回行数</returns>
        public int GetSelectResultCount(TBaseItemInfoVo tBaseItemInfo)
        {
            string strSQL = "select Count(*) from T_BASE_ITEM_INFO " + this.BuildWhereStatement(tBaseItemInfo);

            strSQL += " and  monitor_id in (select id from T_BASE_MONITOR_TYPE_INFO where is_del='0')";
            return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL)));
        }
        /// <summary>
        /// 对象编辑
        /// </summary>
        /// <param name="tBaseItemInfo_UpdateSet">UpdateSet用户对象</param>
        /// <param name="tBaseItemInfo_UpdateWhere">UpdateWhere用户对象</param>
        /// <returns>是否成功</returns>
        public bool Edit(TBaseItemInfoVo tBaseItemInfo_UpdateSet, TBaseItemInfoVo tBaseItemInfo_UpdateWhere)
        {
            string strSQL = SqlHelper.BuildUpdateExpress(tBaseItemInfo_UpdateSet, TBaseItemInfoVo.T_BASE_ITEM_INFO_TABLE);

            strSQL += this.BuildWhereStatement(tBaseItemInfo_UpdateWhere);
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
        /// <summary>
        /// 对象删除
        /// </summary>
        /// <param name="Id">ID</param>
        /// <returns>是否成功</returns>
        public bool Delete(TBaseItemInfoVo tBaseItemInfo)
        {
            string strSQL = "delete from T_BASE_ITEM_INFO ";

            strSQL += this.BuildWhereStatement(tBaseItemInfo);

            return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false);
        }
        /// <summary>
        /// 获取对象DataTable
        /// </summary>
        /// <param name="tBaseItemInfo">对象</param>
        /// <param name="iIndex">起始页码</param>
        /// <param name="iCount">每页数目</param>
        /// <returns>返回结果</returns>
        public DataTable SelectByTable_ByJoinMonitorType(TBaseItemInfoVo tBaseItemInfo, int iIndex, int iCount)
        {
            // InsertData();
            string strSQL = " select * from T_BASE_ITEM_INFO {0} ";

            strSQL  = String.Format(strSQL, BuildWhereStatement(tBaseItemInfo));
            strSQL  = "select m.MONITOR_TYPE_NAME as MONITOR_NAME,i.* from (" + strSQL + ")i join T_BASE_MONITOR_TYPE_INFO m on m.id=i.monitor_id where m.is_del='0'";
            strSQL += " order by i.MONITOR_ID,i.ORDER_NUM";
            return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount)));
        }
Ejemplo n.º 16
0
    protected void BindList()
    {
        string strMonitorID = new TBaseItemInfoLogic().Details(this.Request["selBagID"].ToString()).MONITOR_ID;

        TBaseItemInfoVo objItem = new TBaseItemInfoVo();

        objItem.IS_DEL       = "0";
        objItem.IS_SUB       = "1";
        objItem.HAS_SUB_ITEM = "0";
        objItem.MONITOR_ID   = strMonitorID;
        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();

        TBaseItemSubItemVo objSubItem = new TBaseItemSubItemVo();

        objSubItem.IS_DEL         = "0";
        objSubItem.PARENT_ITEM_ID = this.Request["selBagID"].ToString();
        List <TBaseItemSubItemVo> lstSubItem = new TBaseItemSubItemLogic().SelectByObject(objSubItem, 0, 0);

        string strSubItemIDs = "";

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

        for (int i = lstItem.Count - 1; i >= 0; i--)
        {
            if (!strSubItemIDs.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.º 17
0
    /// <summary>
    /// 退回监测项目
    /// </summary>
    /// <param name="strResultId">结果ID</param>
    /// <returns></returns>
    public string GoToBack(string strResultIds, string strSuggestion)
    {
        bool isSuccess = true;

        string[] strResultId = strResultIds.Split(',');
        for (int i = 0; i < strResultId.Length; i++)
        {
            TBaseItemInfoVo BaseItemInfoVo = new TBaseItemInfoVo();
            BaseItemInfoVo = new TBaseItemInfoLogic().Details(new TMisMonitorResultLogic().Details(strResultId[i].ToString()).ITEM_ID);

            TMisMonitorResultVo TMisMonitorResultVo = new TMisMonitorResultVo();
            TMisMonitorResultVo.ID        = strResultId[i].ToString();
            TMisMonitorResultVo.TASK_TYPE = "退回";
            if (BaseItemInfoVo.IS_ANYSCENE_ITEM == "1")         //分析类现场监测项目 退回到:00
            {
                TMisMonitorResultVo.RESULT_STATUS = "00";
            }
            else
            {
                TMisMonitorResultVo.RESULT_STATUS = "01";       //分析类监测项目 退回到:01
            }
            isSuccess = new TMisMonitorResultLogic().Edit(TMisMonitorResultVo);

            TMisMonitorResultVo = new TMisMonitorResultLogic().Details(strResultId[i].ToString());
            TMisMonitorSampleInfoVo objSampleInfoVo = new TMisMonitorSampleInfoLogic().Details(TMisMonitorResultVo.SAMPLE_ID);
            TMisMonitorSubtaskVo    objSubtaskVo    = new TMisMonitorSubtaskLogic().Details(objSampleInfoVo.SUBTASK_ID);

            TMisReturnInfoVo objReturnInfoVo = new TMisReturnInfoVo();
            objReturnInfoVo.TASK_ID        = objSubtaskVo.TASK_ID;
            objReturnInfoVo.SUBTASK_ID     = objSubtaskVo.ID;
            objReturnInfoVo.RESULT_ID      = strResultId[i].ToString();
            objReturnInfoVo.CURRENT_STATUS = SerialType.Monitor_007;
            objReturnInfoVo.BACKTO_STATUS  = SerialType.Monitor_006;
            TMisReturnInfoVo obj = new TMisReturnInfoLogic().Details(objReturnInfoVo);
            if (obj.ID.Length > 0)
            {
                objReturnInfoVo.ID         = obj.ID;
                objReturnInfoVo.SUGGESTION = strSuggestion;
                isSuccess = new TMisReturnInfoLogic().Edit(objReturnInfoVo);
            }
            else
            {
                objReturnInfoVo.ID         = GetSerialNumber("t_mis_return_id");
                objReturnInfoVo.SUGGESTION = strSuggestion;
                isSuccess = new TMisReturnInfoLogic().Create(objReturnInfoVo);
            }
        }

        return(isSuccess == true ? "1" : "0");
    }
Ejemplo n.º 18
0
    public static List <object> GetMonitorSubItems(string strStandId, string strCondtionId, string strMonitor)
    {
        List <object>            reslut = new List <object>();
        DataTable                dtSt   = new DataTable();
        TBaseEvaluationConItemVo objtd  = new TBaseEvaluationConItemVo();

        objtd.IS_DEL       = "0";
        objtd.MONITOR_ID   = strMonitor;
        objtd.STANDARD_ID  = strStandId;
        objtd.CONDITION_ID = strCondtionId;
        dtSt = new TBaseEvaluationConItemLogic().SelectByTable(objtd);

        DataTable       dt      = new DataTable();
        TBaseItemInfoVo objitem = new TBaseItemInfoVo();

        objitem.MONITOR_ID = strMonitor;
        objitem.IS_DEL     = "0";


        dt = new TBaseItemInfoLogic().SelectByTable(objitem);

        DataTable dtItem = new DataTable();

        dtItem = dt.Copy();
        dtItem.Clear();
        if (dtSt.Rows.Count > 0)
        {
            for (int i = 0; i < dtSt.Rows.Count; i++)
            {
                if (!String.IsNullOrEmpty(dtSt.Rows[i]["ITEM_ID"].ToString()))
                {
                    DataRow[] dr = dt.Select("ID='" + dtSt.Rows[i]["ITEM_ID"].ToString() + "'");
                    if (dr != null)
                    {
                        foreach (DataRow Temrow in dr)
                        {
                            Temrow.Delete();
                            dt.AcceptChanges();
                        }
                    }
                }
            }
        }

        dtItem = dt.Copy();
        reslut = LigerGridSelectDataToJson(dtItem, dtItem.Rows.Count);
        //reslut = gridDataToJson(dtSt, dtSt.Rows.Count, objtd);
        return(reslut);
    }
Ejemplo n.º 19
0
    public string GetMonitorItemsJson(string strMonitor)
    {
        string reslut = "";

        DataTable       dtSt  = new DataTable();
        TBaseItemInfoVo objtd = new TBaseItemInfoVo();

        objtd.IS_DEL     = "0";
        objtd.MONITOR_ID = strMonitor;
        dtSt             = new TBaseItemInfoLogic().SelectByTable(objtd);


        reslut = LigerGridDataToJson(dtSt, dtSt.Rows.Count);
        return(reslut);
    }
Ejemplo n.º 20
0
    public static List <object> GetMonitorItems(string strMonitor)
    {
        List <object> reslut = new List <object>();


        DataTable       dtSt  = new DataTable();
        TBaseItemInfoVo objtd = new TBaseItemInfoVo();

        objtd.IS_DEL     = "0";
        objtd.MONITOR_ID = strMonitor;
        dtSt             = new TBaseItemInfoLogic().SelectByTable(objtd);


        reslut = LigerGridSelectDataToJson(dtSt, dtSt.Rows.Count);
        //reslut = gridDataToJson(dtSt, dtSt.Rows.Count, objtd);
        return(reslut);
    }
Ejemplo n.º 21
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string strId   = this.TextBox1.Text.ToString();
        string strToId = this.TextBox2.Text.ToString();

        if (!String.IsNullOrEmpty(strId) && !String.IsNullOrEmpty(strToId))
        {
            TBaseItemInfoVo objImtes = new TBaseItemInfoVo();
            objImtes.MONITOR_ID = strId;
            objImtes.IS_DEL     = "0";
            if (new TBaseItemInfoLogic().CopySameMonitorItemInfor(objImtes, strToId))
            {
                Response.Write("<script language='javascript'>alert('复制成功!');</script>");
            }
        }
        else
        {
            return;
        }
    }
Ejemplo n.º 22
0
    public static string EditItemBag(string strID, string strITEM_NAME)
    {
        bool isSuccess = true;

        TBaseItemInfoVo objItem = new TBaseItemInfoVo();

        objItem.ID        = strID;
        objItem.ITEM_NAME = strITEM_NAME;

        isSuccess = new TBaseItemInfoLogic().Edit(objItem);

        if (isSuccess)
        {
            new PageBase().WriteLog("修改项目包", "", new PageBase().LogInfo.UserInfo.USER_NAME + "修改项目包" + objItem.ID + "成功");
            return("1");
        }
        else
        {
            return("0");
        }
    }
    public static string deleteItem(string strDelIDs)
    {
        if (strDelIDs.Length == 0)
        {
            return("0");
        }

        string[] arrDelIDs = strDelIDs.Split(',');

        bool isSuccess = true;

        for (int i = 0; i < arrDelIDs.Length; i++)
        {
            TBaseItemInfoVo objItem = new TBaseItemInfoVo();
            objItem.ID     = arrDelIDs[i];
            objItem.IS_DEL = "1";
            isSuccess      = new TBaseItemInfoLogic().Edit(objItem);

            TBaseItemAnalysisVo objItemAnalysisSet = new TBaseItemAnalysisVo();
            objItemAnalysisSet.IS_DEL = "1";
            TBaseItemAnalysisVo objItemAnalysisWhere = new TBaseItemAnalysisVo();
            objItemAnalysisWhere.ITEM_ID = arrDelIDs[i];
            if (new TBaseItemAnalysisLogic().Edit(objItemAnalysisSet, objItemAnalysisWhere))
            {
                new PageBase().WriteLog("删除项目分析方法", "", new PageBase().LogInfo.UserInfo.USER_NAME + "删除项目ID" + objItemAnalysisWhere.ITEM_ID + "的分析方法成功");
            }
        }

        if (isSuccess)
        {
            new PageBase().WriteLog("删除项目", "", new PageBase().LogInfo.UserInfo.USER_NAME + "删除项目" + arrDelIDs[0].ToString() + "成功");
            return("1");
        }
        else
        {
            return("0");
        }
    }
    public static string EditItem(string strItemID, string strTWIN_VALUE, string strADD_MAX, string strADD_MIN)
    {
        bool isSuccess = true;

        TBaseItemInfoVo objItem = new TBaseItemInfoVo();

        objItem.ID         = strItemID;
        objItem.TWIN_VALUE = strTWIN_VALUE;
        objItem.ADD_MAX    = strADD_MAX;
        objItem.ADD_MIN    = strADD_MIN;

        isSuccess = new TBaseItemInfoLogic().Edit(objItem);

        if (isSuccess)
        {
            new PageBase().WriteLog("编辑项目", "", new PageBase().LogInfo.UserInfo.USER_NAME + "编辑项目" + objItem.ID + "成功");
            return("1");
        }
        else
        {
            return("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();
    }
 /// <summary>
 /// 对象删除
 /// </summary>
 /// <param name="Id">ID</param>
 /// <returns>是否成功</returns>
 public bool Delete(TBaseItemInfoVo tBaseItemInfo)
 {
     return(access.Delete(tBaseItemInfo));
 }
 /// <summary>
 /// 对象明细
 /// </summary>
 /// <param name="tBaseItemInfo">对象条件</param>
 /// <returns>对象</returns>
 public TBaseItemInfoVo Details(TBaseItemInfoVo tBaseItemInfo)
 {
     return(access.Details(tBaseItemInfo));
 }
 /// <summary>
 /// 获得查询结果总行数,用于分页
 /// </summary>
 /// <param name="tBaseItemInfo">对象</param>
 /// <returns>返回行数</returns>
 public int GetSelectResultCount(TBaseItemInfoVo tBaseItemInfo)
 {
     return(access.GetSelectResultCount(tBaseItemInfo));
 }
 /// <summary>
 /// 为监测类别复制监测项目
 /// </summary>
 /// <param name="tBaseItemInfo"></param>
 /// <returns></returns>
 public bool CopySameMonitorItemInfor(TBaseItemInfoVo tBaseItemInfo, string strToId)
 {
     return(access.CopySameMonitorItemInfor(tBaseItemInfo, strToId));
 }
 public TBaseItemInfoLogic(TBaseItemInfoVo _tBaseItemInfo)
 {
     tBaseItemInfo = _tBaseItemInfo;
     access        = new TBaseItemInfoAccess();
 }