Beispiel #1
0
        /// <summary>
        /// Called by an application immediately before the <see cref="E:System.Windows.Application.Startup"/> event occurs.
        /// </summary>
        public void Starting()
        {
            SiaqodbFactory.SetDBName("BrokerTools");

            _mainPage = new MainPage();
            Application.Current.RootVisual = _mainPage;
            Navigator = new Navigation(view => MainVisual = view);
        }
Beispiel #2
0
        private void oob_Click(object sender, RoutedEventArgs e)
        {
            Siaqodb instance = SiaqodbFactory.GetInstance();

            try
            {
                //Fund fund = new Fund() { productcode = "UT", fullname = "STANLIB Industrial Fund A" };
                List <RiskProfile> profiles = new List <RiskProfile>();

                profiles.Add(new RiskProfile()
                {
                    Description    = "Conservative",
                    EquityMinValue = 0.05d,
                    EquityMaxValue = 0.2d,

                    PropertyMinValue = 0d,
                    PropertyMaxValue = 0.2d,

                    BondsMinValue = 0.2d,
                    BondsMaxValue = 0.3d,

                    CashMinValue = 0.4d,
                    CashMaxValue = 0.6d
                });


                profiles.Add(new RiskProfile()
                {
                    Description    = "Moderately Conservative",
                    EquityMinValue = 0.3d,
                    EquityMaxValue = 0.4d,

                    PropertyMinValue = 0d,
                    PropertyMaxValue = 0.2d,

                    BondsMinValue = 0.2d,
                    BondsMaxValue = 0.3d,

                    CashMinValue = 0.2d,
                    CashMaxValue = 0.4d
                });

                profiles.Add(new RiskProfile()
                {
                    Description    = "Moderate",
                    EquityMinValue = 0.45d,
                    EquityMaxValue = 0.55d,

                    PropertyMinValue = 0d,
                    PropertyMaxValue = 0.2d,

                    BondsMinValue = 0.2d,
                    BondsMaxValue = 0.3d,

                    CashMinValue = 0.15d,
                    CashMaxValue = 0.25d
                });

                profiles.Add(new RiskProfile()
                {
                    Description    = "Moderately Aggressive",
                    EquityMinValue = 0.60d,
                    EquityMaxValue = 0.75d,

                    PropertyMinValue = 0d,
                    PropertyMaxValue = 0.2d,

                    BondsMinValue = 0.1d,
                    BondsMaxValue = 0.2d,

                    CashMinValue = 0.5d,
                    CashMaxValue = 0.15d
                });

                profiles.Add(new RiskProfile()
                {
                    Description    = "Aggressive",
                    EquityMinValue = 0.75d,
                    EquityMaxValue = 0.95d,

                    PropertyMinValue = 0d,
                    PropertyMaxValue = 0.2d,

                    BondsMinValue = 0d,
                    BondsMaxValue = 0.1d,

                    CashMinValue = 0d,
                    CashMaxValue = 0.1d
                });

                Transaction transaction = instance.BeginTransaction();
                try
                {
                    for (int i = 0; i < profiles.Count; i++)
                    {
                        instance.StoreObject(profiles[i]);
                    }
                    transaction.Commit();
                }
                catch
                {
                    transaction.Rollback();
                    throw;
                }
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message);
            }
            finally
            {
                //transaction
                //instance.Close();
            }
        }