예제 #1
0
        public void Display()
        {
            mUCs p_mucs = mUCs.s_mUCs;

            p_mucs.HideAll();

            p_mucs.m_ucLoggedIn.Left = p_mucs.m_ucLogin.Left;
            p_mucs.m_ucLoggedIn.Top  = p_mucs.m_ucLogin.Top;
            p_mucs.m_ucLoggedIn.Show();

            acc = new mAccount();

            Guid?mAccount = acc.accountLoggedIn();

            if (mAccount == null || mAccount == Guid.Empty)
            {
            }
            else
            {
                cAcc = new cAccount().readById((Guid)mAccount);
                //Check if should log out
                TimeSpan ts = DateTime.Now - cAcc.accDT;
                if (ts.Minutes >= 5)
                {
                    p_mucs.m_ucLogin.Display();
                }
                mCash mCash = new mCash();
                LINuser.Text    = cAcc.accUserName;
                LINbalance.Text = mCash.getBalance();
            }
        }
예제 #2
0
        public void Display()
        {
            mUCs p_mucs = mUCs.s_mUCs;

            p_mucs.HideAll();

            //p_mucs.m_ucLogin.Left = p_mucs.m_ucLogin.Left;
            //p_mucs.m_ucLogin.Top = p_mucs.m_ucLogin.Top;
            p_mucs.m_ucLogin.Show();
        }
예제 #3
0
        public void Display()
        {
            mUCs p_mucs = mUCs.s_mUCs;

            p_mucs.HideAll();

            p_mucs.m_ucCashAdd.Left = p_mucs.m_ucLogin.Left;
            p_mucs.m_ucCashAdd.Top  = p_mucs.m_ucLogin.Top;
            p_mucs.m_ucCashAdd.Show();

            cAcc = new cAccount().checkLoggedIn();
        }
예제 #4
0
        public void Display()
        {
            mUCs p_mucs = mUCs.s_mUCs;

            p_mucs.HideAll();

            p_mucs.m_ucTransactions.Left = p_mucs.m_ucLogin.Left;
            p_mucs.m_ucTransactions.Top  = p_mucs.m_ucLogin.Top;
            p_mucs.m_ucTransactions.Show();

            p_mucs.m_ucTransactions.dgTransactions.DataSource = spGetTransactionsTableAdapter.GetData();
        }
예제 #5
0
        public void Display()
        {
            mUCs p_mucs = mUCs.s_mUCs;

            p_mucs.HideAll();

            p_mucs.m_ucCashSpend.Left = p_mucs.m_ucLogin.Left;
            p_mucs.m_ucCashSpend.Top  = p_mucs.m_ucLogin.Top;
            p_mucs.m_ucCashSpend.Show();

            cAcc = new cAccount().checkLoggedIn();

            PCScombo.DataSource = spCashSpendCategoryTableAdapter.GetData();
        }
예제 #6
0
        public void Display()
        {
            //Simlar to the other display methods ----------------------

            mUCs p_mucs = mUCs.s_mUCs;

            p_mucs.HideAll();

            p_mucs.m_ucUserProfile.Left = p_mucs.m_ucLogin.Left;
            p_mucs.m_ucUserProfile.Top  = p_mucs.m_ucLogin.Top;
            p_mucs.m_ucUserProfile.Show();

            acc = new mAccount();
            Guid?mAccount = acc.accountLoggedIn();

            if (acc == null || mAccount == Guid.Empty)
            {
            }
            else
            {
                cAcc = new cAccount().readById((Guid)mAccount);
                //Check if should log out
                TimeSpan ts = DateTime.Now - cAcc.accDT;
                if (ts.Minutes >= 5)
                {
                    p_mucs.m_ucLogin.Display();
                }
            }
            //-------------------------------------------------------------


            p_mucs.m_ucUserProfile.lblFName.Text    = cAcc.accFirstName;
            p_mucs.m_ucUserProfile.lblSName.Text    = cAcc.accLastName;
            p_mucs.m_ucUserProfile.lblUsername.Text = cAcc.accUserName;
            p_mucs.m_ucUserProfile.lblRoles.Text    = string.Empty;

            if (cAcc.accAccountTypeList != null && cAcc.accAccountTypeList.Count > 0)
            {
                p_mucs.m_ucUserProfile.lblRoles.Text = string.Join(", ", cAcc.accAccountTypeList.Select(x => x.actName));
                //p_mucs.m_ucUserProfile.lblFName.Text.TrimEnd(new char[] { ' ', ',' });
            }

            //Apologies, without spending a fair amount of time looking into your SQL adapter/connection pattern I don't fully understand how it works.
            //Normally I use dapper, however rather than start trying to implement that i'm resulting to a very simplistic way of querying.
            try
            {
                var dt = new DataTable();
                dt.Columns.Add("EventTime");
                dt.Columns.Add("EventType");

                using (var connection = new SqlConnection(global::NetTest.Properties.Settings.Default.sitedbConnectionString))
                {
                    if (connection.State != ConnectionState.Open)
                    {
                        connection.Open();
                    }

                    var cmd = new SqlCommand("spGetLoginTimesByAccountId", connection);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@AccountId", cAcc.accId.ToString());

                    using (SqlDataReader dr = cmd.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            dt.Rows.Add(dr[0], dr[1]);
                        }
                    }
                    p_mucs.m_ucUserProfile.dgLoginAudit.DataSource = dt;
                }
            }
            catch (Exception ex)
            {
                //Log error
            }
        }