public TransactionView(string sessionUserMainMenu)
        {
            InitializeComponent();
            sessionUserViewAllTransactions = sessionUserMainMenu;

            List <Transaction> ListOfTransaction = new List <Transaction>();

            ListOfTransaction = TransactionCollection.ReturnAList();

            this.TransactionListSelect.ItemsSource = ListOfTransaction;
        }
Esempio n. 2
0
 //use different names in the parameters than what is your private variables
 //constructor
 public Transaction(bool Credit, string custID, double transactAmount, string cgory,
                    DateTime transactDate, string AssID, DateTime createdOn, string createdBy,
                    DateTime lastUpdatedOn, string lastUpdatedBy, string notes)
     : base(createdOn, createdBy, lastUpdatedOn, lastUpdatedBy, notes)
 {
     IsCredit          = Credit;
     CustomerID        = custID;
     TransactionAmount = transactAmount;
     Category          = cgory;
     TransactionDate   = transactDate;
     AssetID           = AssID; // assetID == 1 is for cash, everything else is a material item eg. inventory
     transactionID     = TransactionCollection.GetTransactionID();
 }
Esempio n. 3
0
        private void Next_Click(object sender, RoutedEventArgs e)
        {
            string   createdBy, notes;
            string   lastUpdatedBy;
            DateTime createdOn, lastUpdatedOn;
            double   transactAmount;
            string   cgory;
            bool     isCredit = true;

            if (IsCredit.Text == "Yes")
            {
                isCredit = true;
            }
            else if (IsCredit.Text == "No")
            {
                isCredit = true;
            }
            transactAmount = Convert.ToDouble(TransactionAmount.Text);
            cgory          = TransactionCategory.Text;



            createdBy     = sessionUserTransactionAdd;
            createdOn     = DateTime.Now;
            lastUpdatedBy = sessionUserTransactionAdd;
            lastUpdatedOn = DateTime.Now;
            notes         = NotesTextBox.Text;

            TransactionCollection.AddTransaction(isCredit, passedCustomer, transactAmount, cgory, createdOn,
                                                 passedAsset, createdOn, createdBy, lastUpdatedOn, lastUpdatedBy, notes);

            MainMenu main = new MainMenu(sessionUserTransactionAdd);

            App.Current.MainWindow = main;
            this.Close();
            main.Show();
        }