Exemple #1
0
        private void Pay()
        {
            CardConn conn      = new CardConn();
            string   input     = txtCardNo.Text.Trim();
            string   cardNo    = GetCardNo(input);
            string   password  = GetCardPwd(input);
            string   shopId    = conn.ShopId;
            string   posId     = conn.Posid;
            string   cashierId = conn.Cashierid;

            string        payValue      = PayAmount.ToString();
            CardPrint     cardPrint     = new CardPrint();
            string        owenerId      = cardPrint.GetOrder();
            string        cdSeq         = "555";
            string        date          = DateTime.Now.ToString("yyyyMMdd");
            string        time          = DateTime.Now.ToString("hhmmss");
            Header        payCardHeader = new PayCardHeader(cardNo, password, shopId, posId, cashierId, date, time, payValue, owenerId, cdSeq);
            ProcessResult processResult = conn.PayCard(payCardHeader);
            bool          isProcess     = processResult.IsProcessed;

            if (isProcess)
            {
                this.Close();

                cardPrint.ProcessResult = processResult;
                if (processResult.Code == "0000")
                {
                    cardPrint.Print();

                    ConfigeHelper.SetConfigValue("Order", cardPrint.GetOrderNew());
                }

                MessageBox.Show(processResult.Result);
            }
        }
Exemple #2
0
        internal static void readTextFile()
        {
            int count = 1;

            foreach (string line in File.ReadLines(bai2GenPath, Encoding.UTF8))
            {
                string checkText = line;
                checkText = checkText.Substring(0, 2);
                if (checkText == "16")
                {
                    Line4Text = line;
                }
                count++;
            }
            PayAmount = Line4Text.Substring(3, Line4Text.Length - 3);
            PayAmount = PayAmount.Substring(PayAmount.IndexOf(",") + 1, PayAmount.Length - (PayAmount.IndexOf(",") + 1));
            PayAmount = PayAmount.Substring(0, PayAmount.IndexOf(","));
            //checking each character
            PayAmozero = PayAmount.Any(c => c >= '1' && c <= '9');
        }