Example #1
0
        /// <summary>
        /// 验证病种组合操作权限
        /// </summary>
        /// <auth>Yanqiao.Cai</auth>
        /// <date>2013-01-06</date>
        /// <param name="createUser">创建人</param>
        /// <returns></returns>
        private string CheckDiseaseGroupRight(string createUser)
        {
            try
            {
                if (string.IsNullOrEmpty(createUser))
                {
                    return("该组合为系统默认组合,您没有操作权限。");
                }
                else if (createUser != DS_Common.currentUser.Id)
                {
                    string    nameStr = string.Empty;
                    DataTable userDt  = DS_SqlService.GetUserByID(createUser);
                    if (null != userDt && userDt.Rows.Count > 0)
                    {
                        nameStr = userDt.Rows[0]["NAME"].ToString() + "(" + createUser + ")";
                    }
                    else
                    {
                        nameStr = createUser;
                    }
                    return("该组合为 " + nameStr + " 创建,您没有操作权限。");
                }

                return(string.Empty);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Example #2
0
 /// <summary>
 /// 根据用户ID获取用户名称和ID显示字符串
 /// 格式:用户名(用户ID)
 /// </summary>
 /// <auth>Yanqiao.Cai</auth>
 /// <date>2013-01-16</date>
 /// <param name="userID"></param>
 /// <returns></returns>
 public static string GetUserNameAndID(string userID)
 {
     try
     {
         if (string.IsNullOrEmpty(userID))
         {
             return(string.Empty);
         }
         string    userStr = userID;
         DataTable userDt  = DS_SqlService.GetUserByID(userID);
         if (null != userDt && userDt.Rows.Count > 0)
         {
             userStr = userDt.Rows[0]["NAME"].ToString() + "(" + userID + ")";
         }
         return(userStr);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Example #3
0
 /// <summary>
 /// 获取角色
 /// </summary>
 /// <auth>Yanqiao.Cai</auth>
 /// <date>2013-05-27</date>
 /// <param name="userid">用户ID</param>
 /// <returns></returns>
 public static List <string> GetRolesByUserID(string userid)
 {
     try
     {
         DataTable dt = DS_SqlService.GetUserByID(userid);
         if (null == dt || dt.Rows.Count == 0)
         {
             return(null);
         }
         string jobs = dt.Rows[0]["jobid"].ToString();
         if (null == jobs || string.IsNullOrEmpty(jobs.Trim()))
         {
             return(null);
         }
         return(jobs.Split(',').ToList());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }