Ejemplo n.º 1
0
 public static DataTable GetUserInfo(string ShowType, string OprtType, string IsShow)
 {
     try
     {
         string    companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
         DataTable dt        = new DataTable();
         if (IsShow == "1")
         {
             dt = UserDeptSelectDBHelper.GetUserInfo(companyCD);
         }
         else
         {
             dt = UserDeptSelectDBHelper.GetUserInfo(companyCD, "");
         }
         if (dt != null && dt.Rows.Count > 0)
         {
             //单选人员
             if (ShowType == SHOWTYPE_CODE_USERS && OprtType == OPRT_CODE_SELECT)
             {
                 foreach (DataRow rows in dt.Rows)
                 {
                     if (rows["Flag"].ToString().Trim() == "3")
                     {
                         rows["EmployeesName"] = "<input type='radio' name='select'  id='chk_" + rows["ID"] + "' value='" + rows["ID"] + "|" + rows["EmployeesName"].ToString() + "'   >" + rows["EmployeesName"].ToString() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=red>已离职</font>";
                     }
                     else
                     {
                         rows["EmployeesName"] = "<input type='radio' name='select'  id='chk_" + rows["ID"] + "' value='" + rows["ID"] + "|" + rows["EmployeesName"].ToString() + "'   >" + rows["EmployeesName"].ToString();
                     }
                 }
             }
             else if (ShowType == SHOWTYPE_CODE_USERS && OprtType == OPRT_CODE_SELECTS)
             {//多选人员
                 foreach (DataRow rows in dt.Rows)
                 {
                     if (rows["Flag"].ToString().Trim() == "3")
                     {
                         rows["EmployeesName"] = rows["EmployeesName"].ToString() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=red>已离职</font>";
                     }
                 }
             }
         }
         return(dt);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取员工信息
        /// </summary>
        /// <returns>DataTable 员工信息</returns>
        public static DataTable GetUserInfo()
        {
            string companyCD = string.Empty;

            //获取公司代码
            try
            {
                //companyCD = "AAAAAA";
                companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
            }
            catch
            {
                companyCD = "AAAAAA";
            }
            //查询员工信息
            return(UserDeptSelectDBHelper.GetUserInfo(companyCD));
        }