コード例 #1
0
ファイル: FrmQuery.cs プロジェクト: jetoutman/Pms
        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);
            }
        }
コード例 #2
0
        private void txtCardNo_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                SetMonthBalanceVisible(false);
                F11Exit(e);
                if (e.KeyCode == Keys.Enter) //如果输入的是回车键
                {
                    var input  = txtCardNo.Text.Trim();
                    var conn   = new CardConn();
                    var cardNo = GetCardNo(input);
                    txtCardNo.Text = cardNo;
                    var    password      = GetCardPwd(input);
                    var    shopId        = conn.ShopId;
                    var    posId         = conn.Posid;
                    var    cashierId     = conn.Cashierid;
                    Header queryHeader   = new QueryCardHeader(cardNo, password, shopId, posId, cashierId);
                    var    processResult = conn.ReadCard(queryHeader);
                    Lbl_msg.Text = processResult.Result;
                    if (processResult.IsProcessed)
                    {
                        lbl_cardNo.Text = processResult.Cardno;

                        lbl_Amount.Text = processResult.Balance.Trim();
                        var isMonthCard = !string.IsNullOrEmpty(processResult.MonthBalance);
                        SetMonthBalanceVisible(isMonthCard);
                        if (isMonthCard)
                        {
                            lbl_MonthBalance.Text = processResult.MonthBalance;
                        }

                        /*
                         * decimal banlance = 0m;
                         * decimal monthBanlace = 0m;
                         * decimal.TryParse(processResult.Balance, out banlance);
                         * decimal.TryParse(processResult.MonthBalance, out monthBanlace);
                         * bool isGreatThan = IsCanPay(isMonthCard, PayAmount, monthBanlace, banlance);
                         * if (IsPay && isGreatThan)
                         * {
                         * DialogResult dr = MessageBox.Show("卡金额足够,现在结账吗?", "付款", MessageBoxButtons.OKCancel);
                         *
                         * if (dr == DialogResult.OK)
                         * {
                         *  Pay();
                         * }
                         *
                         * }
                         * */
                    }
                }
            }
            catch (Exception error)
            {
                log.Error(error);
            }

            log.Info("test");
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: jetoutman/Pms
 private void button1_Click(object sender, EventArgs e)
 {
     string   cardNo      = txtCardNo.Text.Trim();
     string   password    = txtPassword.Text.Trim();
     string   shopId      = txtShopId.Text.Trim();
     string   posId       = txtPosId.Text.Trim();
     string   cashierId   = txtCashierId.Text.Trim();
     Header   queryHeader = new QueryCardHeader(cardNo, password, shopId, posId, cashierId);
     CardConn conn        = new CardConn();
     //textBox1.Text = conn.ReadCard(queryHeader);
 }
コード例 #4
0
ファイル: FrmQuery.cs プロジェクト: jetoutman/Pms
        private void txtCardNo_KeyDown(object sender, KeyEventArgs e)
        {
            SetMonthBalanceVisible(false);
            F11Exit(e);
            if (e.KeyCode == Keys.Enter) //如果输入的是回车键
            {
                string        input         = txtCardNo.Text.Trim();
                CardConn      conn          = new CardConn();
                string        cardNo        = GetCardNo(input);
                string        password      = GetCardPwd(input);
                string        shopId        = conn.ShopId;
                string        posId         = conn.Posid;
                string        cashierId     = conn.Cashierid;
                Header        queryHeader   = new QueryCardHeader(cardNo, password, shopId, posId, cashierId);
                ProcessResult processResult = conn.ReadCard(queryHeader);
                Lbl_msg.Text = processResult.Result;
                if (processResult.IsProcessed)
                {
                    lbl_cardNo.Text = processResult.Cardno;

                    lbl_Amount.Text = processResult.Balance.Trim();
                    bool isMonthCard = !string.IsNullOrEmpty(processResult.MonthBalance);
                    SetMonthBalanceVisible(isMonthCard);
                    if (isMonthCard)
                    {
                        lbl_MonthBalance.Text = processResult.MonthBalance;
                    }
                    decimal banlance     = 0m;
                    decimal monthBanlace = 0m;
                    decimal.TryParse(processResult.Balance, out banlance);
                    decimal.TryParse(processResult.MonthBalance, out monthBanlace);
                    bool isGreatThan = IsCanPay(isMonthCard, PayAmount, monthBanlace, banlance);
                    if (IsPay && isGreatThan)
                    {
                        DialogResult dr = MessageBox.Show("卡金额足够,现在结账吗?", "付款", MessageBoxButtons.OKCancel);

                        if (dr == DialogResult.OK)
                        {
                            Pay();
                        }
                    }
                }

                if (FrmQueryAndPay != null)
                {
                    FrmQueryAndPay.ClearScreen();
                    this.Close();
                }
            }
        }
