示例#1
0
文件: MdwsUtils.cs 项目: OSEHRA/mdws
 public static User getDodUser()
 {
     User result = new User();
     result.setSSN("");
     result.setName("");
     result.Uid = "";
     result.LogonSiteId = new SiteId("", "");
     result.PermissionString = VistaConstants.CAPRI_CONTEXT;
     return result;
 }
示例#2
0
 public void setLoginSiteProperties(User user)
 {
     if (user == null || StringUtils.isEmpty(user.Uid))
     {
         throw new ArgumentException("No user ID for site");
     }
     VistaQuery vq = new VistaQuery("ORWU USERINFO");
     string rtn = (String)cxn.query(vq);
     if (rtn == null)
     {
         throw new DataException("Unable to get user info");
     }
     string[] parts = StringUtils.split(rtn, StringUtils.CARET);
     user.Uid = parts[0];
     user.setName(parts[1]);
     user.OrderRole = parts[5];
     vq = new VistaQuery("XWB GET VARIABLE VALUE");
     string arg = "@\"^VA(200," + user.Uid + ",1)\"";
     vq.addParameter(vq.REFERENCE, arg);
     rtn = (string)cxn.query(vq);
     if (rtn == "")
     {
         throw new DataException("Unable to get user SSN");
     }
     parts = StringUtils.split(rtn, StringUtils.CARET);
     user.SSN = new SocSecNum(parts[8]);
 }
示例#3
0
 internal User[] toUsers(String rtn)
 {
     ArrayList lst = new ArrayList();
     String[] entries = StringUtils.split(rtn, StringUtils.CRLF);
     for (int i = 0; i < entries.Length; i++)
     {
         if (entries[i] == "")
         {
             continue;
         }
         String[] flds = StringUtils.split(entries[i], StringUtils.CARET);
         if (StringUtils.isNumeric(flds[0]))
         {
             User user = new User();
             user.Uid = flds[0];
             user.setName(flds[1]);
             if (flds.Length > 2 && !String.IsNullOrEmpty(flds[2]))
             {
                 user.Title = flds[2];
             }
             lst.Add(user);
         }
     }
     return (User[])lst.ToArray(typeof(User));
 }