示例#1
0
        public override void RefreshView()
        {
            var curDate      = _mainCtrl.CurDate;
            var monthPayData = SaleDataManager.Instance.CollectHandler.GetMonthPayData(curDate.GetMonths());

            _roomNum.Clear();
            _roomName.Clear();
            var rooms = SaleDataManager.Instance.Rooms;

            foreach (var room in rooms)
            {
                _roomName.Add(room.Name);
                _roomNum.Add(0);
            }

            foreach (var payRecord in monthPayData.PayDatas)
            {
                var recordId = payRecord.RecordId;
                var record   = SaleDataManager.Instance.GetRoomRecord(recordId);
                if (record != null && record.RoomIndex < rooms.Count)
                {
                    _roomNum[record.RoomIndex] += payRecord.PayNum;
                }
            }

            var max = _roomNum.Max();

            if (max == 0)
            {
                max = 100;
            }

            _collectCtrl.SetData(_roomName, _roomNum, max);
        }
示例#2
0
        public override void RefreshView()
        {
            var curDate      = _mainCtrl.CurDate;
            var monthPayData = SaleDataManager.Instance.CollectHandler.GetMonthPayData(curDate.GetMonths());
            var days         = DateTime.DaysInMonth(curDate.Year, curDate.Month);

            SetDays(days);
            if (monthPayData != null)
            {
                for (int i = 0; i < days; i++)
                {
                    var payData = monthPayData.GetDayPayData(i + 1);
                    if (payData != null)
                    {
                        foreach (var payRecord in payData)
                        {
                            _dayNum[i] += payRecord.PayNum;
                        }
                    }
                }
            }

            var max = _dayNum.Max();

            if (max == 0)
            {
                max = 100;
            }

            _collectCtrl.SetData(_dayStr, _dayNum, max);
//            _collectCtrl.SetRaw(_dayStr.Count);
        }
示例#3
0
        public override void RefreshView()
        {
            var curDate      = _mainCtrl.CurDate;
            var monthPayData = SaleDataManager.Instance.CollectHandler.GetMonthPayData(curDate.GetMonths());

            _payTypeNum.Clear();
            _payTypeName.Clear();
            _name2Idx.Clear();
            var payTypes = SaleDataManager.Instance.PayTypes;
            var index    = 0;

            foreach (var payType in payTypes)
            {
                _payTypeName.Add(payType);
                _payTypeNum.Add(0);
                _name2Idx.Add(payType, index);
                index++;
            }

            foreach (var payRecord in monthPayData.PayDatas)
            {
                int payTypeIndex;
                if (_name2Idx.TryGetValue(payRecord.PayType, out payTypeIndex))
                {
                    _payTypeNum[payTypeIndex] += payRecord.PayNum;
                }
            }

            var max = _payTypeNum.Max();

            if (max == 0)
            {
                max = 100;
            }

            _collectCtrl.SetData(_payTypeName, _payTypeNum, max);
        }