コード例 #5
0
ファイル: Form2.cs プロジェクト: jetoutman/Pms
 private void button1_Click(object sender, EventArgs e)
 {
     string   cardNo        = txtCardNo.Text.Trim();
     string   password      = txtPassword.Text.Trim();
     string   shopId        = txtShopId.Text.Trim();
     string   posId         = txtPosId.Text.Trim();
     string   cashierId     = txtCashierId.Text.Trim();
     string   payValue      = txtPayValue.Text.Trim();
     string   owenerId      = txtOwner.Text.Trim();
     string   cdSeq         = txtCdseq.Text.Trim();
     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);
     CardConn cardCon       = new CardConn();
     //textBox1.Text = cardCon.PayCard(payCardHeader);
 }
コード例 #6
0
 private void btnPay_Click(object sender, EventArgs e)
 {
     string        cardNo            = txtCardNo.Text.Trim();
     string        password          = txtPassword.Text.Trim();
     string        shopId            = txtShopId.Text.Trim();
     string        posId             = txtPosId.Text.Trim();
     string        cashierId         = txtCashierId.Text.Trim();
     string        payValue          = txtPayValue.Text.Trim();
     string        owenerId          = txtOwner.Text.Trim();
     string        cdSeq             = txtCdseq.Text.Trim();
     string        date              = DateTime.Now.ToString("YYYYMMdd");
     string        time              = DateTime.Now.ToString("hhmmss");
     Header        negativePayHeader = new NegativePayHeader(cardNo, password, shopId, posId, cashierId, date, time, payValue, owenerId, cdSeq);
     CardConn      cardCon           = new CardConn();
     ProcessResult proccessResult    = cardCon.NegativePayCard(negativePayHeader);
 }
コード例 #7
0
ファイル: FrmPay.cs プロジェクト: jetoutman/Pms
        private void button1_Click(object sender, EventArgs e)
        {
            CardConn conn = new CardConn();
            // string cardNo = txtCardNo.Text.Trim();
            string password  = string.Empty;
            string shopId    = conn.ShopId;
            string posId     = conn.Posid;
            string cashierId = conn.Cashierid;

            string payValue = txtPayValue.Text.Trim();
            string owenerId = "11111";
            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);

            // txtCardNo.Text = conn.PayCard(payCardHeader);
        }
コード例 #8
0
ファイル: FrmQuery.cs プロジェクト: jetoutman/Pms
        private void button1_Click(object sender, EventArgs e)
        {
            CardConn      conn          = new CardConn();
            string        cardNo        = txtCardNo.Text.Trim();
            string        password      = string.Empty;
            string        shopId        = conn.ShopId;
            string        posId         = conn.Posid;
            string        cashierId     = conn.Cashierid;
            Header        queryHeader   = new QueryCardHeader(cardNo, password, shopId, posId, cashierId);
            ProcessResult processResult = conn.ReadCard(queryHeader);

            if (processResult.IsProcessed)
            {
                lbl_cardNo.Text = processResult.Cardno;

                lbl_Amount.Text = processResult.Balance.Trim();
            }
        }