Exemplo n.º 1
0
 public string GetTransactionDescription(int pTransactionTypeID)
 {
     if (pTransactionTypeID > 0)
     {
         TransactionTypesTbl _TransactionTypesTbl = new TransactionTypesTbl();
         return(_TransactionTypesTbl.GetTransactionTypeByID(pTransactionTypeID));
     }
     else
     {
         return(String.Empty);
     }
 }
Exemplo n.º 2
0
        public string GetTransactionFromID(string pTransactionID)
        {
            string _Transaction   = "n/a";
            int    _TransactionID = 0;

            if (!Int32.TryParse(pTransactionID, out _TransactionID))
            {
                _TransactionID = 0;
            }
            TransactionTypesTbl _TransactionTypes = new TransactionTypesTbl();

            if (_TransactionID > 0)
            {
                _Transaction = _TransactionTypes.GetTransactionTypeByID(_TransactionID);
            }

            return(_Transaction);
        }
Exemplo n.º 3
0
        protected void btnCreateUpdateLogTables_Click(object sender, EventArgs e)
        {
            TrackerTools _TT = new TrackerTools();

            _TT.ClearTrackerSessionErrorString();
            TrackerDb _TDB = new TrackerDb();

            // create LogTbl if it does not exist

            _TDB.CreateIfDoesNotExists(TrackerDb.SQLTABLENAME_LOGTBL);
            ltrlStatus.Visible = true;
            ltrlStatus.Text    = "Log table checked";
            if (_TT.IsTrackerSessionErrorString())
            {
                ltrlStatus.Text += " - Error: " + _TT.GetTrackerSessionErrorString();
                _TT.ClearTrackerSessionErrorString();
            }

            // list all the users that are not added
            PersonsTbl    _PersonsTbl = new PersonsTbl();
            List <string> _SecurityUsersNotInPeopleTbl = _PersonsTbl.SecurityUsersNotInPeopleTbl();

            pnlSetClinetType.Visible = true;
            gvCustomerTypes.Visible  = false;
            gvResults.DataSource     = _SecurityUsersNotInPeopleTbl;
            ResultsTitleLabel.Text   = "Security Users not in People Table ";
            if (_TT.IsTrackerSessionErrorString())
            {
                ltrlStatus.Text += " - Error: " + _TT.GetTrackerSessionErrorString();
                _TT.ClearTrackerSessionErrorString();
            }

            gvResults.DataBind();

            // create SectionTypesTbl if it does not exist
            if (_TDB.CreateIfDoesNotExists(TrackerDb.SQLTABLENAME_SECTIONTYPESTBL))
            {
                ltrlStatus.Text += "; Section Types table checked";
                if (_TT.IsTrackerSessionErrorString())
                {
                    ltrlStatus.Text += " - Error: " + _TT.GetTrackerSessionErrorString();
                    _TT.ClearTrackerSessionErrorString();
                }
                // add sections that do
                SectionTypesTbl _SectionTypeTbl = new SectionTypesTbl();
                if (_SectionTypeTbl.InsertDefaultSections())
                {
                    ltrlStatus.Text += " - default sections added.";
                }
                if (_TT.IsTrackerSessionErrorString())
                {
                    ltrlStatus.Text += " - Error: " + _TT.GetTrackerSessionErrorString();
                    _TT.ClearTrackerSessionErrorString();
                }
            }
            // create TransactionTypesTbl if it does not exists
            if (_TDB.CreateIfDoesNotExists(TrackerDb.SQLTABLENAME_TRANSACTIONTYPESTBL))
            {
                ltrlStatus.Text += "; Transaction Types table checked";
                if (_TT.IsTrackerSessionErrorString())
                {
                    ltrlStatus.Text += " - Error: " + _TT.GetTrackerSessionErrorString();
                    _TT.ClearTrackerSessionErrorString();
                }
                // add Transactions that do
                TransactionTypesTbl _TransactionTypeTbl = new TransactionTypesTbl();
                if (_TransactionTypeTbl.InsertDefaultTransactions())
                {
                    ltrlStatus.Text += " - default Transactions added.";
                }
                if (_TT.IsTrackerSessionErrorString())
                {
                    ltrlStatus.Text += " - Error: " + _TT.GetTrackerSessionErrorString();
                    _TT.ClearTrackerSessionErrorString();
                }
            }

            _TDB.Close();
        }