Example #1
0
        public bool Close(long _time)
        {
            bool ReturnedValue = true;

            switch (status)
            {
            case DrawerOperate.Signed_In:
            {
                ReturnedValue = SignOut(_time);
                operatelogs.Add(OperateLog.Create(DrawerOperate.Closeed, ownerid, managerid, empolyeeid, _time));
                status    = DrawerOperate.Closeed;
                managerid = 0;
                break;
            }

            case DrawerOperate.Signed_Out:
            {
                operatelogs.Add(OperateLog.Create(DrawerOperate.Closeed, ownerid, managerid, empolyeeid, _time));
                status    = DrawerOperate.Closeed;
                managerid = 0;
                break;
            }

            default:
            {
                ReturnedValue = false;
                break;
            }
            }
            return(ReturnedValue);
        }
Example #2
0
        public bool Open(long _time, int _managerid, bool useterm = false, double _beginningterm = 0.0)
        {
            bool ReturnedValue = true;

            switch (status)
            {
            case DrawerOperate.Closeed:
            {
                managerid = _managerid;
                if (useterm)
                {
                    status        = DrawerOperate.SetStartTerm;
                    beginningterm = _beginningterm;
                    operatelogs.Add(OperateLog.Create(DrawerOperate.Opened, ownerid, managerid, 0, _time));
                }
                status = DrawerOperate.Opened;
                operatelogs.Add(OperateLog.Create(DrawerOperate.Opened, ownerid, managerid, 0, _time));
                time = _time;
                break;
            }

            default:
            {
                ReturnedValue = false;
                break;
            }
            }
            return(ReturnedValue);
        }
Example #3
0
 public CashDrawer(DrawerFlag _flag, int _ownerid, int _managerid, long _time, double _beginningterm = 0.0)
 {
     id            = new Random().Next(-1, int.MaxValue);
     billlogs      = new List <Bill>();
     operatelogs   = new List <OperateLog>();
     status        = DrawerOperate.SetStartTerm;
     beginningterm = _beginningterm;
     operatelogs.Add(OperateLog.Create(status, _ownerid, _managerid, 0, _time));
     time      = _time;
     ownerid   = _ownerid;
     managerid = _managerid;
     flag      = _flag;
     status    = DrawerOperate.Opened;
     cheques   = new List <Cheque>();
     operatelogs.Add(OperateLog.Create(status, _ownerid, _managerid, 0, _time));
     xprint = 0;
     zprint = 0;
     dprint = 0;
 }
Example #4
0
 public CashDrawer(int _id, DrawerFlag _flag, int _ownerid, int _managerid, int _empolyeeid, long _time, double _beginningterm = 0.0)
 {
     id            = _id;
     billlogs      = new List <Bill>();
     operatelogs   = new List <OperateLog>();
     status        = DrawerOperate.SetStartTerm;
     beginningterm = _beginningterm;
     operatelogs.Add(OperateLog.Create(status, _ownerid, _managerid, _empolyeeid, _time));
     cheques    = new List <Cheque>();
     time       = _time;
     ownerid    = _ownerid;
     flag       = _flag;
     managerid  = _managerid;
     empolyeeid = _empolyeeid;
     status     = DrawerOperate.Opened;
     operatelogs.Add(OperateLog.Create(status, _ownerid, _managerid, _empolyeeid, _time));
     xprint        = 0;
     zprint        = 0;
     dprint        = 0;
     lastorderid   = 0;
     lastordertime = 0;
 }
Example #5
0
        public bool SignIn(int _employeeid, long _time)
        {
            bool ReturnedValue = true;

            switch (status)
            {
            case DrawerOperate.Signed_Out:
            case DrawerOperate.Opened:
            {
                operatelogs.Add(OperateLog.Create(DrawerOperate.Signed_In, ownerid, managerid, _employeeid, _time));
                status     = DrawerOperate.Signed_In;
                empolyeeid = _employeeid;
                break;
            }

            default:
            {
                ReturnedValue = false;
                break;
            }
            }
            return(ReturnedValue);
        }