public addressForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            try
            {
                FCApp = ClarifyApplication.Initialize();

                //this.addAddressLabel.Text = String.Format("Add an Address to the database: {0}", SchemaCache.c );

                //	Create a new ClarifySession
                this.session = FCApp.CreateSession();
                this.dataSet = new ClarifyDataSet(session);

                state.DropDownStyle = ComboBoxStyle.DropDownList;
                country.DropDownStyle = ComboBoxStyle.DropDownList;
                timeZone.DropDownStyle = ComboBoxStyle.DropDownList;

                FillCountryDropDown();
                FillStateDropDown( country.SelectedItem.ToString() );
                FillTimeZoneDropDown( country.SelectedItem.ToString() );

            }
            catch(Exception ex)
            {
                string errorMsg = string.Format("Trouble populating form:\n\n{0}", ex.Message);
                MessageBox.Show(errorMsg, "Demo Initialization Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public IClarifyApplication Create()
        {
            if (FCApplication.IsInitialized)
            {
                _logger.LogDebug("Dovetail SDK already initialized");
                return(ClarifyApplication.Instance);
            }
            lock (SyncRoot)
            {
                if (FCApplication.IsInitialized)
                {
                    _logger.LogWarn("Dovetail SDK already initialized (In Sync Check)");
                    return(ClarifyApplication.Instance);
                }

                _logger.LogInfo("Initializing Dovetail SDK");

                var configuration = GetDovetailSDKConfiguration(_dovetailDatabaseSettings);

                var application = ClarifyApplication.Initialize(configuration);

                setSessionDefaultTimeout(_dovetailDatabaseSettings);

                RegisterWorkflowMetadata(_metadatas, _logger);

                return(application);
            }
        }
Esempio n. 3
0
        public void SetUp()
        {
            // TODO -- Pull this from the app config
            var clarify = ClarifyApplication.Initialize(new NameValueCollection
            {
                { "fchoice.connectionstring", "Data Source=.; Initial Catalog=mobilecl125; User Id=sa; Password=sa;" },
                { "fchoice.dbtype", "mssql" },
                { "fchoice.disableloginfromfcapp", "false" },
                { "fchoice.sessionpasswordrequired", "false" },
                { "fchoice.nocachefile", "true" }
            });

            IClarifySessionUsageReporter reporter;

            theApplication = new InMemoryClarifyApplication(clarify);
            var logger = new NulloLogger();
            Func <IUserSessionStartObserver> startObserver = () =>
            {
                reporter = new ClarifySessionUsageReporter(theCache, theApplication, logger);
                return(new SessionStartObserver(reporter));
            };

            theCache = new ClarifySessionCache(theApplication, logger,
                                               new NulloSessionConfigurator(),
                                               () => new SessionEndObserver(),
                                               startObserver,
                                               new DovetailDatabaseSettings());

            theData = new ObjectMother(clarify);

            theEmployee  = theData.GenerateEmployees(1).Single();
            theSessionId = theCache.GetSession(theEmployee).Id;
            theApplication.InvalidateSession(theSessionId);
        }
        private ClarifyApplication initializeClarify()
        {
            var configuration = GetDovetailSdkConfiguration(_settings, _crmSettings);

            DbProviderFactory.Provider = DbProviderFactory.CreateProvider(_settings.Type);

            var settings = new StringBuilder();

            foreach (var key in configuration.AllKeys)
            {
                if (key.ToLower().Contains("connectionstring"))
                {
                    continue;
                }

                settings.AppendLine(string.Format("{0}={1}", key, configuration[key]));
            }

            _logger.LogDebug("Initializing Clarify with settings: {0}", settings.ToString());

            var application = ClarifyApplication.Initialize(configuration);

            setSessionDefaultTimeout(_settings);

            return(application);
        }
 public ClarifyContext(DovetailDatabaseSettings settings, IContainer container, ILogger logger, DovetailCRMSettings crmSettings)
 {
     _settings           = settings;
     _container          = container;
     _logger             = logger;
     _crmSettings        = crmSettings;
     _clarifyApplication = InitializeClarifyApplication();
 }
 public ClarifyContext(DovetailDatabaseSettings settings, IContainer container, ILogger logger, DovetailCRMSettings crmSettings)
 {
     _settings = settings;
     _container = container;
     _logger = logger;
     _crmSettings = crmSettings;
     _clarifyApplication = InitializeClarifyApplication();
 }
Esempio n. 7
0
        private void InitializeClarifyApplication()
        {
            if (!ClarifyApplication.IsInitialized)
            {
                // Set working directory to the application path
                NameValueCollection envValues =
                    new NameValueCollection(ConfigurationManager.AppSettings);

                envValues[ConfigValues.CACHE_FILE_PATH] = Path.Combine(
                    Server.MapPath("."),
                    CacheManager.FC_CACHE_PATH_SUFFIX);

                //	Initialize the application
                ClarifyApplication.Initialize(envValues);
            }
        }
Esempio n. 8
0
        static void Main(string[] args)
        {
            try
            {
                // Initialize ClarifyApplication
                FCApp = ClarifyApplication.Initialize();

                // Create a new ClarifySession
                ClarifySession sess = FCApp.CreateSession();

                //Create a new ClarifyDataSet
                ClarifyDataSet ds = new ClarifyDataSet(sess);

                //	Create a new ClarifyGeneric object for address records
                ClarifyGeneric generic = ds.CreateGeneric("address");

                //	Check for address xml file
                if (!File.Exists(ADDRESS_PATH))
                {
                    Console.WriteLine("Unable to find \"{0}\".", ADDRESS_PATH);
                    Console.WriteLine("Please ensure this file is in the same directory as the exe.");

                    //	Exit application
                    Console.WriteLine("Press Enter to exit...");
                    Console.ReadLine();
                    return;
                }

                //	Load address.xml into a XmlDocument
                XmlDocument doc = new XmlDocument();
                doc.Load(ADDRESS_PATH);

                //	Insert new address records into the database.
                InsertRecords(doc, generic);

                //	Exit application
                Console.WriteLine("Press Enter to exit...");
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine("There was an unhandled exception when running the demo.");
                Console.WriteLine();
                Console.WriteLine(ex);
            }
        }
Esempio n. 9
0
        public ClarifyApplication Create()
        {
            if (FCApplication.IsInitialized)
            {
                return(ClarifyApplication.Instance);
            }
            lock (SyncRoot)
            {
                if (FCApplication.IsInitialized)
                {
                    return(ClarifyApplication.Instance);
                }

                var configuration = GetDovetailSDKConfiguration(_dovetailDatabaseSettings);

                var application = ClarifyApplication.Initialize(configuration);

                setSessionDefaultTimeout(_dovetailDatabaseSettings);

                return(application);
            }
        }
Esempio n. 10
0
 public ObjectMother(ClarifyApplication app)
 {
     _session      = app.CreateSession("sa", ClarifyLoginType.User);
     _instructions = new List <CleanupInstruction>();
 }
Esempio n. 11
0
        static void Main(string[] args)
        {
            try
            {
                // Initialize ClarifyApplication
                FCApp = ClarifyApplication.Initialize();

                // Create a new ClarifySession
                ClarifySession sess = FCApp.CreateSession();

                //Create a new ClarifyDataSet
                ClarifyDataSet ds = new ClarifyDataSet(sess);

                //	Create a new ClarifyGeneric object for address records
                ClarifyGeneric generic = ds.CreateGeneric("address");

                //	Check for address xml file
                if( !File.Exists(ADDRESS_PATH) )
                {
                    Console.WriteLine("Unable to find \"{0}\".", ADDRESS_PATH);
                    Console.WriteLine("Please ensure this file is in the same directory as the exe.");

                    //	Exit application
                    Console.WriteLine("Press Enter to exit...");
                    Console.ReadLine();
                    return;
                }

                //	Load address.xml into a XmlDocument
                XmlDocument doc = new XmlDocument();
                doc.Load(ADDRESS_PATH);

                //	Insert new address records into the database.
                InsertRecords(doc, generic);

                //	Exit application
                Console.WriteLine("Press Enter to exit...");
                Console.ReadLine();
            }
            catch( Exception ex )
            {
                Console.WriteLine("There was an unhandled exception when running the demo.");
                Console.WriteLine();
                Console.WriteLine(ex);
            }
        }
Esempio n. 12
0
 public InMemoryClarifyApplication(ClarifyApplication inner)
 {
     _inner = inner;
 }