Exemplo n.º 1
0
 public void ReadProfiles()
 {
     try
     {
         _tableProfiles = new TableProfiles();
         if (SPDataSource == SPDataSourcer.API)
         {
             _tableProfiles.ReadSPProfiles(SPContext.Current.Site.ID);
         }
         else
         {
             _tableProfiles.ReadSqlSPProfiles(SPConnectionString, SPSiteProfiles);
         }
     }
     catch (Exception ex)
     {
         if (_labelError == null)
         {
             _labelError = new Label();
         }
         _labelError.ForeColor = System.Drawing.Color.Red;
         _labelError.Text      = "Помилка при отриманні профілів користувача!<br/><br/>\n\n" + ex.Message;
         _labelError.Visible   = true;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Imports records (list of RecordUserProfile) from 1C through SOAP
        /// </summary>
        /// <returns>true on success, false on failed</returns>
        bool Read1CRecords()
        {
            try
            {
                users1C = Import1CUserProfiles.ImportRecords(Properties.Settings.Default.soapServerUrl,
                                                             Properties.Settings.Default.soapServerUser,
                                                             Properties.Settings.Default.soapServerPassword);
            }
            catch (Exception ex)
            {
                string sError = string.Format("Read1CRecords(): Error was occured while reading 1C user profile records:\n{0}",
                                              ex.ToString());

                TextWriter errorWriter = Console.Error;
                Console.WriteLine(sError);
                errorWriter.WriteLine(sError);
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
 public void RegisterUserProfileProvider(ITableProfiles provider)
 {
     this._provider = provider;
     _tableProfiles = this._provider.ProfilesTable;
 }