public bool AddCard(Entity.Card card) { Factory.Factory fact = new Factory.Factory(); IDal.IAdd addCard = fact.AddCard(); return(addCard.IaddCard(card)); }
private void Querybt_Click(object sender, EventArgs e) { //判空 if (txtCardNo.Text == "") { MessageBox.Show("请输入查询的内容!", "提示"); txtCardNo.Focus(); return; } //给card实体带上参数,传给外观 Entity.Card card = new Entity.Card(); card.CardNo = Convert.ToInt32(txtCardNo.Text.ToString()); IList <Entity.Card> Card = new List <Entity.Card>(); Facade.StudentMoneyFacade StudentMoney = new Facade.StudentMoneyFacade(); Card = StudentMoney.StudentMoney(card); if (Card.Count == 0) { MessageBox.Show("没有该卡号的相关信息,请重新输入!"); } else { txtStudentNo.Text = Card[0].StudentNo.ToString(); txtMoney.Text = Card[0].Money.ToString(); } }
public IList <Entity.Card> Select(Entity.Card card) { if (card.CardNo == 0) { SqlParameter[] sqlparams = //new SqlParameter ("@CardNo",card.CardNo ), { new SqlParameter("@StudentNo", card.StudentNo), new SqlParameter("@Notes", "使用") }; string sql = "select * from Card_info where studentno = @StudentNo and notes =@Notes "; DataTable table = DAL.sqlhelper.GetDatable(sql, CommandType.Text, sqlparams); IList <Entity.Card> Card = DAL.CovertHelper <Entity.Card> .ConvertToModel(table); return(Card); } else { SqlParameter[] sqlparams = { new SqlParameter("@CardNo", card.CardNo), //new SqlParameter ("@StudentNo",card.StudentNo ), new SqlParameter("@Notes", "使用") }; string sql = "select * from Card_info where cardno = @CardNo and notes =@Notes "; DataTable table = DAL.sqlhelper.GetDatable(sql, CommandType.Text, sqlparams); IList <Entity.Card> Card = DAL.CovertHelper <Entity.Card> .ConvertToModel(table); return(Card); } }
public Response <string> Create(StripeCardDTO dto, int UserId) { var response = new Response <string>(); try { var User = _userRepository.GetById(a => a.Id == UserId && a.DateDeleted == null); if (User == null) { response.AddValidationError("", "User doesnot exist."); return(response); } var card = _baseServices.CreateCartdStripe(dto, User.Stripe_CustomerId); Entity.Card cart = new Entity.Card(); cart.UserId = UserId; cart.StripeCardId = card.Id; cart.DateCreated = DateTime.UtcNow.ToString(); _cardRepository.Insert(cart); response.Data = card.Id; response.Success = true; } catch (Exception ex) { HandleException(response, ex); } return(response); }
public void UpdateMoney(Entity.Card card) { Factory.Factory factUpdateMoney = new Factory.Factory(); IDal.UpdateMoney UpdateMoneyBll = factUpdateMoney.Updatemoney(); UpdateMoneyBll.modify(card); }
void IDal.UpdateMoney.modify(Entity.Card card) { SqlParameter[] sqlparams = { new SqlParameter("@cardno", card.CardNo), new SqlParameter("@Money", card.Money) }; string sql = @"update card_info set money = @Money where cardno = @cardno"; DAL.sqlhelper.ExecuteNonquery(sql, CommandType.Text, sqlparams); }
//对注册表操作 public IList <Entity.Card> checkOutCard(Entity.Card card) { Factory.Factory checkOutCardfac = new Factory.Factory(); IDal.CheckOut checkOut = checkOutCardfac.checkOut(); IList <Entity.Card> LCard = checkOut.select(card); return(LCard); }
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; } } }
public IList <Entity.Card> Select(Entity.Card card) { SqlParameter[] sqlParams = { new SqlParameter("@CardNo", card.CardNo) }; string sql = "select * from Card_info where CardNo = @CardNo"; DataTable table = DAL.sqlhelper.GetDatable(sql, CommandType.Text, sqlParams); IList <Entity.Card> Card = DAL.CovertHelper <Entity.Card> .ConvertToModel(table); return(Card); }
public void modifyState(Entity.Card card) //设置使用状态 { //throw new NotImplementedException(); SqlParameter[] para = { new SqlParameter("@cardno", card.CardNo), new SqlParameter("@notes", "未使用") }; string sql = "update card_info set notes=@notes"; DAL.sqlhelper.ExecuteNonquery(sql, CommandType.Text, para); }
public IList <Entity.Card> select(Entity.Card card) { //throw new NotImplementedException(); SqlParameter[] para = { new SqlParameter("@UserID", card.UserID), new SqlParameter("@Status", "未结账") }; string sql = "select * from card_info where userID =@UserID and Status =@Status"; DataTable table = DAL.sqlhelper.GetDatable(sql, CommandType.Text, para); IList <Entity.Card> LCard = DAL.CovertHelper <Entity.Card> .ConvertToModel(table); return(LCard); }
public bool IaddCard(Entity.Card card) { SqlParameter[] sqlParms = { new SqlParameter("@Cardno", card.CardNo), new SqlParameter("@Studentno", card.StudentNo), new SqlParameter("@money", card.Money), new SqlParameter("@Type", card.Type), new SqlParameter("@Ischeck", card.Status), new SqlParameter("@Note", card.Notes), new SqlParameter("@userid", card.UserID) }; string sql = "insert into card_info values(@Cardno,@money,@Type,@Note,@Ischeck,@Studentno,@userid)"; return(sqlhelper.ExecuteNonquery(sql, CommandType.Text, sqlParms)); }
public void CardController_GetCard_Should_Correct() { // arrange var testCard = new Entity.Card { Id = Guid.NewGuid(), Name = "test", CardType = CardType.Creative }; cardServiceMock.Setup(x => x.Get(testCard.Id)) .Returns(Task.FromResult(mapper.Map <CardViewModel>(testCard))); //act var result = cardController.GetCard(testCard.Id).Result; var resultId = ((CardViewModel)((OkObjectResult)result.Result).Value).Id; Assert.AreEqual(testCard.Id.ToString(), resultId); }
public bool addCharge(Entity.Charge charge) { //对卡片金额的修改 Entity.Card card = new Entity.Card(); card.CardNo = Convert.ToInt16(charge.CardNo); //查出来 Factory.Factory fact = new Factory.Factory(); IDal.IqueryCard queryCardno = fact.IExitCardno(); IList <Entity.Card> lCard = queryCardno.Select(card); //修改 card.Money = lCard[0].Money + charge.AddMoney; Factory.Factory factUpdateMoney = new Factory.Factory(); IDal.UpdateMoney UpdateMoneyBll = factUpdateMoney.Updatemoney(); UpdateMoneyBll.modify(card); //在charge实体添加数据 Factory.Factory addChargefac = new Factory.Factory(); IDal.IaddMoney addCharge = addChargefac.addChargeAndReturn(); return(addCharge.IaddMoney(charge)); }
public void UpdateMoney(Entity.Card card) { BLL.UpdateMoneyBLL updateMoney = new BLL.UpdateMoneyBLL(); updateMoney.UpdateMoney(card); }
public void ModifyState(Entity.Card card) { BLL.UpdateMoneyBLL modifyState = new BLL.UpdateMoneyBLL(); modifyState.ModifyStatus(card); }
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(); } } }
private void button1_Click(object sender, EventArgs e) { //判空 if (txtcardno.Text == "") { MessageBox.Show("请输入卡号", "提示"); txtcardno.Focus(); return; } if (txtMoney.Text == "") { MessageBox.Show("请输入金额", "提示"); txtMoney.Focus(); return; } //金额是否满足充值条件 //的金额是否满足要求 Entity.BasicData basicdate = new Entity.BasicData(); Facade.QueryBasicDateFacade queryBasicDate = new Facade.QueryBasicDateFacade(); IList <Entity.BasicData> LbasicDate = queryBasicDate.QueryBasicDate(basicdate); if (Convert.ToInt16(txtMoney.Text) < LbasicDate[0].LeastMoney) { MessageBox.Show("你的充值金额太少,请修改!", "提示"); txtMoney.Focus(); return; } //查询卡号是否存在,可以使用 Entity.Card card = new Entity.Card(); card.CardNo = Convert.ToInt16(txtcardno.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("没有该卡号,请核对后充值!", "提示"); txtcardno.Text = ""; txtMoney.Text = ""; txtcardno.Focus(); return; } //可以充值,并在b层做逻辑判断,更新cardno中的money else { Entity.Charge charge = new Entity.Charge(); charge.CardNo = txtcardno.Text; charge.StudentNo = QueryCardExit[0].StudentNo; charge.UserID = frmLogin.UserName; //---------------------------- //charge.UserID = "YY"; charge.AddMoney = Convert.ToInt16(txtMoney.Text); Facade.AddChargeAndReturn addCharge = new Facade.AddChargeAndReturn(); bool flag; flag = addCharge.addCharge(charge); if (flag == true) { MessageBox.Show("充值成功!", "提示"); //txt.Text = "姓名:" + Student[0].Name + "\r\n" + "性别:" + Student[0].Sex + "\r\n" + "年级:" + Student[0].Grade + "\r\n" + "班级:" + Student[0].Class + "\r\n" + "专业:" + Student[0].Department + "\r\n"; //txt.Text ="学号:"+ QueryCardExit[0].StudentNo +"\r\n"+"卡号:"+QueryCardExit[0].CardNo +"\r\n"+ return; } } }
/// <summary> /// 上机 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { Entity.Card card = new Entity.Card(); //卡号 card.CardNo = Convert.ToInt16(txtCardno.Text.Trim()); // Facade.QuerIesitCardno queryExitCardno = new Facade.QuerIesitCardno(); Facade.QueyExitCardno queryExitCardno = new Facade.QueyExitCardno(); IList <Entity.Card> lCard = new List <Entity.Card>(); lCard = queryExitCardno.queryExitCardno(card); if (lCard.Count == 0) { MessageBox.Show("请确定该卡号是否可用!"); txtCardno.Text = ""; } else { //判断上机的金额是否满足要求 Entity.BasicData basicdate = new Entity.BasicData(); Facade.QueryBasicDateFacade queryBasicDate = new Facade.QueryBasicDateFacade(); IList <Entity.BasicData> LbasicDate = queryBasicDate.QueryBasicDate(basicdate); if (lCard[0].Money < LbasicDate[0].LeastMoney) { MessageBox.Show("您的余额不满足上机条件,请充值!"); } else { //正在上机不符合条件--2017.01.20 Entity.online online = new Entity.online(); online.CardNo = Convert.ToInt16(txtCardno.Text.Trim()); Facade.IsOnlineFacade IsOnline = new Facade.IsOnlineFacade(); IList <Entity.online> lonline = new List <Entity.online>(); lonline = IsOnline.IsOnline(online); if (lonline.Count != 0) { MessageBox.Show("该卡号正在上机,请重新选择卡号!"); } else { Entity.Student student = new Entity.Student(); student.StudentNo = lCard[0].StudentNo; Facade.StudentFacade studentinfo = new Facade.StudentFacade(); IList <Entity.Student> lstudent = new List <Entity.Student>(); lstudent = studentinfo.studentfacade(student); txtStudentNo.Text = lstudent[0].StudentNo.ToString(); txtName.Text = lstudent[0].Name; txtSex.Text = lstudent[0].Sex.ToString(); txtType.Text = lstudent[0].Notes.ToString(); //将正在上机的信息读入onlie表 // Entity.online online = new Entity.online(); online.CardNo = lCard[0].CardNo; online.StudentNo = lCard[0].StudentNo; online.studentname = txtName.Text; online.studentsex = txtSex.Text; online.cardType = lCard[0].Type; online.Computer = Environment.MachineName; Facade.addOnlineFacade addOnline = new Facade.addOnlineFacade(); addOnline.addOnline(online); //获得数据库的当前时间 Facade.IsOnlineFacade Online = new Facade.IsOnlineFacade(); IList <Entity.online> Lonline = new List <Entity.online>(); Lonline = IsOnline.IsOnline(online); txtONdate.Text = Lonline[0].ondate.ToString(); txtOntime.Text = Lonline[0].ontime.ToString(); //将正在上机的信息读入line表 Entity.line line = new Entity.line(); line.CardNo = lCard[0].CardNo; //line.UserID = frmLogin.UserName; line.LoginDate = Convert.ToDateTime(txtONdate.Text); line.LoginTime = TimeSpan.Parse(txtOntime.Text); line.Status = "正常上机"; line.StudentNo = lCard[0].StudentNo; line.StudentName = txtName.Text; line.Computer = Environment.MachineName; line.sex = txtSex.Text; Facade.AddLineFacade addLine = new Facade.AddLineFacade(); addLine.addLine(line); MessageBox.Show("上机成功,感谢使用!"); } } } }
private void button3_Click(object sender, EventArgs e) { //判空 if (txtStudentNo.Text == "") { txtStudentNo.Focus(); MessageBox.Show("请输入查询的内容~", "提示"); return; } if (txtCardNo.Text == "") { txtCardNo.Focus(); MessageBox.Show("请输入查询的内容~", "提示"); return; } if (txtMoney.Text == "") { txtMoney.Focus(); MessageBox.Show("请输入查询的内容~", "提示"); return; } if (comboBox1.Text == "") { comboBox1.Focus(); MessageBox.Show("请输入查询的内容~", "提示"); return; } //注册金额,不得小于最小的上机金额---------- //的金额是否满足要求 Entity.BasicData basicdate = new Entity.BasicData(); Facade.QueryBasicDateFacade queryBasicDate = new Facade.QueryBasicDateFacade(); IList <Entity.BasicData> LbasicDate = queryBasicDate.QueryBasicDate(basicdate); if (Convert.ToInt16(txtMoney.Text) < LbasicDate[0].LeastMoney) { MessageBox.Show("您的注册余额不满足上使用条件,请修改!", "提示"); txtMoney.Focus(); return; } //显示学生的信息,确保有学生 //txtStudent 给到实体 Entity.Student student = new Entity.Student(); student.StudentNo = Convert.ToInt32(txtStudentNo.Text); Facade.StudentFacade studentfacade = new Facade.StudentFacade(); IList <Entity.Student> Student = new List <Entity.Student>(); Student = studentfacade.studentfacade(student); if (Student.Count == 0) { MessageBox.Show("没有该生的信息哦,可以选择添加该生的信息~"); return; } else { txtInfo.Text = "姓名:" + Student[0].Name + "\r\n" + "性别:" + Student[0].Sex + "\r\n" + "年级:" + Student[0].Grade + "\r\n" + "班级:" + Student[0].Class + "\r\n" + "专业:" + Student[0].Department + "\r\n"; } //将卡号的信息传给实体card,然后和数据库绑定 Entity.Card card = new Entity.Card(); card.StudentNo = Convert.ToInt32(txtStudentNo.Text); card.CardNo = Convert.ToInt32(txtCardNo.Text); card.Money = Convert.ToInt32(txtMoney.Text); //card.Type = listbox.Text .ToString(); card.Type = comboBox1.Text.Trim(); card.Notes = "使用"; card.Status = "未结账"; card.UserID = frmLogin.UserName; //card.UserID = "YY"; //实体带给外观,返回该学号是否注册 Facade.QuerIesitCardno Queryisexit = new Facade.QuerIesitCardno(); IList <Entity.Card> QueryCardExit = new List <Entity.Card>(); QueryCardExit = Queryisexit.QuerIsexitcardno(card); if (QueryCardExit.Count != 0) { MessageBox.Show("该学生已注册,无需注册", "提示"); //获取学生已注册的信息 card.CardNo = QueryCardExit[0].CardNo; Facade.StudentMoneyFacade QueryCardno = new Facade.StudentMoneyFacade(); IList <Entity.Card> card_info = new List <Entity.Card>(); card_info = QueryCardno.StudentMoney(card); txtInfo.Clear(); // txtInfo.Text = "姓名:" + card_info [0].StudentNo + "\r\n" + "性别:" + Student[0].Sex + "\r\n" + "年级:" + Student[0].Grade + "\r\n" + "班级:" + Student[0].Class + "\r\n" + "专业:" + Student[0].Department + "\r\n"; txtInfo.Text = "姓名:" + Student[0].Name + "\r\n" + "性别:" + Student[0].Sex + "\r\n" + "年级:" + Student[0].Grade + "\r\n" + "班级:" + Student[0].Class + "\r\n" + "专业:" + Student[0].Department + "\r\n" + "卡号:" + card_info[0].CardNo.ToString() + "\r\n"; txtCardNo.Text = ""; txtMoney.Text = ""; comboBox1.Text = ""; return; } else { //实体带给外观,返回是否有学号 Facade.StudentMoneyFacade QueryCardno = new Facade.StudentMoneyFacade(); IList <Entity.Card> card_info = new List <Entity.Card>(); card_info = QueryCardno.StudentMoney(card); if (card_info.Count != 0) { MessageBox.Show("该卡号已被使用,请重新输入!"); return; } else { //实体带参给facade,完成添加 Facade.addCardFacade addCard = new Facade.addCardFacade(); bool falg; falg = addCard.addCard(card); if (falg == true) { MessageBox.Show("注册成功,您可以正常使用", "温馨提示"); } //将注册的金额放到充值卡中 Entity.Charge charge = new Entity.Charge(); charge.CardNo = txtCardNo.Text; charge.UserID = frmLogin.UserName; charge.StudentNo = student.StudentNo; charge.AddMoney = Convert.ToInt16(txtMoney.Text); Facade.AddChargeAndReturn addMoney = new Facade.AddChargeAndReturn(); addMoney.addCharge(charge); } } }
/// <summary> /// 下机 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button2_Click(object sender, EventArgs e) { //给实体online装参数--正在上机才可以下机 Entity.online online = new Entity.online(); online.CardNo = Convert.ToInt16(txtCardno.Text); Facade.IsOnlineFacade Isonline = new Facade.IsOnlineFacade(); IList <Entity.online> lonline = new List <Entity.online>(); lonline = Isonline.IsOnline(online); if (lonline.Count == 0) { MessageBox.Show("该卡号下没有学生上机,请选择正在上机的卡号!"); txtCardno.Text = ""; txtCardno.Focus(); } else { //将剩余参数带给line实体 //补充,这里给line传入金额--2017-02-11 Entity.Card card = new Entity.Card(); //卡号 card.CardNo = Convert.ToInt16(txtCardno.Text.Trim()); // Facade.QuerIesitCardno queryExitCardno = new Facade.QuerIesitCardno(); Facade.QueyExitCardno queryExitCardno = new Facade.QueyExitCardno(); IList <Entity.Card> lCard = new List <Entity.Card>(); lCard = queryExitCardno.queryExitCardno(card); Entity.line line = new Entity.line(); //line.OffDate =Convert .ToDateTime (DateTime.Now.Date.ToShortDateString ()); //line.OffTime = TimeSpan.Parse(DateTime.Now.ToLongTimeString()); //line.ConsumeTime =Convert.ToInt16 (lbConsumer.Text); //不合理,为啥,因为可以让好多人上机,但是呢?只能显示最后一个上机的人的时间 line.CardNo = lonline[0].CardNo; //之前line表有的一些参数,根据这些信息找到缺失信息的表 line.LoginDate = lonline[0].ondate; line.LoginTime = lonline[0].ontime; line.Money = lCard[0].Money; line.Status = "正常下机"; Facade.AddLineFacade addLineOff = new Facade.AddLineFacade(); addLineOff.addLineOff(line); //计算金额,显示消费时间和金额 Facade.CountMoneyFacade countMoneyfacade = new Facade.CountMoneyFacade(); IList <Entity.line> LineAll = new List <Entity.line>(); LineAll = countMoneyfacade.CountMoney(line); txtConsumeMoney.Text = LineAll[0].ConsumeMoney.ToString(); txtConsumeTime.Text = LineAll[0].ConsumeTime.ToString(); txtName.Text = LineAll[0].StudentName; txtoffDate.Text = LineAll[0].OffDate.ToString(); txtoffTime.Text = LineAll[0].OffTime.ToString(); txtONdate.Text = LineAll[0].OffDate.ToString(); txtOntime.Text = LineAll[0].LoginTime.ToString(); txtSex.Text = LineAll[0].sex; txtStudentNo.Text = LineAll[0].StudentNo.ToString(); txtType.Text = LineAll[0].Status; //从card实体中获得消费的剩余金额,同时更新card表 Entity.Card Card = new Entity.Card(); Card.CardNo = Convert.ToInt16(txtCardno.Text); IList <Entity.Card> LCard = new List <Entity.Card>(); Facade.StudentMoneyFacade CardMoney = new Facade.StudentMoneyFacade(); LCard = CardMoney.StudentMoney(Card); //余额的填充 txtMoney.Text = (Convert.ToInt16(LCard[0].Money) - Convert.ToInt16(LineAll[0].ConsumeMoney)).ToString(); ////// //更新表card Card.Money = Convert.ToInt16(txtMoney.Text); Facade.UpdateMoneyFacade UpdateMoney = new Facade.UpdateMoneyFacade(); UpdateMoney.UpdateMoney(Card); //判断余额,如果余额花完的话需要充点钱 IList <Entity.Card> IfCardmomey = new List <Entity.Card>(); IfCardmomey = CardMoney.StudentMoney(Card); if (IfCardmomey[0].Money < 0) { MessageBox.Show("您需要充值现金" + IfCardmomey[0].Money.ToString() + "元!"); } txtMoney.Text = IfCardmomey[0].Money.ToString(); //将正在上机表下机 Facade.deleteFacade deleteOnlineFacade = new Facade.deleteFacade(); deleteOnlineFacade.DeleteOnline(online); } }
public IList <Entity.Card> StudentMoney(Entity.Card card) { BLL.QueryMoney quermoney = new BLL.QueryMoney(); return(quermoney.queryMoney(card)); }
public IList <Entity.Card> QuerIsexitcardno(Entity.Card card) { BLL.IsExitCardno querIsexitCardno = new BLL.IsExitCardno(); return(querIsexitCardno.isexitCardno(card)); }
public IList <Entity.Card> queryExitCardno(Entity.Card card) { BLL.ExitCardno exitCardno = new BLL.ExitCardno(); return(exitCardno.exitcardno(card)); }
//对注册表 public IList <Entity.Card> checkOutCard(Entity.Card card) { BLL.CheckOutBLL checkOutcard = new BLL.CheckOutBLL(); return(checkOutcard.checkOutCard(card)); }
public bool addCard(Entity.Card card) { BLL.addCardBLL addCardfacade = new BLL.addCardBLL(); return(addCardfacade.AddCard(card)); }
public void ModifyStatus(Entity.Card card) { Factory.Factory ModifyStatusfac = new Factory.Factory(); IDal.UpdateMoney ModifyStatus = ModifyStatusfac.Updatemoney(); ModifyStatus.modifyState(card); }