public IActionResult GetTopSoldProducts([FromQuery] int numberOfItems)
        {
            var timedProcess = new TimedProcess <IEnumerable <ItemsSoldTop> >();

            timedProcess.StartTimer();

            var result = _reader.GetItemsSoldTop(numberOfItems);

            timedProcess.StopTimer();
            timedProcess.Result = result;
            return(Ok(timedProcess));
        }
        public async Task <IActionResult> GetOrdersTotalAmount([FromQuery] PageModel page)
        {
            var timedProcess = new TimedProcess <IEnumerable <OrderTotalAmount> >();

            timedProcess.StartTimer();

            var result = await _reader.GetTotalAmountPerInvoice(page);

            timedProcess.StopTimer();
            timedProcess.Result = result;
            return(Ok(timedProcess));
        }
        public IActionResult Get([FromQuery] int lowerbound, [FromQuery] int upperbound)
        {
            var timedProcess = new TimedProcess <IEnumerable <Product> >();

            timedProcess.StartTimer();

            var result = _reader.GetProductsBetweenPriceRange(lowerbound, upperbound);

            timedProcess.StopTimer();
            timedProcess.Result = result;
            return(Ok(timedProcess));
        }
        public async Task <IActionResult> Get([FromQuery] int warehouseId)
        {
            var timedProcess = new TimedProcess <IEnumerable <Product> >();

            timedProcess.StartTimer();

            var result = await _reader.GetAllProductsSoldInWarehouse(warehouseId);

            timedProcess.StopTimer();
            timedProcess.Result = result;
            return(Ok(timedProcess));
        }
Example #5
0
        //public IActionResult Get([FromQuery] PageModel filter)
        //{
        //    var timedProcess = new TimedProcess<PagedResult<Order>>();
        //    timedProcess.StartTimer();

        //    var result = _reader.GetAllOrders(filter);

        //    timedProcess.StopTimer();
        //    timedProcess.Result = result;
        //    return Ok(timedProcess);
        //}
        public async Task <IActionResult> Get([FromQuery] PageModel filter)
        {
            var timedProcess = new TimedProcess <PagedResult <Order> >();

            timedProcess.StartTimer();

            var result = await _reader.GetAllOrdersAsync(filter);

            timedProcess.StopTimer();
            timedProcess.Result = result;
            return(Ok(timedProcess));
        }
Example #6
0
        public async Task <IActionResult> SendNewsLetter([FromBody] string body)
        {
            if (String.IsNullOrWhiteSpace(body))
            {
                throw new ArgumentException($"Parameter {nameof(body)} cannot be empty.");
            }

            var timedProcess = new TimedProcess <object>();

            timedProcess.StartTimer();

            await _mailProcessor.SendNewsletter(body);

            timedProcess.StopTimer();
            return(Ok(timedProcess));
        }
Example #7
0
        private void BuildWaveProcesses()
        {
            if (waves.Length == 0)
            {
                return;
            }
            WaveProcess first   = new WaveProcess(waves[0]);
            WaveProcess current = first;

            for (int i = 1; i < waves.Length; i++)
            {
                TimedProcess delay = new TimedProcess(waves[i - 1].postDelay);
                current.Attach(delay);
                current = new WaveProcess(waves[i]);
                delay.Attach(current);
            }
            procManager.LaunchProcess(first);
        }
        public void FadeFromBlack(float duration, Process.OnTerminateCallback endCallback, float delay = 0f)
        {
            FadeInProcess fadeIn = new FadeInProcess(duration, fadeGraphic, true);

            if (endCallback != null)
            {
                fadeIn.TerminateCallback += endCallback;
            }
            if (delay != 0f)
            {
                TimedProcess delayProcess = new TimedProcess(delay);
                delayProcess.Attach(fadeIn);
                pm.LaunchProcess(delayProcess);
            }
            else
            {
                pm.LaunchProcess(fadeIn);
            }
        }
        public void FadeToBlack(float duration, Process.OnTerminateCallback endCallback, float delay = 0f, float endAlpha = 1f, bool useCurrentAlpha = false)
        {
            FadeOutProcess fadeOut = (useCurrentAlpha) ? new FadeOutProcess(duration, fadeGraphic, endAlpha, true) : new FadeOutProcess(duration, fadeGraphic, endAlpha);

            if (endCallback != null)
            {
                fadeOut.TerminateCallback += endCallback;
            }
            if (delay != 0f)
            {
                TimedProcess delayProcess = new TimedProcess(delay);
                delayProcess.Attach(fadeOut);
                pm.LaunchProcess(delayProcess);
            }
            else
            {
                pm.LaunchProcess(fadeOut);
            }
        }