public bool AddCard(Entity.Card card) { Factory.Factory fact = new Factory.Factory(); IDal.IAdd addCard = fact.AddCard(); return(addCard.IaddCard(card)); }
public void UpdateMoney(Entity.Card card) { Factory.Factory factUpdateMoney = new Factory.Factory(); IDal.UpdateMoney UpdateMoneyBll = factUpdateMoney.Updatemoney(); UpdateMoneyBll.modify(card); }
public IList <Entity.line> CountMoney(Entity.line line) { //得到上机记录的数据 Factory.Factory fact = new Factory.Factory(); IDal.IQueryline QueryLine = fact.IqueryLine(); IList <Entity.line> Lline = QueryLine.select(line); //得到basicdate的数据 Factory.Factory factBasic = new Factory.Factory(); IDal.IqueryBasicdate QueryBasicDate = factBasic.IqueryBasicDate(); IList <Entity.BasicData> LbasicDate = QueryBasicDate.select(basicDate); //计算时间差 int ConsumeTime; int ConsumeMoney; TimeSpan date = Lline[0].OffDate - Lline[0].LoginDate; TimeSpan time = Lline[0].OffTime - Lline[0].LoginTime; int min = Convert.ToInt16(date.TotalMinutes) + Convert.ToInt16(time.TotalMinutes); //比较准备时间 if (min < LbasicDate[0].PreparyTime) { ConsumeTime = 0; } else { if ((min - LbasicDate[0].PreparyTime) < 30) { ConsumeTime = 30; } else { ConsumeTime = min - LbasicDate[0].PreparyTime; } } //计算钱 if (Lline[0].Status == "固定用户") { ConsumeMoney = LbasicDate[0].Rate / 2 * (ConsumeTime / 30); } else { //if (Lline[0].Status == "临时用户") ConsumeMoney = LbasicDate[0].TmpRate / 2 * (ConsumeTime / 30); } //将金额放入line表中,同时显示到窗体上。 line.ConsumeMoney = ConsumeMoney; line.ConsumeTime = ConsumeTime; line.Money = (Convert.ToInt16(line.Money) - (Convert.ToInt16(ConsumeMoney))); Factory.Factory factLineMoney = new Factory.Factory(); IDal.IAddLine AddLineMoney = factLineMoney.addLine(); AddLineMoney.IaddLineOffMoney(line); IList <Entity.line> lineAll = QueryLine.select(line); return(lineAll); }
//对充值表的操作 public IList <Entity.Charge> CheckCharge(Entity.Charge charge) { Factory.Factory checkOutchargefac = new Factory.Factory(); IDal.CheckOut checkOutCharge = checkOutchargefac.checkOut(); IList <Entity.Charge> Lcharge = checkOutCharge.select(charge); return(Lcharge); }
//对退卡表的操作 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); }
//对注册表操作 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); }
//修改当前用户的密码 public bool ModifyPassWordBLL(string UserName, string PWD) { Factory.Factory fact = new Factory.Factory(); IDal.IModify imodify = fact.ModifyPWD(UserName, PWD); return(imodify.modify(UserName, PWD)); //DataTable table = imodify.modify(UserName, PWD); //bool flag; //flag = false; //if (table.Rows.Count > 0) // { flag = true; } //return flag; }
public string UserBll(Entity.User User) { Factory.Factory fact = new Factory.Factory(); //实例化工厂 IDal.ICheck idal = fact.CreateUserInfo(); //调用工厂方法创建接口 // DataTable table = idal.SelectUser(User); //接受D层的返回值 // string flag; // if (table.Rows.Count == 0) //返回的datatable类型,如果他的行数等于0,说明没有符合该账号密码的用户 // { flag = "无用户";} // else // { // if (table.Rows[0]["PassWord"].ToString() == User.PassWord) // { // flag = "登录成功"; // } // else // { // flag = "密码不正确"; // } // } //return flag; IList <Entity.User> user = idal.SelectUser(User); string flag; if (user.Count == 0) //返回的datatable类型,如果他的行数等于0,说明没有符合该账号密码的用户 { flag = "无用户"; } else { if (user[0].PassWord == User.PassWord) { flag = "登录成功"; } else { flag = "密码不正确"; } } return(flag); }
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 bool CheckpwdBLL(Entity.User user, string PWD) { Factory.Factory fact = new Factory.Factory(); //IDal.ICheck ICheck = fact.CreateUserInfo(); IDal.ICheck ICheck = fact.Checkpwd(); //接受D层的参数 // DataTable table =ICheck .SelectUser (user ); //DataTable table = ICheck.SelectUser(user); IList <Entity.User> User = ICheck.SelectUser(user); bool flag; if (User.Count == 0) { flag = false; } else { this.ModifyPassWordBLL(user.UserID, PWD); flag = true; } return(flag); }
public bool addStudent(Entity.Student student) { Factory.Factory addStudentfac = new Factory.Factory(); IDal.IAddStudent addStudent = addStudentfac.addStudent(); return(addStudent.IaddStudent(student)); }
//下机时 public void addLineOff(Entity.line line) { Factory.Factory fact = new Factory.Factory(); IDal.IAddLine addlineoff = fact.addLine(); addlineoff.iaddLineOff(line); }
public void addLine(Entity.line line) { Factory.Factory fact = new Factory.Factory(); IDal.IAddLine addline = fact.addLine(); addline.IaddLine(line); }
public void addOnline(Entity.online online) { Factory.Factory fact = new Factory.Factory(); IDal.Iadd addonline = fact.addOnlie(); addonline.iaddOnline(online); }
public void ModifyStudent(Entity.Student student) { Factory.Factory ModifyStudentFac = new Factory.Factory(); IDal.ModifyStudentInfo modifyStudent = ModifyStudentFac.modifyStudent(); modifyStudent.modify(student); }
public void addWorklogTime(Entity.WorkLog worklog) { Factory.Factory addWorklogtimefac = new Factory.Factory(); IDal.IaddWorker addworklogtime = addWorklogtimefac.addWorker(); addworklogtime.IaddWorkerLogTime(worklog); }
public bool addWorkLog(Entity.WorkLog worklog) { Factory.Factory addWorkLogfac = new Factory.Factory(); IDal.IaddWorker addWorklog = addWorkLogfac.addWorker(); return(addWorklog.IaddWorkerlog(worklog)); }
public bool addonWork(Entity.onWork onwork) { Factory.Factory addonworkfac = new Factory.Factory(); IDal.IaddWorker addonwork = addonworkfac.addWorker(); return(addonwork.IaddonWorker(onwork)); }
public void ModifyStatus(Entity.Card card) { Factory.Factory ModifyStatusfac = new Factory.Factory(); IDal.UpdateMoney ModifyStatus = ModifyStatusfac.Updatemoney(); ModifyStatus.modifyState(card); }
public IList <Entity.User> QueryUser(Entity.User user) { Factory.Factory queryUserfac = new Factory.Factory(); IDal.IQueryUser queryUser = queryUserfac.QueryUser(); return(queryUser.select(user)); }
public bool addReturn(Entity.ReturnCard returnCard) { Factory.Factory addReturnfac = new Factory.Factory(); IDal.IaddMoney addReturn = addReturnfac.addChargeAndReturn(); return(addReturn.ModifyReturn(returnCard)); }
//设置是否结账 public void ModifyIsCheckOut(string userID) { Factory.Factory ModifyIsCheckOutfac = new Factory.Factory(); IDal.CheckOut modifyIsCheckOut = ModifyIsCheckOutfac.checkOut(); modifyIsCheckOut.ModifyIscheck(userID); }
public void delonwork(Entity.onWork onwork) { Factory.Factory delonWorkfac = new Factory.Factory(); IDal.IaddWorker delOnwork = delonWorkfac.addWorker(); delOnwork.IdelOnworker(onwork); }
public bool addUser(Entity.User user) { Factory.Factory addUserfac = new Factory.Factory(); IDal.IaddUser addUser = addUserfac.AddvsDelUser(); return(addUser.IaddUser(user)); }
public void modifyBasicDate(Entity.BasicData basicDate) { Factory.Factory modifyBasicfac = new Factory.Factory(); IDal.ModifyBasicDate modifyBasic = modifyBasicfac.modifyBasicDate(); modifyBasic.ModifyBasicDate(basicDate); }
public void DeleteOnline(Entity.online online) { Factory.Factory fact = new Factory.Factory(); IDal.IDeleteOnline deleteOnline = fact.DeleteOnline(); deleteOnline.DeleteOnline(online); }
public bool delUser(Entity.User user) { Factory.Factory delUserfac = new Factory.Factory(); IDal.IaddUser delUser = delUserfac.AddvsDelUser(); return(delUser.IdelUser(user)); }