Beispiel #1
0
        public async Task <IActionResult> GetHistory(HistoryFilter filter)
        {
            var history = await historyDbProvider.ReadModel(filter).ConfigureAwait(false);

            var res = history.ToList();

            return(Ok(res));
        }
Beispiel #2
0
        private void m_addHistoryStep()
        {
            HistoryFilter filter = new HistoryFilter();

            filter.name      = m_Name;
            filter.parameter = (m_ValueSlider.Value / 100.0).ToString();
            m_History.AddStep(filter);
        }
Beispiel #3
0
        private void m_PopUpWin_Closed(object sender, EventArgs e)
        {
            HistoryFilter filter = new HistoryFilter();

            filter.name      = m_Name;
            filter.parameter = m_PopUpItem.Value.ToString();
            m_History.AddStep(filter);
        }
Beispiel #4
0
        private void m_PopUpWin_Closed(object sender, EventArgs e)
        {
            HistoryFilter filter = new HistoryFilter();

            filter.name          = m_Name;
            filter.parameter     = m_BrightnessControl.Value.ToString();
            filter.optparameter1 = m_ContrastControl.Value.ToString();
            m_History.AddStep(filter);
        }
Beispiel #5
0
        public void Initialize(Object passedObj)
        {
            FilterParameter filterParam = passedObj as FilterParameter;

            if (filterParam != null)
            {
                dockPanel = filterParam.dockPanel;
                Width     = filterParam.Width;
                Height    = filterParam.Height;
                m_History = filterParam.History;
                if (filterParam.SysConfig != null)
                {
                    m_defaultDensityDefaultValue  = filterParam.SysConfig.DensityAlarmDefaultValue;
                    m_defaultDensitySetOnCaseOpen = filterParam.SysConfig.DensityAlarmSetOnCaseOpen;
                    m_profile = filterParam.SysConfig.Profile;
                }
                else
                {
                    m_defaultDensityDefaultValue  = 0.0;
                    m_defaultDensitySetOnCaseOpen = false;
                }


                HistoryFilter filter = new HistoryFilter();
                filter.name = m_Name;
                if (m_defaultDensitySetOnCaseOpen)
                {
                    if (m_profile != null && m_profile.DensityAlarmValue != 0.0)
                    {
                        filter.parameter = m_profile.DensityAlarmValue.ToString();
                    }
                    else
                    {
                        filter.parameter = m_defaultDensityDefaultValue.ToString();
                    }
                }
                else
                {
                    filter.parameter = "0.0";
                }
                m_History.SetFirstStep(filter);

                m_ValueSlider.IsEnabled = false;
                if (m_profile != null && m_profile.DensityAlarmValue != 0.0)
                {
                    m_ValueSlider.Value = m_profile.DensityAlarmValue * 100.0;
                }
                else
                {
                    m_ValueSlider.Value = m_defaultDensityDefaultValue * 100.0;
                }
                m_ValueSlider.IsEnabled = true;

                m_ValTextBox.Text = (m_ValueSlider.Value).ToString("F0") + " %";
            }
        }
 public PagedActionResult <TradeHistoryDto> Search([FromUri] HistoryFilter filter)
 {
     return(SafeGetPagedData <TradeHistoryDto>((result) =>
     {
         if (!ModelState.IsValid)//表示没有过滤参数成功匹配,判定为错误请求。
         {
             throw new DomainException("查询参数错误。");
         }
         int totalCount = 0;
         var pagedData = this.TradeHistoryService.Search(filter, out totalCount);
         result.Data = pagedData;
         result.TotalCount = totalCount;
     }));
 }
