Example #1
0
        //对退卡表的操作
        public IList <Entity.ReturnCard> CheckReturnCard(Entity.ReturnCard returnCard)
        {
            Factory.Factory           checkReturnCardfac = new Factory.Factory();
            IDal.CheckOut             checkReturnCard    = checkReturnCardfac.checkOut();
            IList <Entity.ReturnCard> LReturnCard        = checkReturnCard.select(returnCard);

            return(LReturnCard);
        }
Example #2
0
        private void btReturn_Click(object sender, EventArgs e)
        {
            //判空
            if (txtReturnCardno.Text == "")
            {
                MessageBox.Show("请输入退卡卡号", "提示");
                txtReturnCardno.Focus();
                return;
            }
            //正在上机的卡不可退
            Entity.online online = new Entity.online();
            online.CardNo = Convert.ToInt16(txtReturnCardno.Text);
            Facade.IsOnlineFacade onlineFac = new Facade.IsOnlineFacade();
            IList <Entity.online> lonline   = onlineFac.IsOnline(online);

            if (lonline.Count > 0)
            {
                MessageBox.Show("该卡正在上机,下机后可退卡!", "提示");
                return;
            }
            else
            {
                //有卡,正在使用可以退,退的意思修改使用状态
                Entity.Card card = new Entity.Card();
                card.CardNo = Convert.ToInt16(txtReturnCardno.Text);

                Facade.QuerIesitCardno Queryisexit   = new Facade.QuerIesitCardno();
                IList <Entity.Card>    QueryCardExit = new List <Entity.Card>();
                QueryCardExit = Queryisexit.QuerIsexitcardno(card);
                if (QueryCardExit.Count == 0)
                {
                    MessageBox.Show("没有该卡号,请核对后退卡!", "提示");
                    txtReturnCardno.Text = "";
                    txtReturnCardno.Focus();
                    return;
                }
                else
                {
                    //将退卡的信息,给到实体returncard,添加
                    Entity.ReturnCard returnCard = new Entity.ReturnCard();
                    returnCard.CardNo      = QueryCardExit[0].CardNo;
                    returnCard.UserID      = QueryCardExit[0].UserID;
                    returnCard.ReturnMoney = QueryCardExit[0].Money;
                    returnCard.IsCheck     = "未结账";

                    Facade.AddChargeAndReturn addReturn = new Facade.AddChargeAndReturn();
                    addReturn.addReturn(returnCard);

                    //设置卡号为未使用
                    Facade.UpdateMoneyFacade modifyState = new Facade.UpdateMoneyFacade();
                    modifyState.ModifyState(card);

                    MessageBox.Show("退卡成功!", "提示");
                    txtReturnMoney.Text = QueryCardExit[0].Money.ToString();
                    return;
                }
            }
        }
Example #3
0
        public IList <Entity.ReturnCard> select(Entity.ReturnCard Returncard)
        {
            //throw new NotImplementedException();
            SqlParameter[]            para = { new SqlParameter("@userid", Returncard.UserID),
                                               new SqlParameter("@Ischeck",           "未结账"), };
            string                    sql         = "select * from returnCard_info where userID =@userid and Ischeck =@Ischeck";
            DataTable                 table       = DAL.sqlhelper.GetDatable(sql, CommandType.Text, para);
            IList <Entity.ReturnCard> LreturnCard = DAL.CovertHelper <Entity.ReturnCard> .ConvertToModel(table);

            return(LreturnCard);
        }
Example #4
0
        public bool ModifyReturn(Entity.ReturnCard returnCard)
        {
            //throw new NotImplementedException();
            SqlParameter [] para =
            {
                new SqlParameter("@cardno",      returnCard.CardNo),
                new SqlParameter("@userID",      returnCard.UserID),
                new SqlParameter("@returnMoney", returnCard.ReturnMoney),
                new SqlParameter("@Ischeck",     returnCard.IsCheck)
            };
            string sql = "insert into returnCard_info(cardno,userid,returnMoney,ischeck) values(@cardno,@userID,@returnMoney,@Ischeck)";

            return(sqlhelper.ExecuteNonquery(sql, CommandType.Text, para));
        }
Example #5
0
 public bool addReturn(Entity.ReturnCard returnCard)
 {
     BLL.AddChargeAndReturn addReturn = new BLL.AddChargeAndReturn();
     return(addReturn.addReturn(returnCard));
 }
Example #6
0
 //对退卡表的操作
 public IList <Entity.ReturnCard> CheckOutReturnCard(Entity.ReturnCard returnCard)
 {
     BLL.CheckOutBLL checkOutReturnCard = new BLL.CheckOutBLL();
     return(checkOutReturnCard.CheckReturnCard(returnCard));
 }
Example #7
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();
                }
            }
        }
Example #8
0
 public bool addReturn(Entity.ReturnCard returnCard)
 {
     Factory.Factory addReturnfac = new Factory.Factory();
     IDal.IaddMoney  addReturn    = addReturnfac.addChargeAndReturn();
     return(addReturn.ModifyReturn(returnCard));
 }