Exemple #1
0
    //获取行业信息
    private void getData()
    {
        string strSortname  = Request.Params["sortname"];
        string strSortorder = Request.Params["sortorder"];
        //当前页面
        int intPageIndex = Convert.ToInt32(Request.Params["page"]);
        //每页记录数
        int intPageSize = Convert.ToInt32(Request.Params["pagesize"]);

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

        TBaseIndustryInfoLogic logicMain = new TBaseIndustryInfoLogic();
        TBaseIndustryInfoVo    objMainVo = new TBaseIndustryInfoVo();

        objMainVo.IS_DEL     = "0";
        objMainVo.SORT_FIELD = strSortname;
        objMainVo.SORT_TYPE  = strSortorder;
        DataTable dt            = logicMain.SelectByTable(objMainVo, intPageIndex, intPageSize);
        int       intTotalCount = logicMain.GetSelectResultCount(objMainVo);
        string    strJson       = CreateToJson(dt, intTotalCount);

        Response.Write(strJson);
        Response.End();
    }
    /// <summary>
    /// 获取指定行业类别的监测项目 胡方扬 2013-03-14
    /// </summary>
    /// <returns></returns>
    private void GetIndurstyAllItems(string strIndustryId)
    {
        string              strMonitorID = "", strPointID = "";
        DataTable           dt      = new DataTable();
        TBaseIndustryInfoVo objItem = new TBaseIndustryInfoVo();

        objItem.IS_DEL = "0";
        objItem.ID     = strIndustryId;

        if (!String.IsNullOrEmpty(Request.Params["MonitorType"]))
        {
            strMonitorID = Request.Params["MonitorType"].ToString();
        }
        if (!String.IsNullOrEmpty(Request.Params["PointID"]))
        {
            strPointID = Request.Params["PointID"].ToString();
        }

        dt = new TBaseIndustryInfoLogic().SelectByObjectForIndustry(objItem, strMonitorID, 0, 0);
        this.ListBox1.Items.Clear();
        if (dt.Rows.Count > 0)
        {
            this.ListBox1.DataSource     = dt;
            this.ListBox1.DataTextField  = "ITEM_NAME";
            this.ListBox1.DataValueField = "ITEM_ID";
            this.ListBox1.DataBind();
        }
    }
    //获取数据
    private void GetData(string strID)
    {
        TBaseIndustryInfoVo objVo = new TBaseIndustryInfoLogic().Details(strID);

        string strJson = ToJson(objVo);

        Response.Write(strJson);
        Response.End();
    }
    /// <summary>
    /// 获取行业类别 胡方扬 2013-03-14
    /// </summary>
    /// <returns></returns>
    protected void GetIndustyItems()
    {
        DataTable           dt       = new DataTable();
        TBaseIndustryInfoVo objItems = new TBaseIndustryInfoVo();

        objItems.IS_DEL  = "0";
        objItems.IS_SHOW = "1";
        dt = new TBaseIndustryInfoLogic().SelectByTable(objItems);
        this.DropIndustry.DataSource     = dt;
        this.DropIndustry.DataTextField  = "INDUSTRY_NAME";
        this.DropIndustry.DataValueField = "ID";
        this.DropIndustry.DataBind();
        this.DropIndustry.Items.Insert(0, new ListItem("=请选择=", "0"));
    }
Exemple #5
0
    public static string isShowData(string strValue)
    {
        TBaseIndustryInfoVo objMainVo = new TBaseIndustryInfoLogic().Details(strValue);

        if (objMainVo.IS_SHOW == "1")
        {
            objMainVo.IS_SHOW = "0";
        }
        else
        {
            objMainVo.IS_SHOW = "1";
        }
        bool isSuccess = new TBaseIndustryInfoLogic().Edit(objMainVo);

        return(isSuccess == true ? "1" : "0");
    }
Exemple #6
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");
    }
Exemple #7
0
    public static string SaveData(string strID, string strINDUSTRY_CODE, string strINDUSTRY_NAME)
    {
        bool   isSuccess = true;
        string strSaveID = strID;

        if (strSaveID == "0")
        {
            strSaveID = "";
        }

        TBaseIndustryInfoVo objVo = new TBaseIndustryInfoVo();

        objVo.ID            = strSaveID.Length > 0 ? strID : GetSerialNumber("t_base_industry_info_id");
        objVo.IS_DEL        = "0";
        objVo.INDUSTRY_CODE = strINDUSTRY_CODE;
        objVo.INDUSTRY_NAME = strINDUSTRY_NAME;

        if (strSaveID.Length > 0)
        {
            isSuccess = new TBaseIndustryInfoLogic().Edit(objVo);
            if (isSuccess)
            {
                new PageBase().WriteLog("修改行业信息", "", new PageBase().LogInfo.UserInfo.USER_NAME + "修改行业信息" + objVo.ID + "成功");
            }
        }
        else
        {
            isSuccess = new TBaseIndustryInfoLogic().Create(objVo);
            if (isSuccess)
            {
                new PageBase().WriteLog("新增行业信息", "", new PageBase().LogInfo.UserInfo.USER_NAME + "新增行业信息" + objVo.ID + "成功");
            }
        }

        if (isSuccess)
        {
            return("1");
        }
        else
        {
            return("0");
        }
    }