Example #1
0
        private AuthenticationLevel LoginToIndividualSource (string sourceAlias, string username, string password)
        {
            AuthenticationLevel ret = AuthenticationLevel.None;

            try
            {
                string wsId = m_SysConfig.GetDefaultConfig().WorkstationAlias;
                UserInfo userInfo = new UserInfo(username, password);
                WorkstationInfo wsInfo = new WorkstationInfo(wsId, userInfo);

                LoginResponse loginResponse = m_DataSourceAccess.Login(sourceAlias, wsInfo);

                ret = loginResponse.UserAuthenticationLevel;

                if (!ret.Equals(AuthenticationLevel.None))
                {
                    SysConfiguration sysConfig = new SysConfiguration();
                    sysConfig.ID = sourceAlias;
                    sysConfig.ContainerDBConnectionString = loginResponse.systemConfiguration.ContainerDBConnectString;
                    sysConfig.ContainerRefreshPeriodmsecs = loginResponse.systemConfiguration.ContainerRefreshPeriodSeconds * 1000;

                    if (m_SysConfig.Contains(sourceAlias))
                    {
                        m_SysConfig.Delete(sourceAlias);
                    }

                    m_SysConfig.Add(sysConfig);

                    if (m_SysConfig.UserProfileManager.Profile == null)
                    {
                        ProfileObject profile = ProfileTranslator.Translate(loginResponse.UserProfile, 4);
                        profile.SourceAlias = sourceAlias;
                        profile.UserName = wsInfo.userInfo.UserName;
                        profile.Password = wsInfo.userInfo.Password;

                        m_SysConfig.UserProfileManager.Profile = profile;
                        m_SysConfig.UserProfileManager.Profile.ProfileUpdatedEvent += new ProfileUpdated(ProfileUpdated);
                    }

                    DataSet caselist = null;
                    m_DataSourceAccess.GetCaseList(sourceAlias, out caselist);

                    if (caselist != null)
                    {
                        CaseListDataSet caseListDataSet = (CaseListDataSet)caselist;
                        caseListDataSet.CaseListTable.CaseListTableRowChanged +=
                            new CaseListDataSet.CaseListTableRowChangeEventHandler(CaseListTable_CaseListTableRowChanged);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return ret;
        }
Example #2
0
 public WorkstationInfo(String awsId, UserInfo userInfo)
 {
     m_WorkstationId = awsId;
     m_UserInfo = userInfo;
 }
Example #3
0
 public WorkstationInfo(String awsId)
 {
     m_WorkstationId = awsId;
     m_UserInfo = new UserInfo();
 }
Example #4
0
 public WorkstationInfo(UserInfo userInfo)
 {
     m_WorkstationId = String.Empty;
     m_UserInfo = userInfo;
 }
Example #5
0
 public WorkstationInfo()
 {
     m_WorkstationId = String.Empty;
     m_UserInfo = new UserInfo();
 }