public async Task <IActionResult> GetServiceTopups([FromQuery] ServiceTopupParameter serviceTopupParameter)
        {
            var getAllserviceSubscriptionsQuery = new GetAllServiceTopupQuery(serviceTopupParameter);
            var result = await mediator.Send(getAllserviceSubscriptionsQuery);

            if (result.Code == HttpStatusCode.OK)
            {
                Response.Headers.Add("X-Pagination", PagedList <Entity> .ToJson(result.Value as PagedList <Entity>));
            }

            return(StatusCode((int)result.Code, result.Value));
        }
        /// <summary>
        /// Gets all VendorSubscriptions.
        /// </summary>
        /// <param name="vendorSubscriptionsParameter">The VendorSubscriptions parameters.</param>
        /// <returns></returns>
        public async Task <PagedList <Entity> > GetAllServiceTopups(ServiceTopupParameter serviceTopupParameter)
        {
            {
                var getserviceTopupParams = new object[] {
                    new MySqlParameter("@p_Limit", serviceTopupParameter.PageSize),
                    new MySqlParameter("@p_Offset", (serviceTopupParameter.PageNumber - 1) * serviceTopupParameter.PageSize),
                    new MySqlParameter("@p_IsForSingleServiceTopUp", serviceTopupParameter.IsForSingleServiceTopUp),
                    new MySqlParameter("@p_IsForService", serviceTopupParameter.IsForService),
                    new MySqlParameter("@p_IsForTopUp", serviceTopupParameter.IsForTopUp),
                    new MySqlParameter("@p_Value", serviceTopupParameter.Value),
                    new MySqlParameter("@p_ApprovalStatus", serviceTopupParameter.ApprovalStatus),
                    new MySqlParameter("@p_PaymentStatus", serviceTopupParameter.PaymentStatus),
                    new MySqlParameter("@p_FromDate", serviceTopupParameter.FromDate),
                    new MySqlParameter("@p_ToDate", serviceTopupParameter.ToDate),
                };
                var servicesubscriptions = await FindAll("CALL SpSelectActiveServiceTopUp(@p_Limit, @p_Offset, @p_IsForSingleServiceTopUp,@p_IsForService,@p_IsForTopUp,@p_Value,@p_ApprovalStatus,@p_PaymentStatus, @p_FromDate, @p_ToDate)", getserviceTopupParams).ToListAsync();

                var mappedVendorSubscriptions = servicesubscriptions.AsQueryable().ProjectTo <ServiceTopupResponse>(mapper.ConfigurationProvider);
                var sortedVendorSubscriptions = sortHelper.ApplySort(mappedVendorSubscriptions, serviceTopupParameter.OrderBy);
                var shapedVendorSubscriptions = dataShaper.ShapeData(sortedVendorSubscriptions, serviceTopupParameter.Fields);

                return(await PagedList <Entity> .ToPagedList(shapedVendorSubscriptions, serviceTopupParameter.PageNumber, serviceTopupParameter.PageSize));
            }
        }
        public async Task <IActionResult> GetServiceTopups([FromQuery] ServiceTopupParameter serviceTopupParameter)
        {
            var result = await serviceTopupService.GetServiceTopups(serviceTopupParameter);

            return(StatusCode((int)result.Code, result.Value));
        }
 public Task <APIResponse> GetServiceTopups(ServiceTopupParameter serviceTopupParameter)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GetAllSubscriptionplansQuery"/> class.
 /// </summary>
 /// <param name="serviceTopupParameter">The ServiceTopup parameters.</param>
 public GetAllServiceTopupQuery(ServiceTopupParameter serviceTopupParameter)
 {
     ServiceTopupParameter = serviceTopupParameter;
 }