コード例 #1
0
        public async Task <ActionResult <List <RepairTicket_PaymentStatusDTO> > > SingleListPaymentStatus([FromBody] RepairTicket_PaymentStatusFilterDTO RepairTicket_PaymentStatusFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            PaymentStatusFilter PaymentStatusFilter = new PaymentStatusFilter();

            PaymentStatusFilter.Skip      = 0;
            PaymentStatusFilter.Take      = int.MaxValue;
            PaymentStatusFilter.Take      = 20;
            PaymentStatusFilter.OrderBy   = PaymentStatusOrder.Id;
            PaymentStatusFilter.OrderType = OrderType.ASC;
            PaymentStatusFilter.Selects   = PaymentStatusSelect.ALL;

            List <PaymentStatus> PaymentStatuses = await PaymentStatusService.List(PaymentStatusFilter);

            List <RepairTicket_PaymentStatusDTO> RepairTicket_PaymentStatusDTOs = PaymentStatuses
                                                                                  .Select(x => new RepairTicket_PaymentStatusDTO(x)).ToList();

            return(RepairTicket_PaymentStatusDTOs);
        }
コード例 #2
0
        public async Task <ActionResult <List <OrderReport_PaymentStatusDTO> > > FilterListPaymentStatus([FromBody] OrderReport_PaymentStatusFilterDTO OrderReport_PaymentStatusFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            PaymentStatusFilter PaymentStatusFilter = new PaymentStatusFilter();

            PaymentStatusFilter.Skip      = 0;
            PaymentStatusFilter.Take      = 20;
            PaymentStatusFilter.OrderBy   = PaymentStatusOrder.Id;
            PaymentStatusFilter.OrderType = OrderType.ASC;
            PaymentStatusFilter.Selects   = PaymentStatusSelect.ALL;
            PaymentStatusFilter.Id        = OrderReport_PaymentStatusFilterDTO.Id;
            PaymentStatusFilter.Name      = OrderReport_PaymentStatusFilterDTO.Name;

            List <PaymentStatus> PaymentStatuses = await PaymentStatusService.List(PaymentStatusFilter);

            List <OrderReport_PaymentStatusDTO> OrderReport_PaymentStatusDTOs = PaymentStatuses
                                                                                .Select(x => new OrderReport_PaymentStatusDTO(x)).ToList();

            return(OrderReport_PaymentStatusDTOs);
        }
コード例 #3
0
        public void Setup()
        {
            var builder = new DbContextOptionsBuilder <PaymentContext>();

            builder.UseInMemoryDatabase("Payments");
            var options = builder.Options;

            var expensivePaymentGateway    = new Mock <IExpensivePaymentGateway>();
            var cheapPaymentGateway        = new Mock <ICheapPaymentGateway>();
            var premiumPaymentService      = new Mock <IPremiumPaymentService>();
            var controllerLogger           = new Mock <ILogger <PaymentController> >();
            var paymentServiceLogger       = new Mock <ILogger <PaymentService> >();
            var paymentStatusServiceLogger = new Mock <ILogger <PaymentStatusService> >();

            var paymentContext       = new PaymentContext(options);
            var unitOfwork           = new UnitOfWorkBase <PaymentContext>(paymentContext);
            var paymentStatusService = new PaymentStatusService(unitOfwork, paymentStatusServiceLogger.Object);
            var paymentService       = new PaymentService(paymentStatusService, unitOfwork, paymentServiceLogger.Object,
                                                          expensivePaymentGateway.Object, cheapPaymentGateway.Object, premiumPaymentService.Object);

            PaymentController = new PaymentController(paymentService, controllerLogger.Object);
        }
コード例 #4
0
 public PaymentController(PaymentService paymentService, PaymentStatusService paymentStatusService)
 {
     _paymentService       = paymentService;
     _paymentStatusService = paymentStatusService;
 }
コード例 #5
0
ファイル: list.aspx.cs プロジェクト: daniela12/gooptic
    /// <summary>
    /// Retrieves description of payment status
    /// </summary>
    /// <param name="Value"></param>
    /// <returns></returns>
    public string DisplayPaymentStatus(object Value)
    {
        if (Value != null)
        {
            if (Value.ToString().Length > 0)
            {
                PaymentStatusService serv = new PaymentStatusService();
                PaymentStatus ps = serv.GetByPaymentStatusID(int.Parse(Value.ToString()));

                return ps.PaymentStatusName.ToString();
            }
        }

        return "";
    }