コード例 #1
0
ファイル: PawnPayment.cs プロジェクト: njmube/PawnPOS
        public void GetTransactionDetails()
        {
            string transactionID = TransIDTextBox.Text;
            DataTable pawnDetailTable = new DataTable();
            DataManager dataManager = new DataManager(connectionString);
            pawnDetailTable = dataManager.GetPawnDetails(transactionID);

            string productDesc = pawnDetailTable.Rows[0]["ProductDescription"].ToString();
            ProdDescLabel.Text = productDesc;

            string status = pawnDetailTable.Rows[0]["Status"].ToString();
            PawnStatusLabel.Text = status;

            string pawnDate = Convert.ToDateTime(pawnDetailTable.Rows[0]["PawnDate"]).ToShortDateString();
            PawnDateLabel.Text = pawnDate;

            principal = Convert.ToInt32(pawnDetailTable.Rows[0]["PrincipalAmount"]);
            string principalAmount = string.Format("{0:C}", principal);
            PrincipalAmountLabel.Text = principalAmount;

            currentPrincipal = GetCurrentPrincipal();
            if (currentPrincipal == 0)
            {
                CurrentPrincipalLabel.Text = principalAmount;
            }
            else
            {
                string newPrincipal = string.Format("{0:C}", currentPrincipal);
                CurrentPrincipalLabel.Text = newPrincipal;
            }
        }