Пример #1
0
    public static string getDeptName(string strValue)
    {
        string strResults = "";

        List <TSysDictVo> lstDict = new TSysDictLogic().GetDataDictListByType("dept");

        DataTable dt = new TSysPostLogic().SelectByTable_byUser(strValue);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            string strDeptCode = dt.Rows[i]["POST_DEPT_ID"].ToString();
            if (strDeptCode.Length > 0)
            {
                for (int j = 0; j < lstDict.Count; j++)
                {
                    if (lstDict[j].DICT_CODE == strDeptCode)
                    {
                        if (strResults.IndexOf(lstDict[j].DICT_TEXT) < 0)
                        {
                            strResults += (strResults.Length > 0 ? "," : "") + lstDict[j].DICT_TEXT;
                        }
                    }
                }
            }
        }
        return(strResults);
    }
Пример #2
0
    private void GetPostStr(string strID, ref string strPostNames, ref string strPostIDs)
    {
        TSysUserPostVo objUserPost = new TSysUserPostVo();

        objUserPost.USER_ID = strID;
        DataTable dtUserPost = new TSysUserPostLogic().SelectByTable(objUserPost);

        TSysPostVo objPost = new TSysPostVo();

        objPost.IS_DEL = "0";
        //objPost.IS_HIDE = "0";
        DataTable dtPost = new TSysPostLogic().SelectByTable(objPost);

        for (int i = 0; i < dtUserPost.Rows.Count; i++)
        {
            for (int j = 0; j < dtPost.Rows.Count; j++)
            {
                if (dtPost.Rows[j]["ID"].ToString() == dtUserPost.Rows[i]["POST_ID"].ToString())
                {
                    strPostNames += (strPostNames.Length > 0 ? "," : "") + dtPost.Rows[j]["POST_NAME"].ToString();
                    strPostIDs   += (strPostIDs.Length > 0 ? "," : "") + dtPost.Rows[j]["ID"].ToString();
                }
            }
        }
    }
Пример #3
0
    public static string getPostName(string strValue)
    {
        string strResults = "";

        DataTable dt = new TSysPostLogic().SelectByTable_byUser(strValue);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            strResults += (strResults.Length > 0 ? "," : "") + dt.Rows[i]["POST_NAME"].ToString();
        }
        return(strResults);
    }
    public void InitPostList()
    {
        lsbAll.Items.Clear();
        DataTable dt = new TSysPostLogic().SelectByTable(new TSysPostVo()
        {
            IS_DEL = "0"
        });

        lsbAll.DataSource     = dt.DefaultView;
        lsbAll.DataTextField  = TSysPostVo.POST_NAME_FIELD;
        lsbAll.DataValueField = TSysPostVo.ID_FIELD;
        lsbAll.DataBind();
    }
Пример #5
0
    /// <summary>
    /// 绑定职位树,获取json数据
    /// </summary>
    private void BindPostTree()
    {
        TSysPostVo objPostVo = new TSysPostVo();

        objPostVo.IS_DEL = "0";
        DataTable dt = new TSysPostLogic().SelectByTable(objPostVo);

        if (dt.Rows.Count < 1)
        {
            return;
        }

        BindTreeRoot(dt, "0", 1);// 绑定根节点,获取json数据
    }
