示例#1
0
        public DTOs.GeneralHubResponseObject _GeneralHubIncoming(DTOs.GeneralHubRequestObject RequestData)
        {
            DTOs.GeneralHubResponseObject      result = new DTOs.GeneralHubResponseObject();
            Repositories.ServiceSettingContext sc     = new Repositories.ServiceSettingContext(db);
            var service = sc.GetServiceById(RequestData.ServiceId);

            if (service != null)
            {
                switch (service.ServiceType)
                {
                case Enums.EnumServiceType.CrowdMinerCoinIMP:
                    var mrp = Factories.MiningRoomFactory.GetImplementation(Enums.EnumMiningRoomType.CoinIMP);
                    return(new DTOs.GeneralHubResponseObject()
                    {
                        Success = true, ResponseData = mrp.ProcessIncoming(RequestData)
                    });

                case Enums.EnumServiceType.CrowdMinerJSECoin:
                    var amrp = Factories.MiningRoomFactory.GetImplementation(Enums.EnumMiningRoomType.JSECoin);
                    return(new DTOs.GeneralHubResponseObject()
                    {
                        Success = true, ResponseData = amrp.ProcessIncoming(RequestData)
                    });

                case Enums.EnumServiceType.LuckyGameDefault:
                    var lgmp = Factories.SlotGameFactory.GetImplementation(Enums.EnumSlotGame.LuckyGame);
                    return(new DTOs.GeneralHubResponseObject()
                    {
                        Success = true, ResponseData = lgmp.ProcessIncoming(RequestData.User, RequestData)
                    });

                case Enums.EnumServiceType.OrderService:
                    var osmp = Factories.OrderProcessFactory.GetOrderProcessImplementation(Enums.EnumServiceType.OrderService);
                    return(new DTOs.GeneralHubResponseObject()
                    {
                        Success = true, ResponseData = osmp.ProcessIncoming(RequestData)
                    });

                default:
                    return(new DTOs.GeneralHubResponseObject()
                    {
                        Success = false, ErrorMessage = "not implemented"
                    });
                }
            }

            return(new DTOs.GeneralHubResponseObject()
            {
                Success = false, ErrorMessage = "undefined ingoming..."
            });
        }
示例#2
0
 public ServiceSettingRepositorie(DAL.ServiceContext _db)
 {
     serviceContext = new ServiceSettingContext(db);
     db             = _db;
 }