Beispiel #7
0
        public void RequestHistoryBy(ITerminal terminal, HistoryFilter filter)
        {
            keySelector = null;
               Cost = 0;
              switch (filter)
              {
              case HistoryFilter.AbonentName: keySelector = x => x.target.UserName; break;
              case HistoryFilter.CallDate: keySelector = x => x.started; break;
              case HistoryFilter.CallDuration: keySelector = x => x.duration; break;
              default: keySelector = x => x.source.UserName; break;
              }

              Console.WriteLine("\n\t\tHistory by " + filter);

              foreach (var c in this.CallHistory.Where(x=>x.source.Number == terminal.Number).OrderBy(keySelector))
              {
                  Cost = 0;

                  if (c.CurrentTariffPlan == TariffPlans.ConstMedium)
                  {
                      if (c.duration.TotalSeconds == 0) { Cost = 0; }
                      else
                      {
                          Cost = Math.Round(c.duration.TotalSeconds) * 100;
                      }
                  }

                  if (c.CurrentTariffPlan == TariffPlans.FirstPartExpensiveAfterFree)
                  {
                      if (c.duration.TotalSeconds == 0) { Cost = 0; }
                      else
                      {
                          if (c.duration.TotalSeconds < 5)
                          {
                              Cost += Math.Round((c.duration.TotalSeconds + 1)) * 400;
                          }
                          else { Cost += 5 * 400; }
                      }
                  }

                  Console.WriteLine("\n\nName : " + c.source.UserName +
                      " \nTarget abonent : " + c.target.UserName +
                      "\nBegin call at : " + c.started + "\nDuration : " + c.duration +
                      "\nTariff plane : " + c.CurrentTariffPlan +
                      "\nCost : " + Cost +
                      "\nPayed : " + c.Paid
                      );

              }
        }
Beispiel #8
0
        public void Initialize(Object passedObj)
        {
            FilterParameter filterParam = passedObj as FilterParameter;

            if (filterParam != null)
            {
                dockPanel = filterParam.dockPanel;
                m_History = filterParam.History;

                HistoryFilter filter = new HistoryFilter();
                filter.name      = m_Name;
                filter.parameter = "false";
                m_History.SetFirstStep(filter);
            }
        }
Beispiel #9
0
        public JsonActionResult <string> ExportTradeHistory([FromUri] HistoryFilter filter)
        {
            return(SafeExecute(() =>
            {
                if (!ModelState.IsValid)//表示没有过滤参数成功匹配,判定为错误请求。
                {
                    throw new DomainException("查询参数错误。");
                }

                filter.Start = 0;
                filter.Limit = 1000000;
                int totalCount;
                return ExecuteExport(RechargeHistoryService.Search(filter, out totalCount));
            }));
        }
Beispiel #10
0
        public void Initialize(Object passedObj)
        {
            FilterParameter filterParam = passedObj as FilterParameter;

            if (filterParam != null)
            {
                dockPanel = filterParam.dockPanel;
                m_History = filterParam.History;
                Width     = filterParam.Width;
                Height    = filterParam.Height;

                HistoryFilter filter = new HistoryFilter();
                filter.name      = m_Name;
                filter.parameter = m_PopUpItem.Value.ToString();
                m_History.SetFirstStep(filter);
            }
        }
Beispiel #11
0
        public void Initialize(Object passedObj)
        {
            FilterParameter filterParam = passedObj as FilterParameter;

            if (filterParam != null)
            {
                dockPanel = filterParam.dockPanel;
                Width     = filterParam.Width;
                Height    = filterParam.Height;
                m_History = filterParam.History;

                HistoryFilter filter = new HistoryFilter();
                filter.name          = m_Name;
                filter.parameter     = m_BrightnessControl.Value.ToString();
                filter.optparameter1 = m_ContrastControl.Value.ToString();
                m_History.SetFirstStep(filter);
            }
        }
Beispiel #12
0
        private void m_ToolBarItem_Click(Object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            bool enable = false;

            if (dockPanel.Effect == null)
            {
                enable = true;
            }

            ApplyFilter(enable);

            HistoryFilter filter = new HistoryFilter();

            filter.name      = m_Name;
            filter.parameter = enable.ToString();
            m_History.AddStep(filter);
        }
Beispiel #13
0
        public static async Task <IEnumerable <GuestRequest> > GetHistory(HistoryFilter filter = null)
        {
            List <Expression <Func <GuestRequest, bool> > > parms = new List <Expression <Func <GuestRequest, bool> > >
            {
                q => q.Disposition != Disposition.Pending && q.Disposition != Disposition.QueuePending
            };

            if (filter != null)
            {
                if (filter.AuthUser != null)
                {
                    parms.Add(q => q.AuthUser == filter.AuthUser);
                }
                if (filter.RequestDateFrom != null)
                {
                    parms.Add(q => q.RequestDate >= filter.RequestDateFrom && q.RequestDate <= filter.RequestDateTo);
                }
            }

            return(await DocDBRepo.DB <GuestRequest> .GetItemsAsync(parms.CombineAnd()));
        }
Beispiel #14
0
        public async Task <IEnumerable <GuestRequest> > GetHistory([FromUri] HistoryFilter filter)
        {
            IEnumerable <GuestRequest> history = (await GuestRequestRules.GetHistory(filter)).OrderByDescending(h => h.RequestDate);

            return(history);
        }