Пример #6
0
    //获取信息
    private string getMessage()
    {
        string strSortname  = Request.Params["sortname"];
        string strSortorder = Request.Params["sortorder"];
        string strDept      = "";
        //当前页面
        int intPageIndex = Convert.ToInt32(Request.Params["page"]);
        //每页记录数
        int intPageSize = Convert.ToInt32(Request.Params["pagesize"]);

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

        DataTable dtDept = new TSysPostLogic().SelectByTable_byUser(LogInfo.UserInfo.ID);

        for (int i = 0; i < dtDept.Rows.Count; i++)
        {
            string strDeptCode = dtDept.Rows[i]["POST_DEPT_ID"].ToString();
            if (strDeptCode.Length > 0)
            {
                strDept += (strDept.Length > 0) ? "," + strDeptCode : strDeptCode;
            }
        }

        TOaMessageInfoVo objMessage = new TOaMessageInfoVo();

        objMessage.SORT_FIELD = strSortname;
        objMessage.SORT_TYPE  = strSortorder;
        DataTable dt            = new TOaMessageInfoLogic().SelectByUserIdAndDept(LogInfo.UserInfo.ID, intPageIndex, intPageSize);
        int       intTotalCount = new TOaMessageInfoLogic().GetSelectByUserIdAndDeptCount(LogInfo.UserInfo.ID, strDept);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            if (dt.Rows[i]["REMARK1"].ToString() == "0")
            {
                dt.Rows[i]["REMARK1"] = "未读";
            }
            if (dt.Rows[i]["REMARK1"].ToString() == "1")
            {
                dt.Rows[i]["REMARK1"] = "已读";
            }
        }

        string strJson = CreateToJson(dt, intTotalCount);

        return(strJson);
    }
    /// <summary>
    /// 获取用户信息
    /// </summary>
    /// <returns></returns>
    protected string getUserInfo()
    {
        //获得所有监测类别
        DataTable  dtSonTask = new TMisMonitorSubtaskLogic().selectAllContractType(this.hdnTaskID.Value);
        string     reslut    = "";
        DataTable  dtTotal   = new DataTable();
        TSysDutyVo objItems  = new TSysDutyVo();

        /*
         * foreach (DataRow dr in dtSonTask.Rows)
         * {
         *  DataTable dt = new DataTable();
         *  objItems.DICT_CODE = "duty_reportschedule";
         *  objItems.MONITOR_TYPE_ID = dr["MONITOR_ID"].ToString();
         *  dt = new TSysDutyLogic().SelectByUnionTable(objItems, 0, 0);
         *  dt.Columns.Add("MONITOR_NAME");
         *  dt.Columns.Add("POST_NAME");
         *  //添加监测类别列
         *  foreach (DataRow drSon in dt.Rows)
         *  {
         *      drSon["MONITOR_NAME"] = new TBaseMonitorTypeInfoLogic().Details(dr["MONITOR_ID"].ToString()).MONITOR_TYPE_NAME;
         *      drSon["POST_NAME"] = new TSysPostLogic().Details(new TSysUserPostLogic().Details(new TSysUserPostVo() { USER_ID = drSon["ID"].ToString() }).POST_ID).POST_NAME;
         *  }
         *  dtTotal.Merge(dt);
         * }
         */
        DataTable dt = new DataTable();

        objItems.DICT_CODE       = "duty_reportschedule";
        objItems.MONITOR_TYPE_ID = "000000001";  //默认报告编制人是废水类型的
        dt = new TSysDutyLogic().SelectByUnionTable(objItems, 0, 0);
        dt.Columns.Add("MONITOR_NAME");
        dt.Columns.Add("POST_NAME");
        //添加监测类别列
        foreach (DataRow drSon in dt.Rows)
        {
            drSon["MONITOR_NAME"] = new TBaseMonitorTypeInfoLogic().Details("000000001").MONITOR_TYPE_NAME;
            drSon["POST_NAME"]    = new TSysPostLogic().Details(new TSysUserPostLogic().Details(new TSysUserPostVo()
            {
                USER_ID = drSon["ID"].ToString()
            }).POST_ID).POST_NAME;
        }
        dtTotal.Merge(dt);
        reslut = LigerGridDataToJson(dtTotal, dtTotal.Rows.Count);
        return(reslut);
    }
    public static string getDeptName(string strValue)
    {
        string strResults = "";

        List <TSysDictVo> lstDict = new TSysDictLogic().GetDataDictListByType("dept");

        TSysPostVo objVo = new TSysPostLogic().Details(strValue);

        for (int j = 0; j < lstDict.Count; j++)
        {
            if (lstDict[j].DICT_CODE == objVo.POST_DEPT_ID)
            {
                strResults = lstDict[j].DICT_TEXT;
            }
        }

        return(strResults);
    }
    //获取职位
    private void GetPost()
    {
        string strSortname  = "NUM";
        string strSortorder = Request.Params["sortorder"];

        TSysPostVo objVo = new TSysPostVo();

        objVo.IS_DEL     = "0";
        objVo.IS_HIDE    = "0";
        objVo.SORT_FIELD = strSortname;
        objVo.SORT_TYPE  = strSortorder;
        DataTable dt            = new TSysPostLogic().SelectByTable(objVo, 0, 0);
        int       intTotalCount = new TSysPostLogic().GetSelectResultCount(objVo);

        string strJson = CreateToJson(dt, intTotalCount);

        Response.Write(strJson);
        Response.End();
    }
