Ejemplo n.º 1
0
        public bool AddCard(Entity.Card card)
        {
            Factory.Factory fact    = new Factory.Factory();
            IDal.IAdd       addCard = fact.AddCard();

            return(addCard.IaddCard(card));
        }
Ejemplo n.º 2
0
        public void  UpdateMoney(Entity.Card card)
        {
            Factory.Factory  factUpdateMoney = new Factory.Factory();
            IDal.UpdateMoney UpdateMoneyBll  = factUpdateMoney.Updatemoney();

            UpdateMoneyBll.modify(card);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        //对充值表的操作
        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);
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
        //对注册表操作
        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);
        }
Ejemplo n.º 7
0
        //修改当前用户的密码
        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;
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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));
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
 public bool addStudent(Entity.Student student)
 {
     Factory.Factory  addStudentfac = new Factory.Factory();
     IDal.IAddStudent addStudent    = addStudentfac.addStudent();
     return(addStudent.IaddStudent(student));
 }
Ejemplo n.º 12
0
 //下机时
 public void addLineOff(Entity.line line)
 {
     Factory.Factory fact       = new Factory.Factory();
     IDal.IAddLine   addlineoff = fact.addLine();
     addlineoff.iaddLineOff(line);
 }
Ejemplo n.º 13
0
 public void addLine(Entity.line line)
 {
     Factory.Factory fact    = new Factory.Factory();
     IDal.IAddLine   addline = fact.addLine();
     addline.IaddLine(line);
 }
Ejemplo n.º 14
0
 public void addOnline(Entity.online online)
 {
     Factory.Factory fact      = new Factory.Factory();
     IDal.Iadd       addonline = fact.addOnlie();
     addonline.iaddOnline(online);
 }
Ejemplo n.º 15
0
 public void ModifyStudent(Entity.Student student)
 {
     Factory.Factory        ModifyStudentFac = new Factory.Factory();
     IDal.ModifyStudentInfo modifyStudent    = ModifyStudentFac.modifyStudent();
     modifyStudent.modify(student);
 }
Ejemplo n.º 16
0
 public void addWorklogTime(Entity.WorkLog worklog)
 {
     Factory.Factory addWorklogtimefac = new Factory.Factory();
     IDal.IaddWorker addworklogtime    = addWorklogtimefac.addWorker();
     addworklogtime.IaddWorkerLogTime(worklog);
 }
Ejemplo n.º 17
0
 public bool addWorkLog(Entity.WorkLog worklog)
 {
     Factory.Factory addWorkLogfac = new Factory.Factory();
     IDal.IaddWorker addWorklog    = addWorkLogfac.addWorker();
     return(addWorklog.IaddWorkerlog(worklog));
 }
Ejemplo n.º 18
0
 public bool addonWork(Entity.onWork onwork)
 {
     Factory.Factory addonworkfac = new Factory.Factory();
     IDal.IaddWorker addonwork    = addonworkfac.addWorker();
     return(addonwork.IaddonWorker(onwork));
 }
Ejemplo n.º 19
0
 public void ModifyStatus(Entity.Card card)
 {
     Factory.Factory  ModifyStatusfac = new Factory.Factory();
     IDal.UpdateMoney ModifyStatus    = ModifyStatusfac.Updatemoney();
     ModifyStatus.modifyState(card);
 }
Ejemplo n.º 20
0
 public IList <Entity.User> QueryUser(Entity.User user)
 {
     Factory.Factory queryUserfac = new Factory.Factory();
     IDal.IQueryUser queryUser    = queryUserfac.QueryUser();
     return(queryUser.select(user));
 }
Ejemplo n.º 21
0
 public bool addReturn(Entity.ReturnCard returnCard)
 {
     Factory.Factory addReturnfac = new Factory.Factory();
     IDal.IaddMoney  addReturn    = addReturnfac.addChargeAndReturn();
     return(addReturn.ModifyReturn(returnCard));
 }
Ejemplo n.º 22
0
 //设置是否结账
 public void ModifyIsCheckOut(string userID)
 {
     Factory.Factory ModifyIsCheckOutfac = new Factory.Factory();
     IDal.CheckOut   modifyIsCheckOut    = ModifyIsCheckOutfac.checkOut();
     modifyIsCheckOut.ModifyIscheck(userID);
 }
Ejemplo n.º 23
0
 public void delonwork(Entity.onWork onwork)
 {
     Factory.Factory delonWorkfac = new Factory.Factory();
     IDal.IaddWorker delOnwork    = delonWorkfac.addWorker();
     delOnwork.IdelOnworker(onwork);
 }
Ejemplo n.º 24
0
 public bool addUser(Entity.User user)
 {
     Factory.Factory addUserfac = new Factory.Factory();
     IDal.IaddUser   addUser    = addUserfac.AddvsDelUser();
     return(addUser.IaddUser(user));
 }
Ejemplo n.º 25
0
 public void modifyBasicDate(Entity.BasicData basicDate)
 {
     Factory.Factory      modifyBasicfac = new Factory.Factory();
     IDal.ModifyBasicDate modifyBasic    = modifyBasicfac.modifyBasicDate();
     modifyBasic.ModifyBasicDate(basicDate);
 }
Ejemplo n.º 26
0
 public void  DeleteOnline(Entity.online online)
 {
     Factory.Factory    fact         = new Factory.Factory();
     IDal.IDeleteOnline deleteOnline = fact.DeleteOnline();
     deleteOnline.DeleteOnline(online);
 }
Ejemplo n.º 27
0
 public bool delUser(Entity.User user)
 {
     Factory.Factory delUserfac = new Factory.Factory();
     IDal.IaddUser   delUser    = delUserfac.AddvsDelUser();
     return(delUser.IdelUser(user));
 }