Beispiel #15
0
 private void m_addHistoryStep()
 {
     HistoryFilter filter = new HistoryFilter();
     filter.name = m_Name;
     filter.parameter = (m_ValueSlider.Value / 100.0).ToString();
     m_History.AddStep(filter);
 }
Beispiel #16
0
        public void Initialize(Object passedObj)
        {
            FilterParameter filterParam = passedObj as FilterParameter;
            if (filterParam != null)
            {
                dockPanel = filterParam.dockPanel;
                Width = filterParam.Width;
                Height = filterParam.Height;
                m_History = filterParam.History;
                if (filterParam.SysConfig != null)
                {
                    m_defaultDensityDefaultValue = filterParam.SysConfig.DensityAlarmDefaultValue;
                    m_defaultDensitySetOnCaseOpen = filterParam.SysConfig.DensityAlarmSetOnCaseOpen;
                    m_profile = filterParam.SysConfig.Profile;
                }
                else
                {
                    m_defaultDensityDefaultValue = 0.0;
                    m_defaultDensitySetOnCaseOpen = false;
                }
                

                HistoryFilter filter = new HistoryFilter();
                filter.name = m_Name;
                if (m_defaultDensitySetOnCaseOpen)
                {
                    if (m_profile != null && m_profile.DensityAlarmValue != 0.0)
                    {
                        filter.parameter = m_profile.DensityAlarmValue.ToString();
                    }
                    else
                    {
                        filter.parameter = m_defaultDensityDefaultValue.ToString();
                    }
                }
                else
                {
                    filter.parameter = "0.0";
                }
                m_History.SetFirstStep(filter);

                m_ValueSlider.IsEnabled = false;
                if (m_profile != null && m_profile.DensityAlarmValue != 0.0)
                {
                    m_ValueSlider.Value = m_profile.DensityAlarmValue * 100.0;
                }
                else
                {
                    m_ValueSlider.Value = m_defaultDensityDefaultValue * 100.0;
                }
                m_ValueSlider.IsEnabled = true;

                m_ValTextBox.Text = (m_ValueSlider.Value).ToString("F0") + " %";
            }
        }
Beispiel #17
0
 private void m_PopUpWin_Closed (object sender, EventArgs e)
 {
     HistoryFilter filter = new HistoryFilter();
     filter.name = m_Name;
     filter.parameter = m_PopUpItem.Value.ToString();
     m_History.AddStep(filter);
 }
Beispiel #18
0
 private void m_PopUpWin_Closed (object sender, EventArgs e)
 {
     HistoryFilter filter = new HistoryFilter();
     filter.name = m_Name;
     filter.parameter = m_BrightnessControl.Value.ToString();
     filter.optparameter1 = m_ContrastControl.Value.ToString();
     m_History.AddStep(filter);
 }
Beispiel #19
0
        public void Initialize(Object passedObj)
        {
            FilterParameter filterParam = passedObj as FilterParameter;
            if (filterParam != null)
            {
                dockPanel = filterParam.dockPanel;
                m_History = filterParam.History;

                HistoryFilter filter = new HistoryFilter();
                filter.name = m_Name;
                filter.parameter = "false";
                m_History.SetFirstStep(filter);
            }
        }
Beispiel #20
0
        private void m_ToolBarItem_Click(Object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            bool enable = false;

            if (dockPanel.Effect == null)
            {
                enable = true;
            }

            ApplyFilter(enable);

            HistoryFilter filter = new HistoryFilter();
            filter.name = m_Name;
            filter.parameter = enable.ToString();
            m_History.AddStep(filter);
        }
Beispiel #21
0
        public void Initialize(Object passedObj)
        {
            FilterParameter filterParam = passedObj as FilterParameter;
            if (filterParam != null)
            {
                dockPanel = filterParam.dockPanel;
                Width = filterParam.Width;
                Height = filterParam.Height;
                m_History = filterParam.History;

                HistoryFilter filter = new HistoryFilter();
                filter.name = m_Name;
                filter.parameter = m_PopUpItem.Value.ToString();
                m_History.SetFirstStep(filter);
            }
        }
Beispiel #22
0
 public void GetCallHistoryBy(HistoryFilter filter,BillingSystem BS)
 {
     BS.RequestHistoryBy(this,filter);
 }