Пример #10
0
    //页面初始化
    private void InitPage()
    {
        BindDataDictToControl("dept", this.PlanDept);

        TSysUserPostVo UserPostVo = new TSysUserPostVo();

        UserPostVo.USER_ID = LogInfo.UserInfo.ID;
        TSysPostVo PostVo = new TSysPostVo();

        PostVo = new TSysPostLogic().Details(((TSysUserPostVo) new TSysUserPostLogic().SelectByObject(UserPostVo, 0, 0)[0]).POST_ID);
        this.PlanDept.SelectedValue = PostVo.POST_DEPT_ID;

        this.hidUserID.Value  = LogInfo.UserInfo.ID;
        this.PlanDate.Value   = DateTime.Now.ToString("yyyy-MM-dd");
        this.PlanPerson.Value = LogInfo.UserInfo.REAL_NAME;

        if (!string.IsNullOrEmpty(this.hidId.Value))
        {
            TOaPartBuyRequstVo objPartBuyRequst = new TOaPartBuyRequstLogic().Details(this.hidId.Value);

            this.PlanBt.Value           = objPartBuyRequst.APPLY_TITLE;
            this.PlanDept.SelectedValue = objPartBuyRequst.APPLY_DEPT_ID;
            this.PlanPerson.Value       = !string.IsNullOrEmpty(objPartBuyRequst.APPLY_USER_ID) ? new TSysUserLogic().Details(objPartBuyRequst.APPLY_USER_ID).REAL_NAME : "";
            this.PlanDate.Value         = !string.IsNullOrEmpty(objPartBuyRequst.APPLY_DATE) ? DateTime.Parse(objPartBuyRequst.APPLY_DATE).ToShortDateString() : "";
            this.PlanContent.Value      = objPartBuyRequst.APPLY_CONTENT;
            this.TestOption.Value       = objPartBuyRequst.APP_DEPT_INFO;
            this.TestName.Value         = !string.IsNullOrEmpty(objPartBuyRequst.APP_DEPT_ID) ? new TSysUserLogic().Details(objPartBuyRequst.APP_DEPT_ID).REAL_NAME : LogInfo.UserInfo.REAL_NAME;
            this.TestDate.Value         = !string.IsNullOrEmpty(objPartBuyRequst.APP_DEPT_DATE) ? DateTime.Parse(objPartBuyRequst.APP_DEPT_DATE).ToShortDateString() : DateTime.Now.ToShortDateString();
            this.OfficeOption.Value     = objPartBuyRequst.APP_OFFER_INFO;
            this.OfficeName.Value       = !string.IsNullOrEmpty(objPartBuyRequst.APP_OFFER_ID) ? new TSysUserLogic().Details(objPartBuyRequst.APP_OFFER_ID).REAL_NAME : LogInfo.UserInfo.REAL_NAME;
            this.OfficeDate.Value       = !string.IsNullOrEmpty(objPartBuyRequst.APP_OFFER_TIME) ? DateTime.Parse(objPartBuyRequst.APP_OFFER_TIME).ToShortDateString() : DateTime.Now.ToShortDateString();
            this.TechOption.Value       = objPartBuyRequst.APP_MANAGER_INFO;
            this.TechName.Value         = !string.IsNullOrEmpty(objPartBuyRequst.APP_MANAGER_ID) ? new TSysUserLogic().Details(objPartBuyRequst.APP_MANAGER_ID).REAL_NAME : LogInfo.UserInfo.REAL_NAME;
            this.TechDate.Value         = !string.IsNullOrEmpty(objPartBuyRequst.APP_MANAGER_DATE) ? DateTime.Parse(objPartBuyRequst.APP_MANAGER_DATE).ToShortDateString() : DateTime.Now.ToShortDateString();
            this.hidStatus.Value        = objPartBuyRequst.STATUS;
        }
        //根据当前状态设置控件可不可用
        DisableControls();
    }
    private string GetUserId_InDept()
    {
        TSysUserVo tUserV = new TSysUserVo();

        tUserV.IS_DEL  = "0";
        tUserV.IS_HIDE = "0";
        tUserV.IS_USE  = "1";
        DataTable dtUser = new TSysUserLogic().SelectByTable(tUserV);

        TSysPostVo tPostV = new TSysPostVo();

        tPostV.IS_DEL  = "0";
        tPostV.IS_HIDE = "0";
        DataTable dtPost = new TSysPostLogic().SelectByTable(tPostV);

        DataTable dtUserPost = new TSysUserPostLogic().SelectByTable(new TSysUserPostVo());

        string strLocalUserId  = base.LogInfo.UserInfo.ID;
        string strReturnUserId = "'" + strLocalUserId + "'";

        //用户的所有职位
        DataRow[] drLocalUserPost = dtUserPost.Select("USER_ID='" + strLocalUserId + "'");
        string    strLocalPostIDs = "";

        for (int i = 0; i < drLocalUserPost.Length; i++)
        {
            strLocalPostIDs += (strLocalPostIDs.Length > 0 ? "," : "") + "'" + drLocalUserPost[i]["POST_ID"].ToString() + "'";
        }
        if (strLocalPostIDs.Length == 0)
        {
            return(strReturnUserId);
        }

        //用户的所有职位为部门主任或副主任的部门id
        DataRow[] drLocalPost     = dtPost.Select("ID in (" + strLocalPostIDs + ") and POST_LEVEL_ID in ('Director','DirectorEx')");
        string    strLocalDeptIDs = "";

        for (int i = 0; i < drLocalPost.Length; i++)
        {
            strLocalDeptIDs += (strLocalDeptIDs.Length > 0 ? "," : "") + "'" + drLocalPost[i]["POST_DEPT_ID"].ToString() + "'";
        }
        if (strLocalDeptIDs.Length == 0)
        {
            return(strReturnUserId);
        }

        //用户的职位为部门主任或副主任,的部门的所有职位
        DataRow[] drSrhPost     = dtPost.Select("POST_DEPT_ID in (" + strLocalDeptIDs + ")");
        string    strSrhPostIDs = "";

        for (int i = 0; i < drSrhPost.Length; i++)
        {
            strSrhPostIDs += (strSrhPostIDs.Length > 0 ? "," : "") + "'" + drSrhPost[i]["ID"].ToString() + "'";
        }
        if (strSrhPostIDs.Length == 0)
        {
            return(strReturnUserId);
        }

        //用户的职位为部门主任或副主任,的部门的所有职位对应的用户
        DataRow[] drSrhUserPost = dtUserPost.Select("POST_ID in (" + strSrhPostIDs + ")");
        string    strSrhUSerIDs = "";

        for (int i = 0; i < drSrhUserPost.Length; i++)
        {
            strSrhUSerIDs += (strSrhUSerIDs.Length > 0 ? "," : "") + "'" + drSrhUserPost[i]["USER_ID"].ToString() + "'";
        }
        if (strSrhUSerIDs.Length == 0)
        {
            return(strReturnUserId);
        }

        return(strSrhUSerIDs);
    }