public void initData()
 {
     //Create&Drop
     if (this.Database == null)
     {
         this.Database = new nwdbConnection();
     }
     sessionFactory = this.Database.Factory;
     if (this.Repository == null)
     {
         this.Repository = new nwdbRepository(sessionFactory.OpenSession());
     }
     sess = this.Repository.GetSession();
     stm  = new sysTreeManager();
     //repo.SeedMockData();
     if (this.Adventure != null)
     {
         bs_nwAdventure.List.Clear();
         bs_nwAdventure.List.Add(Adventure);
     }
     else
     {
         SetMessage("initData Failed no Adventure set");
     }
     bs_sysMileStoneType.DataSource = sess.QueryOver <DataModel.libData.sysMilestoneType>().List();
 }
Ejemplo n.º 2
0
 private void initData()
 {
     //Create&Drop
     if (this.Database == null)
     {
         this.Database = new nwdbConnection();
     }
     sessionFactory = this.Database.Factory;
     if (this.Repository == null)
     {
         this.Repository = new nwdbRepository(sessionFactory.OpenSession());
     }
     sess = this.Repository.GetSession();
     stm  = new sysTreeManager();
     //repo.SeedMockData()
     if (this.Logon != null)
     {
         isAdmin = (this.Logon.UserType.LongName == "Administrator");
         SetMessage("isAdmin calulated" + isAdmin.ToString() + " for Logon" + this.Logon.LongName);
     }
     if (this.Logon == null || isAdmin)
     {
         bs_hostUser.DataSource = sess.QueryOver <hostUser>().List();
     }
     else
     {
         bs_hostUser.DataSource = sess.QueryOver <hostUser>().Where(tx => tx.id == this.Logon.id).List();
     }
 }
Ejemplo n.º 3
0
 public virtual void InitData()
 {
     //Create&Drop
     if (this.Database == null) { this.Database = new nwdbConnection(); }
     sessionFactory = this.Database.Factory;
     if (this.Repository == null) { this.Repository = new nwdbRepository(sessionFactory.OpenSession()); }
     sess = this.Repository.GetSession();
     treeman = new sysTreeManager();
 }
Ejemplo n.º 4
0
        public void initData()
        {
            //Create&Drop
            if (this.Database == null)
            {
                this.Database = new nwdbConnection();
            }
            sessionFactory = this.Database.Factory;
            if (this.Repository == null)
            {
                this.Repository = new nwdbRepository(sessionFactory.OpenSession());
            }
            sess = this.Repository.GetSession();
            stm  = new sysTreeManager();
            //repo.SeedMockData();

            bs_sysAlignment.DataSource = sess.QueryOver <sysBaseAlignment>().List();

            if (this.Logon != null)
            {
                isAdmin = (this.Logon.UserType.LongName == "Administrator");
                SetMessage("isAdmin calulated" + isAdmin.ToString() + " for Logon" + this.Logon.LongName);
            }

            if (this.Character != null)
            {
                bs_nwChar.List.Clear();
                bs_nwChar.List.Add(Character);

                lboxLogon.Visible      = false;
                lboxCharacters.Visible = false;
                btnDelete.Visible      = false;
                btnAdd.Visible         = false;
                nwCharBindingSource_CurrentChanged(this, null);
                return;
            }

            if (this.Logon == null || isAdmin)
            {
                bs_logons.DataSource = sess.QueryOver <hostUser>().List();
            }
            else
            {
                bs_logons.DataSource = sess.QueryOver <hostUser>().Where(tx => tx.id == this.Logon.id).List();
            }
            LoadCharacters();
            bs_sysTreeStatistic.DataSource = sess.QueryOver <sysTreeStatistic>().List();
            stm.FillTreeNodeCollection <sysTreeStatistic>(sess, treeStatistic.Nodes);
            //catch late binding controls
            nwCharBindingSource_CurrentChanged(this, null);
        }
Ejemplo n.º 5
0
 public void initData()
 {
     //Create&Drop
     if (this.Database == null)
     {
         this.Database = new nwdbConnection();
     }
     sessionFactory = this.Database.Factory;
     if (this.Repository == null)
     {
         this.Repository = new nwdbRepository(sessionFactory.OpenSession());
     }
     sess = this.Repository.GetSession();
     stm  = new sysTreeManager();
     //repo.SeedMockData();
 }
Ejemplo n.º 6
0
        public frmUserManager()
        {
            InitializeComponent();
            nw = new nwdbConnection();

            //Update
            //nw = new nwdbConnection();


            sessionFactory         = nw.Factory;
            repo                   = new nwdbRepository(sessionFactory.OpenSession());
            sess                   = repo.GetSession();
            stm                    = new sysTreeManager();
            bs_hostUser.DataSource = sess.QueryOver <hostUser>().List();
            bs_userType.DataSource = sess.QueryOver <hostUserType>().List();
        }