Exemplo n.º 1
0
        private void btCheckOut_Click(object sender, EventArgs e)
        {
            string userID;

            userID = CbUserID.Text.Trim();

            Facade.CheckOutFacade modifyIsCheck = new Facade.CheckOutFacade();
            modifyIsCheck.ModifyIsCheckOut(userID);
            MessageBox.Show("结账成功!");
        }
Exemplo n.º 2
0
        private void txtregistered_Selected(object sender, TabControlEventArgs e)
        {
            if (e.TabPage == tabPage1)
            {
                try
                {
                    this.card_infoTableAdapter.queryUserID(this.check_buyCard.Card_info, paraToolStripTextBox.Text);
                }
                catch (System.Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show(ex.Message);
                }
            }
            if (e.TabPage == tabPage2)
            {
                try
                {
                    this.charge_infoTableAdapter1.queryCharge1(this.chargeDataSet3check_chargeCard.Charge_info, userIDToolStripTextBox.Text, ischeckToolStripTextBox.Text);
                }
                catch (System.Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show(ex.Message);
                }
            }

            if (e.TabPage == tabPage3)
            {
                try
                {
                    this.returnCard_infoTableAdapter.QueryReturnCard(this.check_returnCard.ReturnCard_info, userIDToolStripTextBox1.Text, isCheckToolStripTextBox1.Text);
                }
                catch (System.Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show(ex.Message);
                }
            }

            if (e.TabPage == tabPage4)
            {
                if (CbUserID.Text == "")
                {
                    MessageBox.Show("请选择用户名");
                    btCheckOut.Enabled = false;
                    return;
                }
                btCheckOut.Enabled = true;
                Facade.CheckOutFacade Checkout = new Facade.CheckOutFacade();
                //得到售卡张数
                Entity.Card card = new Entity.Card();
                card.UserID = CbUserID.Text.Trim();

                IList <Entity.Card> Lcard = new List <Entity.Card>();
                Lcard            = Checkout.checkOutCard(card);
                txtSellCard.Text = Lcard.Count.ToString();


                //退卡张数
                Entity.ReturnCard returnCard = new Entity.ReturnCard();
                returnCard.UserID = CbUserID.Text.Trim();
                IList <Entity.ReturnCard> LreturnCard = new List <Entity.ReturnCard>();
                LreturnCard        = Checkout.CheckOutReturnCard(returnCard);
                txtReturnCard.Text = LreturnCard.Count.ToString();

                //总售卡数
                txtSumCount.Text = (Lcard.Count - LreturnCard.Count).ToString();

                //退卡金额
                int sumReturnMoney;
                sumReturnMoney = 0;
                for (int i = 0; i < LreturnCard.Count; i++)
                {
                    sumReturnMoney += LreturnCard[i].ReturnMoney;
                }
                txtReturnMoney.Text = sumReturnMoney.ToString();

                //充值金额
                Entity.Charge Charge = new Entity.Charge();
                Charge.UserID = CbUserID.Text.Trim();
                Facade.CheckOutFacade charge       = new Facade.CheckOutFacade();
                IList <Entity.Charge> LchargeMoney = new List <Entity.Charge>();
                LchargeMoney = charge.checkOutCharge(Charge);

                int SumChargeMoney;
                SumChargeMoney = 0;
                for (int i = 0; i < LchargeMoney.Count; i++)
                {
                    SumChargeMoney += LchargeMoney[i].AddMoney;
                }
                txtChargeMoney.Text = SumChargeMoney.ToString();

                //应收金额
                txtMoney.Text = (SumChargeMoney - sumReturnMoney).ToString();

                if (e.TabPage == tabPage5)
                {
                    this.Dispose();
                }
            }
        }