Ejemplo n.º 1
0
        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 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 IClarifySession CreateSession()
        {
            var session = _clarifyApplication.CreateSession();
            var manager = _container.GetInstance <IClarifySessionManager>();

            return(new ClarifySessionAdapter(session, manager));
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
0
 public ObjectMother(ClarifyApplication app)
 {
     _session      = app.CreateSession("sa", ClarifyLoginType.User);
     _instructions = new List <CleanupInstruction>();
 }
Ejemplo n.º 6
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);
            }
        }
Ejemplo n.º 7
0
 public ClarifySession CreateSession(string userName, ClarifyLoginType loginType)
 {
     return(_inner.CreateSession(userName, loginType));
 }