public Entity ReplaceEventService(EventService newDispatcher)
 {
     var component = CreateComponent<EventServiceComponent>(ComponentIds.EventService);
     component.dispatcher = newDispatcher;
     ReplaceComponent(ComponentIds.EventService, component);
     return this;
 }
        public void GetEvents_Returns_A_List_Of_Events()
        {
            var service = new EventService();
            var events = service.GetEvents();

            Assert.IsNotNull(events);
        }
Ejemplo n.º 3
0
 protected override void Initialize(System.Web.Routing.RequestContext requestContext)
 {
     if (_db == null) _db = new EpiloggerDB();
     if (_es == null) _es = new EventService();
     if (_us == null) _us = new UserService();
     base.Initialize(requestContext);
 }
Ejemplo n.º 4
0
        protected override void Initialize(System.Web.Routing.RequestContext requestContext) {
            if (tweetService == null) tweetService = new TweetService();
            if (eventService == null) eventService = new EventService();
            if (userService == null) userService = new UserService();

            base.Initialize(requestContext);
        }
Ejemplo n.º 5
0
        public void CanGetListOfPersonEventsForAGroup()
        {
            var eventRepository = MockRepository.GenerateStub<IEventRepository>();
            var eventList = new List<PersonEventDto> { new PersonEventDto(), new PersonEventDto(), new PersonEventDto() };
            var currentPerson = new Person {Permissions = new List<int> {57}};
            eventRepository
                .Expect(e => e.GetPersonEventsForGroup(1, currentPerson))
                .Return(eventList);

            var permissionRepository = new PermissionRepository();
            var personRepository = new PersonRepository(permissionRepository, new ChurchRepository());
            var usernamePasswordRepository = new UsernamePasswordRepository(permissionRepository);
            var groupRepository = new GroupRepository();
            var messageRepository = new MessageRepository();
            var messageRecepientRepository = new MessageRecepientRepository();
            var messageAttachmentRepository = new MessageAttachmentRepository();
            var emailSender = new EmailSender(messageRepository, messageRecepientRepository, messageAttachmentRepository, personRepository);
            var churchEmailTemplatesRepository = new ChurchEmailTemplatesRepository();
            var emailContentRepository = new EmailContentRepository();
            var emailContentService = new EmailContentService(emailContentRepository);
            var emailService = new EmailService(usernamePasswordRepository, personRepository, groupRepository, emailSender, emailContentService, churchEmailTemplatesRepository, permissionRepository);
            IEventService eventService = new EventService(eventRepository, emailService, new BirthdayAndAniversaryRepository());

            var sut = eventService.GetPersonEventsForGroup(1, currentPerson);

            Assert.That(sut.Count(), Is.EqualTo(3));
        }
Ejemplo n.º 6
0
 public RightBottomPanelHud(Transform content, EventService eventService)
 {
     go = content.gameObject;
     this.eventService = eventService;
     prepareHud();
     createUpdaters();
     addListeners();
 }
        public void GetEvents_Returns_A_Non_Empty_List()
        {
            var service = new EventService();
            var events = service.GetEvents();

            var numberOfEvents = events.Count();
            Assert.AreNotEqual(0, numberOfEvents);
        }
Ejemplo n.º 8
0
 public InputVectorElement(string name, EventService eventService, Vector2 startValue, Action<float> onChangeX, Action<float> onChangeY)
 {
     go = UnityEngine.Object.Instantiate(Resources.Load<GameObject>("Prefab/UI/EditorView/Level/InputVectorElement"));
     getChild("Text").GetComponent<Text>().text = name;
     this.eventService = eventService;
     addListenerToInputFieldAndSetStartValue("InputFieldX", onChangeX, startValue.x);
     addListenerToInputFieldAndSetStartValue("InputFieldY", onChangeY, startValue.y);
 }
Ejemplo n.º 9
0
 public LeftPanelHud(Transform content, EventService eventService, LevelActionExecutor executor, Action onDelete, Action onSave, Action onBack, Action onClone)
 {
     go = content.gameObject;
     this.eventService = eventService;
     this.executor = executor;
     state = LeftPanelViewState.Hidden;
     setData(onDelete, onSave, onBack, onClone);
 }
        public void GetHost_SomeName_SomeHost()
        {
            //var data = JsonConvert.DeserializeObject<Event[]>(File.ReadAllText(_hostGet), _settings);

            //_context.Stub(x => x.SendRequest<Event[]>(Arg<object>.Is.Anything, Arg<string>.Is.Anything)).Return(data);

            var target = new EventService(_context) as IEventService;

            var result = target.Get();
        }
Ejemplo n.º 11
0
 public EnemyLeftPanelHud(Transform content, EventService eventService, EnemyModelCmpActionExecutor executor, Entity entity, EnemyModel component)
 {
     go = content.gameObject;
     this.content = content;
     this.eventService = eventService;
     this.executor = executor;
     this.entity = entity;
     weaponExecutor = new EnemyWeaponActionExecutor(entity, component);
     weaponExecutor.Execute(getActionBasedOnType(executor.getWeapon()));
     setData();
 }
    /// <summary>
    /// Inicializa o analytics com um usuario.
    /// </summary>
    /// <param name="p_loggedUser">P_logged user.</param>
    public static void Initialize(string p_loggedUser = null)
    {
        App42API.Initialize(App42Manager.Instance.API_KEY, App42Manager.Instance.SECRET_KEY);
        App42API.EnableEventService(true);  //FIXME
        if (!string.IsNullOrEmpty( p_loggedUser))
            App42API.SetLoggedInUser(p_loggedUser) ;

        eventService = App42API.BuildEventService();

        //		if (isDebug)
        //			App42Log.SetDebug(true);        //Prints output in your editor console
    }
        public void GetEvents_Contains_Event1()
        {
            var service = new EventService();
            var events = service.GetEvents();
            var someEvent = new Event()
            {
                Name = "Event 1",
                EventType = "1"
            };

            var result = events.Contains(someEvent);

               Assert.IsTrue(result);
        }
Ejemplo n.º 14
0
        public void CanGetListOfEventsThatHaveBeenAttended()
        {
            var eventRepository = MockRepository.GenerateStub<IEventRepository>();
            var eventList = new List<EventDto> {new EventDto(), new EventDto(), new EventDto()};

            eventRepository
                .Expect(e => e.GetListOfCompletedEvents(1))
                .Return(eventList);

            IEventService eventService = new EventService(eventRepository);

            var sut = eventService.GetListOfCompletedEvents(1);

            Assert.That(sut.Count(), Is.EqualTo(3));
        }
Ejemplo n.º 15
0
 public ServiceList(string url, ResponseToken token)
 {
     this.eventService = new EventService(url, token);
     this.categoryService = new CategoryService(url, token);
     this.clubService = new ClubService(url, token);
     this.userService = new UserService(url, token);
     this.ticketService = new TicketService(url, token);
     this.meetingService = new MeetingService(url, token);
     this.invoiceService = new InvoiceService(url, token);
     this.groupService = new GroupService(url, token);
     this.expenseService = new ExpenseService(url, token);
     this.emailService = new EmailService(url, token);
     this.depositService = new DepositService(url, token);
     this.customFieldService = new CustomFieldService(url, token);
     this.taskService = new TaskService(url, token);
     this.contactService = new ContactService(url, token);
 }
Ejemplo n.º 16
0
        public void Test_Get_EventService_Returns_Response()
        {
            //TODO this Test sucks
                //Arrange
                //Set up the Service I want to Test
                var eventService = new EventService { Repository = TestContainer.Resolve<IEventRepository>() };
                string testFromDate = DateTime.Now.AddHours(-1).ToString(Global_Const.DATE_FORMAT);
                var testEvents = new Events {From = testFromDate};
                //Act
                // Call on the Service
                EventRecordListResponse response = (EventRecordListResponse) eventService.Get(testEvents);
                var eventRecords = response.EventRecords;
                //Assert
                Assert.IsNotNull(response, "Response from Eventservice is null");

                Assert.IsInstanceOfType(response, typeof(EventRecordListResponse), "Returns the wrong list type");
                List<IEventRecord> eventRList = (List<IEventRecord>)response.EventRecords;
                int evRlCount = eventRList.Count;
                Assert.IsTrue(evRlCount == 20, "There should be 20 item in the event test list");
        }
Ejemplo n.º 17
0
    void Start()
    {
        this.player = (Player) GameObject.FindGameObjectWithTag("Player").GetComponent("Player");

        this.eventService = (EventService) this.gameObject.GetComponent("EventService");
        this.eventService.successResponseHandler = new WebService.SuccessResponseHandler(this.HandleSendEventsSuccess);

        this.roomService = (RoomService) this.gameObject.GetComponent("RoomService");

        if (PlayerPrefs.HasKey("avatar"))
        {
            Debug.Log(PlayerPrefs.GetString("avatar"));

            AvatarModel avatar = JsonMapper.ToObject<AvatarModel>(PlayerPrefs.GetString("avatar"));

            if (avatar != null)
            {
                this.player.AvatarId = avatar.avatar_id;
                this.player.Name = avatar.label;
                this.player.XP = avatar.GetAttributeValue("xp");
                this.player.HP = avatar.GetAttributeValue("hp");
            }
        }
        else
        {
            Debug.LogWarning("Started game with no avatar data.");
        }

        if (this.roomId != 0)
        {
            this.roomService.successResponseHandler = new WebService.SuccessResponseHandler(this.PopulateRoomContainers);
            this.roomService.GetRoom(this.roomId);
        }
    }
Ejemplo n.º 18
0
    /// <summary>
    /// 更新程序EXE 检查
    /// </summary>
    private void DoUpdaterCheck()
    {
        _stateArg.Progress  = 0f;
        _stateArg.StateInfo = "...检查更新程序...";
        EventService.GetInstance().SendEvent((uint)EventId.UpdateStateChange, _stateArg);
        //建立更新程序文件夹
        string updaterDir = FileUtil.CombinePath(FileUtil.GetExeRootPath(), "ArcadeUpdater");

        if (!FileUtil.IsDirectoryExist(updaterDir))
        {
            FileUtil.CreateDirectory(updaterDir);
        }
        //验证更新器是否存在
        string updaterExePath     = FileUtil.CombinePath(updaterDir, "ArcadeUpdater.exe");
        string updaterVersionPath = FileUtil.CombinePath(updaterDir, "ArcadeUpdaterVersion.bytes");
        //
        string updaterCurVersion = "000";

        //不存在一个 就清理目录
        if (!FileUtil.IsFileExist(updaterExePath) || !FileUtil.IsFileExist(updaterVersionPath))
        {
            FileUtil.ClearDirectory(updaterDir);
            //
            updaterCurVersion = "000";
        }
        else
        {
            string rr = System.Text.Encoding.UTF8.GetString(FileUtil.ReadFile(updaterVersionPath));
            if (string.IsNullOrEmpty(rr))
            {
                rr = "000";
            }
            updaterCurVersion = rr.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", "");
        }
        //
        string newVerisonPath = FileUtil.GetStreamingAssetsPath("ArcadeUpdaterVersion.bytes");
        string newVersion     = System.Text.Encoding.UTF8.GetString(FileUtil.ReadFile(newVerisonPath));

        if (string.IsNullOrEmpty(newVersion))
        {
            newVersion = "f**k";
        }
        newVersion = newVersion.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", "");
        //
        if (string.Equals(newVersion, updaterCurVersion))
        {
            //不需要更新更新程序
            DoNetworkCheck();
        }
        else
        {
            //需要更新更新程序
            string newArcadeZip = FileUtil.GetStreamingAssetsPath("ArcadeUpdater.zip");
            if (!FileUtil.IsFileExist(newArcadeZip))
            {
                Log.LogE("F**k No ArcadeUpdater.zip");
                //
                DoNetworkCheck();
                return;
            }
            //
            _stateArg.Progress  = 0f;
            _stateArg.StateInfo = "...解压更新程序...";
            EventService.GetInstance().SendEvent((uint)EventId.UpdateStateChange, _stateArg);
            //
            _unzipper = UnZipperMono.GetUnZipper(newArcadeZip, updaterDir, this.OnUpdaterUnZip);
            _unzipper.Begin();
        }
    }
        public void TestInitBeforeSettingMainThreadId()
        {
            IEventService anotherEventService = new EventService();

            Assert.Throws <InvalidOperationException>(() => anotherEventService.OnInit());
        }
Ejemplo n.º 20
0
 protected Task Delete(Entity delete)
 {
     return(EventService.Raise(new PersistenceEvent(delete, PersistenceAction.Delete)));
 }
Ejemplo n.º 21
0
 public ViewService(EventService eventService, IUIFactoryService uiFactoryService)
 {
     factory = new ViewFactory();
     createCanvasAndTouchBlocker(uiFactoryService);
     addViewShowHiddenListeners(eventService);
 }
Ejemplo n.º 22
0
 public BonusService(Pool pool, IWwwService wwwService, EventService eventService)
 {
     this.pool = pool;
     this.wwwService = wwwService;
     this.eventService = eventService;
 }
Ejemplo n.º 23
0
        public static void OpenPartyMenu()
        {
            FF9PARTY_INFO party = new FF9PARTY_INFO();

            Int32 availableChatacters = 0;

            if (Configuration.Hacks.AllCharactersAvailable > 0)
            {
                availableChatacters = 0x1FF;
                party.party_ct      = 4;
            }
            else
            {
                for (Int32 characterIndex = 8; characterIndex >= 0; --characterIndex)
                {
                    Boolean isAvailable = (FF9StateSystem.Common.FF9.player[characterIndex].info.party != 0);
                    if (isAvailable)
                    {
                        party.party_ct++;
                    }

                    availableChatacters = availableChatacters << 1 | (isAvailable ? 1 : 0);
                }

                if (party.party_ct > 4)
                {
                    party.party_ct = 4;
                }
            }

            for (Int32 memberIndex = 0; memberIndex < 4; ++memberIndex)
            {
                if (FF9StateSystem.Common.FF9.party.member[memberIndex] != null)
                {
                    Byte characterId = FF9StateSystem.Common.FF9.party.member[memberIndex].info.slot_no;
                    party.menu[memberIndex] = characterId;
                    availableChatacters    &= ~(1 << characterId);
                }
                else
                {
                    party.menu[memberIndex] = Byte.MaxValue;
                }
            }

            Byte availableSlot = 0;

            for (Byte characterId = 0; characterId < 9 && availableSlot < PartySettingUI.FF9PARTY_PLAYER_MAX && availableChatacters > 0; ++characterId)
            {
                if ((availableChatacters & 1) > 0)
                {
                    party.select[availableSlot++] = characterId;
                }

                availableChatacters >>= 1;
            }

            while (availableSlot < PartySettingUI.FF9PARTY_PLAYER_MAX)
            {
                party.select[availableSlot++] = PartySettingUI.FF9PARTY_NONE;
            }

            EventService.OpenPartyMenu(party);
        }
Ejemplo n.º 24
0
        protected override EmptyResponseData ProcessRequest(DTO.Base.APIRequest <UpdateVipCardTypeSystemRP> pRequest)
        {
            var rd   = new EmptyResponseData();
            var para = pRequest.Parameters;
            var loggingSessionInfo   = new SessionManager().CurrentUserLoginInfo;
            var entitySysVipCardType = new SysVipCardTypeEntity();
            var bllSysVipCardType    = new SysVipCardTypeBLL(loggingSessionInfo);
            //卡分润规则
            var bllVipCardProfitRule = new VipCardProfitRuleBLL(loggingSessionInfo);
            //续费充值方式
            var VipCardReRechargeProfitRuleService = new VipCardReRechargeProfitRuleBLL(loggingSessionInfo);

            //编辑会员卡等级
            try
            {
                var SysVipCardTypeInfo = bllSysVipCardType.QueryByEntity(new SysVipCardTypeEntity()
                {
                    CustomerID = loggingSessionInfo.ClientID, VipCardTypeID = para.VipCardTypeID, IsDelete = 0
                }, null).FirstOrDefault();
                switch (para.OperateType)
                {
                //如果为1编辑会员卡等级信息
                case 1:
                    if (SysVipCardTypeInfo != null)
                    {
                        //获取当前会员信息
                        List <IWhereCondition> wheres = new List <IWhereCondition>();
                        wheres.Add(new EqualsCondition()
                        {
                            FieldName = "Category", Value = 0
                        });
                        wheres.Add(new EqualsCondition()
                        {
                            FieldName = "CustomerID", Value = loggingSessionInfo.ClientID
                        });
                        wheres.Add(new EqualsCondition()
                        {
                            FieldName = "VipCardTypeName", Value = para.VipCardTypeName
                        });
                        wheres.Add(new DirectCondition("VipCardLevel!='" + SysVipCardTypeInfo.VipCardLevel + "'"));
                        var ExistVipCardTypeResult = bllSysVipCardType.Query(wheres.ToArray(), null).FirstOrDefault();
                        if (ExistVipCardTypeResult != null)
                        {
                            throw new APIException("会员卡名称不能重复!")
                                  {
                                      ErrorCode = ERROR_CODES.INVALID_BUSINESS
                                  };
                        }
                        SysVipCardTypeInfo.VipCardTypeID   = para.VipCardTypeID;
                        SysVipCardTypeInfo.Category        = 0;
                        SysVipCardTypeInfo.VipCardTypeName = para.VipCardTypeName;
                        SysVipCardTypeInfo.VipCardLevel    = SysVipCardTypeInfo.VipCardLevel;
                        SysVipCardTypeInfo.IsPassword      = SysVipCardTypeInfo.IsPassword;
                        if (SysVipCardTypeInfo.VipCardLevel == 1)    //如果等级为1默认可充值
                        {
                            SysVipCardTypeInfo.Isprepaid = 1;
                        }
                        else
                        {
                            SysVipCardTypeInfo.Isprepaid = para.IsPrepaid;
                        }
                        SysVipCardTypeInfo.IsOnlineSales = para.IsOnlineSales;
                        SysVipCardTypeInfo.PicUrl        = para.PicUrl;
                        SysVipCardTypeInfo.CustomerID    = loggingSessionInfo.ClientID;
                        if (SysVipCardTypeInfo.VipCardLevel == 1)
                        {
                            SysVipCardTypeInfo.Prices           = 0;
                            SysVipCardTypeInfo.ExchangeIntegral = 0;
                            SysVipCardTypeInfo.IsExtraMoney     = 2;
                        }
                    }
                    //如果IsOnlineSales为0则需要逻辑删除分润规则数据
                    if (SysVipCardTypeInfo.IsOnlineSales == 0)
                    {
                        var VipCardProfitRuleInfo = bllVipCardProfitRule.QueryByEntity(new VipCardProfitRuleEntity()
                        {
                            VipCardTypeID = SysVipCardTypeInfo.VipCardTypeID, CustomerID = loggingSessionInfo.ClientID
                        }, null);
                        if (VipCardProfitRuleInfo.Length > 0)
                        {
                            bllVipCardProfitRule.Delete(VipCardProfitRuleInfo);
                        }
                    }

                    if (SysVipCardTypeInfo.Isprepaid == 0)     //不可充值
                    {
                        var VipCardUpgradeRuleService = new VipCardUpgradeRuleBLL(loggingSessionInfo);
                        //升级规则信息 永远只有一条信息
                        var CardUpgradeRuleEntity = VipCardUpgradeRuleService.QueryByEntity(new VipCardUpgradeRuleEntity()
                        {
                            VipCardTypeID = SysVipCardTypeInfo.VipCardTypeID
                        }, null);
                        if (CardUpgradeRuleEntity != null && CardUpgradeRuleEntity.FirstOrDefault() != null) //如果有设置了升级条件
                        {
                            if (CardUpgradeRuleEntity.FirstOrDefault().IsBuyUpgrade == 1)                    //消费升级+不可充值==>逻辑删除 会员卡销售激励规则
                            {
                                var Ids = bllVipCardProfitRule.QueryByEntity(new VipCardProfitRuleEntity()
                                {
                                    CustomerID = loggingSessionInfo.ClientID, VipCardTypeID = SysVipCardTypeInfo.VipCardTypeID
                                }, null).Select(m => m.CardBuyToProfitRuleId.Value.ToString()).ToArray();
                                if (Ids.Length > 0)
                                {
                                    bllVipCardProfitRule.Delete(Ids);
                                }
                            }
                        }

                        //将所有梯度信息 逻辑删除
                        string[] ProfitRuleIds = bllVipCardProfitRule.GetRechargeProfitRuleByIsPrepaid(loggingSessionInfo.ClientID, SysVipCardTypeInfo.VipCardTypeID);
                        if (ProfitRuleIds.Length > 0)
                        {
                            VipCardReRechargeProfitRuleService.Delete(ProfitRuleIds);
                        }
                    }
                    bllSysVipCardType.Update(SysVipCardTypeInfo);
                    //修改虚拟商品
#warning 商品代码注释 Bear
                    ItemService _ItemService = new ItemService(loggingSessionInfo);
                    _ItemService.SaveCardToOffenTItem(loggingSessionInfo, SysVipCardTypeInfo);
                    break;

                //如果为2编辑升级规则信息
                case 2:
                    var bllVipCardUpgradeRule = new VipCardUpgradeRuleBLL(loggingSessionInfo);
                    //升级类型不能为空 (1=购卡升级;2=充值升级;3=消费升级;)
                    if (para.UpGradeType != 0)
                    {
                        VipCardUpgradeRuleEntity vipCardUpgradeRuleEntity = new VipCardUpgradeRuleEntity();
                        if (para.OperateObjectID != null)
                        {
                            var VipCardUpgradeRuleInfo = bllVipCardUpgradeRule.QueryByEntity(new VipCardUpgradeRuleEntity()
                            {
                                CustomerID = loggingSessionInfo.ClientID, VipCardUpgradeRuleId = new Guid(para.OperateObjectID), VipCardTypeID = para.VipCardTypeID
                            }, null).FirstOrDefault();
                            if (VipCardUpgradeRuleInfo != null)
                            {
                                //先置为0 再进行更新
                                SysVipCardTypeInfo.IsExtraMoney           = 2;
                                SysVipCardTypeInfo.Prices                 = 0;
                                SysVipCardTypeInfo.ExchangeIntegral       = 0;
                                VipCardUpgradeRuleInfo.OnceRechargeAmount = 0;
                                VipCardUpgradeRuleInfo.OnceBuyAmount      = 0;
                                VipCardUpgradeRuleInfo.BuyAmount          = 0;
                                switch (para.UpGradeType)
                                {
                                case 1:
                                    VipCardUpgradeRuleInfo.IsPurchaseUpgrade = 1;
                                    //金额和积分 与可补差价在卡等级表里面
                                    SysVipCardTypeInfo.VipCardTypeID    = para.VipCardTypeID;
                                    SysVipCardTypeInfo.IsExtraMoney     = para.IsExtraMoney;
                                    SysVipCardTypeInfo.Prices           = para.Prices;
                                    SysVipCardTypeInfo.ExchangeIntegral = para.ExchangeIntegral;
                                    //充值升级归零
                                    VipCardUpgradeRuleInfo.IsRecharge = 0;
                                    //消费升级置零
                                    VipCardUpgradeRuleInfo.IsBuyUpgrade = 0;
                                    break;

                                case 2:
                                    VipCardUpgradeRuleInfo.IsPurchaseUpgrade  = 0;
                                    VipCardUpgradeRuleInfo.IsRecharge         = 1;
                                    VipCardUpgradeRuleInfo.IsBuyUpgrade       = 0;
                                    VipCardUpgradeRuleInfo.OnceRechargeAmount = para.OnceRechargeAmount;
                                    break;

                                case 3:
                                    VipCardUpgradeRuleInfo.IsPurchaseUpgrade = 0;
                                    VipCardUpgradeRuleInfo.IsRecharge        = 0;
                                    VipCardUpgradeRuleInfo.IsBuyUpgrade      = 1;
                                    VipCardUpgradeRuleInfo.OnceBuyAmount     = para.OnceBuyAmount;
                                    VipCardUpgradeRuleInfo.BuyAmount         = para.BuyAmount;
                                    //如果该卡为不可充值 那么就默认删除
                                    var syscardentity = bllSysVipCardType.GetByID(para.VipCardTypeID);
                                    if (syscardentity != null && syscardentity.Isprepaid == 0)         //消费升级 {不可充值} 默认删除该卡的激励规则
                                    {
                                        var Ids = bllVipCardProfitRule.QueryByEntity(new VipCardProfitRuleEntity()
                                        {
                                            CustomerID = loggingSessionInfo.ClientID, VipCardTypeID = para.VipCardTypeID
                                        }, null).Select(m => m.CardBuyToProfitRuleId.Value.ToString()).ToArray();
                                        if (Ids.Length > 0)
                                        {
                                            bllVipCardProfitRule.Delete(Ids);
                                        }
                                    }
                                    break;
                                }
                                //更新卡等级部分信息
                                bllSysVipCardType.Update(SysVipCardTypeInfo);
                                //修改虚拟商品
                                ItemService _ItemServices = new ItemService(loggingSessionInfo);
                                _ItemServices.SaveCardToOffenTItem(loggingSessionInfo, SysVipCardTypeInfo);
                                bllVipCardUpgradeRule.Update(VipCardUpgradeRuleInfo);
                            }
                        }
                        else
                        {
                            //先置为0 再进行更新
                            SysVipCardTypeInfo.IsExtraMoney             = 2;
                            SysVipCardTypeInfo.Prices                   = 0;
                            SysVipCardTypeInfo.ExchangeIntegral         = 0;
                            vipCardUpgradeRuleEntity.OnceRechargeAmount = 0;
                            vipCardUpgradeRuleEntity.OnceBuyAmount      = 0;
                            vipCardUpgradeRuleEntity.BuyAmount          = 0;
                            switch (para.UpGradeType)
                            {
                            case 1:
                                vipCardUpgradeRuleEntity.IsPurchaseUpgrade = 1;
                                vipCardUpgradeRuleEntity.VipCardTypeID     = para.VipCardTypeID;
                                //金额和积分 与可补差价在卡等级表里面
                                SysVipCardTypeInfo.VipCardTypeID    = para.VipCardTypeID;
                                SysVipCardTypeInfo.IsExtraMoney     = para.IsExtraMoney;
                                SysVipCardTypeInfo.Prices           = para.Prices;
                                SysVipCardTypeInfo.ExchangeIntegral = para.ExchangeIntegral;
                                //充值升级归零
                                vipCardUpgradeRuleEntity.IsRecharge = 0;
                                //消费升级置零
                                vipCardUpgradeRuleEntity.IsBuyUpgrade = 0;
                                break;

                            case 2:
                                vipCardUpgradeRuleEntity.IsPurchaseUpgrade  = 0;
                                vipCardUpgradeRuleEntity.IsRecharge         = 1;
                                vipCardUpgradeRuleEntity.IsBuyUpgrade       = 0;
                                vipCardUpgradeRuleEntity.OnceRechargeAmount = para.OnceRechargeAmount;
                                break;

                            case 3:          //消费升级
                                vipCardUpgradeRuleEntity.IsPurchaseUpgrade = 0;
                                vipCardUpgradeRuleEntity.IsRecharge        = 0;
                                vipCardUpgradeRuleEntity.IsBuyUpgrade      = 1;
                                vipCardUpgradeRuleEntity.OnceBuyAmount     = para.OnceBuyAmount;
                                vipCardUpgradeRuleEntity.BuyAmount         = para.BuyAmount;
                                break;
                            }
                            //更新卡等级部分信息
                            bllSysVipCardType.Update(SysVipCardTypeInfo);
                            //修改虚拟商品
                            ItemService _ItemServices = new ItemService(loggingSessionInfo);
                            _ItemServices.SaveCardToOffenTItem(loggingSessionInfo, SysVipCardTypeInfo);
                            //添加卡升级规则
                            vipCardUpgradeRuleEntity.VipCardUpgradeRuleId = Guid.NewGuid();
                            vipCardUpgradeRuleEntity.CustomerID           = loggingSessionInfo.ClientID;
                            bllVipCardUpgradeRule.Create(vipCardUpgradeRuleEntity);
                        }
                    }
                    else
                    {
                        throw new APIException("升级类型不能为空!")
                              {
                                  ErrorCode = ERROR_CODES.INVALID_BUSINESS
                              };
                    }

                    break;

                //如果为3编辑基本权益信息
                case 3:
                    var bllVipCardRule    = new VipCardRuleBLL(loggingSessionInfo);
                    var entityVipCardRule = new VipCardRuleEntity();
                    var VipCardRuleInfo   = bllVipCardRule.QueryByEntity(new VipCardRuleEntity()
                    {
                        CustomerID = loggingSessionInfo.ClientID, RuleID = Convert.ToInt32(para.OperateObjectID), VipCardTypeID = para.VipCardTypeID
                    }, null).FirstOrDefault();
                    if (VipCardRuleInfo != null)
                    {
                        entityVipCardRule.RuleID               = Convert.ToInt32(para.OperateObjectID);
                        entityVipCardRule.VipCardTypeID        = para.VipCardTypeID;
                        entityVipCardRule.CardDiscount         = para.CardDiscount * 10;
                        entityVipCardRule.PaidGivePoints       = para.PaidGivePoints;
                        entityVipCardRule.PaidGivePercetPoints = para.PaidGivePercetPoints;
                        entityVipCardRule.CustomerID           = loggingSessionInfo.ClientID;
                        bllVipCardRule.Update(entityVipCardRule);
                    }
                    break;
                }

                try
                {
                    var msg = new EventContract
                    {
                        Operation  = OptEnum.Update,
                        EntityType = EntityTypeEnum.VipCardType,
                        Id         = SysVipCardTypeInfo.VipCardTypeID.ToString()
                    };
                    var eventService = new EventService();
                    eventService.PublishMsg(msg);
                }
                catch (Exception)
                {
                    throw new Exception("RabbitMQ Error");
                }
            }
            catch (APIException ex)
            {
                throw ex;
            }

            return(rd);
        }
        public void AutoSetOrderNotPayCache()
        {
            foreach (var customer in _CustomerIDList)
            {
                _T_loggingSessionInfo.ClientID = customer.Key;
                _T_loggingSessionInfo.CurrentLoggingManager.Connection_String = customer.Value;

                //
                _T_InoutBLL    = new T_InoutBLL(_T_loggingSessionInfo);
                _Inout3Service = new InoutService(_T_loggingSessionInfo);
                var inoutStatus = new TInoutStatusBLL(_T_loggingSessionInfo);
                _VipBLL = new VipBLL(_T_loggingSessionInfo);

                //
                // var t_InoutList = new List<string>();
                try
                {
                    List <IWhereCondition> complexCondition = new List <IWhereCondition>();
                    string[] statusArr = { "620", "610", "600" };
                    complexCondition.Add(new InCondition <string>()
                    {
                        FieldName = "Field7", Values = statusArr
                    });
                    complexCondition.Add(
                        new DirectCondition(
                            " CONVERT(NVARCHAR(10),complete_date,120) = CONVERT(NVARCHAR(10),DATEADD(day, -1, GETDATE()),120)"));

                    var t_InoutEntitys = _T_InoutBLL.Query(complexCondition.ToArray(), null);
                    if (t_InoutEntitys == null || t_InoutEntitys.Count() <= 0)
                    {
                    }
                    //
                    //   roleList = roleEntities.Select(it => it.role_id).ToList();

                    foreach (var t_InoutInfo in t_InoutEntitys)
                    {
                        TInoutStatusEntity info = new TInoutStatusEntity();
                        info.InoutStatusID = Guid.Parse(Utils.NewGuid());
                        info.OrderID       = t_InoutInfo.order_id;
                        info.CustomerID    = _T_loggingSessionInfo.ClientID;
                        info.Remark        = string.Empty;
                        info.OrderStatus   = 700;

                        string statusDesc = GetStatusDesc("700");//变更后的状态名称

                        try
                        {
                            info.StatusRemark = "订单状态从" + t_InoutInfo.status_desc + "变为" + statusDesc + "[操作人:自动]";
                            _Inout3Service.UpdateOrderDeliveryStatus(t_InoutInfo.order_id, "700", Utils.GetNow());
                        }
                        catch
                        {
                            continue;
                        }

                        inoutStatus.Create(info);

                        #region 支付成功,调用RabbitMQ发送给ERP

                        try
                        {
                            var msg = new EventContract
                            {
                                Operation  = OptEnum.Update,
                                EntityType = EntityTypeEnum.Order,
                                Id         = t_InoutInfo.order_id
                            };
                            var eventService = new EventService();
                            eventService.PublishMsg(msg);
                        }
                        catch (Exception ex)
                        {
                            throw new Exception(ex.Message);
                        }

                        #endregion
                    }
                }
                catch
                {
                    // ignored
                }
            }
        }
Ejemplo n.º 26
0
 public EventServiceTests()
 {
     _eventService = new EventService(_eventDbContext, _applicationIdentityService);
 }
Ejemplo n.º 27
0
        static void Main(string[] args)
        {
            var eventService = new EventService(new ProfitCalculatorService());

            var eventName = "Paddy Power Cup Final";

            Console.WriteLine($"CreatingEvent {eventName}");
            var bettingEvent = EventBuilder.CreateEvent(eventName, Sport.Football);

            var marketName = "Outright result in normal time";

            var market1 = EventBuilder.CreateMarket(marketName);

            bettingEvent.WithMarket(market1);

            var team1Win = EventBuilder.CreateSelection(11, 4, true, 1, 0);

            market1.WithSelection(team1Win);
            var team2Win = EventBuilder.CreateSelection(13, 5, true, 0, 1);

            market1.WithSelection(team2Win);
            var draw = EventBuilder.CreateSelection(4, 6, true, 0, 0);

            market1.WithSelection(draw);

            var marketName2 = "Correct Score";

            var market2 = EventBuilder.CreateMarket(marketName2);

            bettingEvent.WithMarket(market2);

            var team1W1X0 = EventBuilder.CreateSelection(4, 9, false, 1, 0);

            market2.WithSelection(team1W1X0);
            var team1W2X0 = EventBuilder.CreateSelection(11, 2, false, 2, 0);

            market2.WithSelection(team1W2X0);
            var team1W2X1 = EventBuilder.CreateSelection(22, 1, false, 2, 1);

            market2.WithSelection(team1W2X1);
            var team1W3X0 = EventBuilder.CreateSelection(55, 1, false, 3, 0);

            market2.WithSelection(team1W3X0);
            var team1W3X1 = EventBuilder.CreateSelection(255, 1, false, 3, 1);

            market2.WithSelection(team1W3X1);
            var draw0X0 = EventBuilder.CreateSelection(9, 2, false, 0, 0);

            market2.WithSelection(draw0X0);
            var draw1X1 = EventBuilder.CreateSelection(175, 1, false, 1, 1);

            market2.WithSelection(draw1X1);
            var draw2x2 = EventBuilder.CreateSelection(225, 1, false, 2, 2);

            market2.WithSelection(draw2x2);
            var team2W1X0 = EventBuilder.CreateSelection(12, 1, false, 0, 1);

            market2.WithSelection(team2W1X0);
            var team2W2x0 = EventBuilder.CreateSelection(9, 2, false, 0, 2);

            market2.WithSelection(team2W2x0);
            var team2W2X1 = EventBuilder.CreateSelection(17, 1, false, 1, 2);

            market2.WithSelection(team2W2X1);
            var team2W3X0 = EventBuilder.CreateSelection(16, 5, false, 0, 3);

            market2.WithSelection(team2W3X0);
            var team2W3X1 = EventBuilder.CreateSelection(14, 1, false, 1, 3);

            market2.WithSelection(team2W3X1);


            var eventName1 = "L Harte v C Ryan tennis match";

            Console.WriteLine($"CreatingEvent {eventName}");

            var tennisBettingEvent = EventBuilder.CreateEvent(eventName1, Sport.Tennis);

            var tennisMarketName = "Match Betting market";
            var tennisMarket1    = EventBuilder.CreateMarket(tennisMarketName);

            tennisBettingEvent.WithMarket(tennisMarket1);

            var play1Win = EventBuilder.CreateSelection(9, 4, true, 1, 0);

            tennisMarket1.WithSelection(play1Win);
            var play2Win = EventBuilder.CreateSelection(3, 10, true, 0, 1);

            tennisMarket1.WithSelection(play2Win);

            tennisMarketName = "To win Set 2 1 st game";
            var tennisMarket2 = EventBuilder.CreateMarket(tennisMarketName);

            tennisBettingEvent.WithMarket(tennisMarket2);

            var play1WinGame1 = EventBuilder.CreateSelection(4, 7, false, 1, 0).
                                WithTennisWinningConditions(1, true, true, 2);

            tennisMarket2.WithSelection(play1WinGame1);
            var play2WinGame1 = EventBuilder.CreateSelection(5, 4, false, 0, 1).
                                WithTennisWinningConditions(1, true, false, 2);

            tennisMarket2.WithSelection(play2WinGame1);


            Console.WriteLine($"Registering Bets");

            bettingEvent.WithBet(EventBuilder.CreateBet(4m, team1Win));
            tennisBettingEvent.WithBet(EventBuilder.CreateBet(5m, play2WinGame1));
            tennisBettingEvent.WithBet(EventBuilder.CreateBet(5m, play2Win));
            bettingEvent.WithBet(EventBuilder.CreateBet(2m, team1W3X1));
            bettingEvent.WithBet(EventBuilder.CreateBet(1m, team2W1X0));
            tennisBettingEvent.WithBet(EventBuilder.CreateBet(5m, play1WinGame1));
            bettingEvent.WithBet(EventBuilder.CreateBet(2m, team1W3X1));
            bettingEvent.WithBet(EventBuilder.CreateBet(1m, team2W2X1));
            bettingEvent.WithBet(EventBuilder.CreateBet(4m, draw));
            bettingEvent.WithBet(EventBuilder.CreateBet(2m, team1Win));
            bettingEvent.WithBet(EventBuilder.CreateBet(10m, team1W2X0));
            tennisBettingEvent.WithBet(EventBuilder.CreateBet(6m, play2Win));
            bettingEvent.WithBet(EventBuilder.CreateBet(1m, team2Win));
            tennisBettingEvent.WithBet(EventBuilder.CreateBet(0.5m, play1Win));
            bettingEvent.WithBet(EventBuilder.CreateBet(2m, team1W2X0));
            bettingEvent.WithBet(EventBuilder.CreateBet(1m, team2Win));
            tennisBettingEvent.WithBet(EventBuilder.CreateBet(1m, play1WinGame1));
            bettingEvent.WithBet(EventBuilder.CreateBet(11m, team1W1X0));

            Console.WriteLine($"Results:");

            Console.WriteLine($"Clonskeagh 2 - 1 Tallaght");
            Console.WriteLine($"C Ryan beats L Harte outright");
            Console.WriteLine($"L Harte wins Set 2 1 st game");

            bettingEvent.WithScoreResults(2, 1);
            tennisBettingEvent.WithScoreResults(0, 3);
            tennisBettingEvent.WithGame(2, 1, true);

            var total1 = 0m;
            var total2 = 0m;

            total1 = eventService.CalculateEventProfitAsync(bettingEvent).Result;

            total2 = eventService.CalculateEventProfitAsync(tennisBettingEvent).Result;


            Console.WriteLine($"Calculating profit:");
            Console.WriteLine(total1);
            Console.WriteLine(total2);

            Console.WriteLine($"Balance: {total1 + total2}");
            Console.ReadKey();
        }
Ejemplo n.º 28
0
 public ShoppingService(ShoppingContext db, EventService events)
 {
     _db     = db;
     _events = events;
 }
Ejemplo n.º 29
0
 protected Task Update(Entity add)
 {
     return(EventService.Raise(new PersistenceEvent(add, PersistenceAction.Update)));
 }
 public EventsController(EventService eventService)
 {
     _eventService = eventService;
 }
Ejemplo n.º 31
0
 public void SetEventService(EventService eventService)
 {
     this.eventService = eventService;
 }
        public static void Init(string customUserAgent           = null, string clearCipherCacheKey = null,
                                string[] allClearCipherCacheKeys = null)
        {
            if (Inited)
            {
                return;
            }
            Inited = true;

            var           platformUtilsService   = Resolve <IPlatformUtilsService>("platformUtilsService");
            var           storageService         = Resolve <IStorageService>("storageService");
            var           secureStorageService   = Resolve <IStorageService>("secureStorageService");
            var           cryptoPrimitiveService = Resolve <ICryptoPrimitiveService>("cryptoPrimitiveService");
            var           i18nService            = Resolve <II18nService>("i18nService");
            var           messagingService       = Resolve <IMessagingService>("messagingService");
            SearchService searchService          = null;

            var stateService          = new StateService();
            var cryptoFunctionService = new PclCryptoFunctionService(cryptoPrimitiveService);
            var cryptoService         = new CryptoService(storageService, secureStorageService, cryptoFunctionService);
            var tokenService          = new TokenService(storageService);
            var apiService            = new ApiService(tokenService, platformUtilsService, (bool expired) =>
            {
                messagingService.Send("logout", expired);
                return(Task.FromResult(0));
            }, customUserAgent);
            var appIdService    = new AppIdService(storageService);
            var userService     = new UserService(storageService, tokenService);
            var settingsService = new SettingsService(userService, storageService);
            var cipherService   = new CipherService(cryptoService, userService, settingsService, apiService,
                                                    storageService, i18nService, () => searchService, clearCipherCacheKey, allClearCipherCacheKeys);
            var folderService = new FolderService(cryptoService, userService, apiService, storageService,
                                                  i18nService, cipherService);
            var collectionService = new CollectionService(cryptoService, userService, storageService, i18nService);
            var sendService       = new SendService(cryptoService, userService, apiService, storageService, i18nService,
                                                    cryptoFunctionService);

            searchService = new SearchService(cipherService, sendService);
            var vaultTimeoutService = new VaultTimeoutService(cryptoService, userService, platformUtilsService,
                                                              storageService, folderService, cipherService, collectionService, searchService, messagingService, tokenService,
                                                              null, (expired) =>
            {
                messagingService.Send("logout", expired);
                return(Task.FromResult(0));
            });
            var policyService = new PolicyService(storageService, userService);
            var syncService   = new SyncService(userService, apiService, settingsService, folderService,
                                                cipherService, cryptoService, collectionService, storageService, messagingService, policyService, sendService,
                                                (bool expired) =>
            {
                messagingService.Send("logout", expired);
                return(Task.FromResult(0));
            });
            var passwordGenerationService = new PasswordGenerationService(cryptoService, storageService,
                                                                          cryptoFunctionService, policyService);
            var totpService = new TotpService(storageService, cryptoFunctionService);
            var authService = new AuthService(cryptoService, apiService, userService, tokenService, appIdService,
                                              i18nService, platformUtilsService, messagingService, vaultTimeoutService);
            var exportService      = new ExportService(folderService, cipherService);
            var auditService       = new AuditService(cryptoFunctionService, apiService);
            var environmentService = new EnvironmentService(apiService, storageService);
            var eventService       = new EventService(storageService, apiService, userService, cipherService);

            Register <IStateService>("stateService", stateService);
            Register <ICryptoFunctionService>("cryptoFunctionService", cryptoFunctionService);
            Register <ICryptoService>("cryptoService", cryptoService);
            Register <ITokenService>("tokenService", tokenService);
            Register <IApiService>("apiService", apiService);
            Register <IAppIdService>("appIdService", appIdService);
            Register <IUserService>("userService", userService);
            Register <ISettingsService>("settingsService", settingsService);
            Register <ICipherService>("cipherService", cipherService);
            Register <IFolderService>("folderService", folderService);
            Register <ICollectionService>("collectionService", collectionService);
            Register <ISendService>("sendService", sendService);
            Register <ISearchService>("searchService", searchService);
            Register <IPolicyService>("policyService", policyService);
            Register <ISyncService>("syncService", syncService);
            Register <IVaultTimeoutService>("vaultTimeoutService", vaultTimeoutService);
            Register <IPasswordGenerationService>("passwordGenerationService", passwordGenerationService);
            Register <ITotpService>("totpService", totpService);
            Register <IAuthService>("authService", authService);
            Register <IExportService>("exportService", exportService);
            Register <IAuditService>("auditService", auditService);
            Register <IEnvironmentService>("environmentService", environmentService);
            Register <IEventService>("eventService", eventService);
        }
Ejemplo n.º 33
0
 void addListener(EventService eventService)
 {
     eventService.AddListener<InfoBoxShowEvent>(onInfoBoxShowEvent);
 }
Ejemplo n.º 34
0
 public EditEventCommand(EventService eventService)
 {
     this.eventService = eventService;
 }
Ejemplo n.º 35
0
 public ShipService(ITimeService timeService, EventService eventService)
 {
     this.timeService = timeService;
     this.eventService = eventService;
 }
Ejemplo n.º 36
0
 internal static void InitializeMasterProcess()
 {
     EventService.On(nameof(EventType.UmpIndexingStarted), ReportUMPEProgress);
     EventService.On(nameof(EventType.UmpIndexingProgress), ReportUMPEProgress);
     EventService.On(nameof(EventType.UmpIndexingFinished), ReportUMPEProgress);
 }
 public override void OnInit()
 {
     EventService.AddTypeEvent <PlayerSelectCharacter_s>(ReceviceSelectCharacter);
 }
Ejemplo n.º 38
0
 private static void EmitEvent(EventType type, object[] args = null)
 {
     EventService.Emit(type.ToString(), args);
     EventService.Tick();
 }
Ejemplo n.º 39
0
 public void OnStateLeave()
 {
     JW.Common.Log.LogD("Leave Update GameState");
     EventService.GetInstance().RemoveEventHandler(this);
 }
 public EventEndpointTests()
 {
     _eventService = new EventService(Configuration);
 }
 public EventServiceTest()
 {
     _baseContext  = new BaseContext();
     _context      = new CentralErrosContext(_baseContext.Options);
     _eventService = new EventService(_context);
 }
Ejemplo n.º 42
0
        public ActionResult Authenticate(string accesstoken, string eventkey, int referralid = 0)
        {
            var eventid = EventService.GetEventByKey(eventkey).EventId;
            var client  = new RestClient("https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,profilePicture(displayImage~digitalmediaAsset:playableStreams))");
            var request = new RestRequest(Method.GET);

            request.AddHeader("cache-control", "no-cache");
            request.AddHeader("Connection", "keep-alive");
            request.AddHeader("Accept-Encoding", "gzip, deflate");
            request.AddHeader("Host", "api.linkedin.com");
            request.AddHeader("Postman-Token", "0b77a8dc-8ae0-4dc4-97f2-48d965518224,d4177a7d-8d60-4145-bee8-b63f4987d2d9");
            request.AddHeader("Cache-Control", "no-cache");
            request.AddHeader("Accept", "*/*");
            request.AddHeader("User-Agent", "PostmanRuntime/7.15.2");
            request.AddHeader("Authorization", "Bearer " + accesstoken);
            request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
            IRestResponse response = client.Execute(request);


            var client1  = new RestClient("https://api.linkedin.com/v2/emailAddress?q=members&projection=%28elements%2A%28handle~%29%29");
            var request1 = new RestRequest(Method.GET);

            request1.AddHeader("cache-control", "no-cache");
            request1.AddHeader("Connection", "keep-alive");
            request1.AddHeader("Accept-Encoding", "gzip, deflate");
            request1.AddHeader("Host", "api.linkedin.com");
            request1.AddHeader("Postman-Token", "ee43f094-9f10-419f-b99b-fd77245a0702,b68b518c-60fd-4ebf-8b61-f8f2b97ea23f");
            request1.AddHeader("Cache-Control", "no-cache");
            request1.AddHeader("Accept", "*/*");
            request1.AddHeader("User-Agent", "PostmanRuntime/7.15.2");
            request1.AddHeader("Authorization", "Bearer " + accesstoken);
            request1.AddHeader("Content-Type", "application/x-www-form-urlencoded");
            IRestResponse response1 = client1.Execute(request1);

            var exists = false;

            //IRestResponse response = client.Execute(request);
            if (response.StatusCode == System.Net.HttpStatusCode.OK)
            {
                var profile       = JsonConvert.DeserializeObject <ProfileNew.RootObject>(response.Content);
                var emailresponse = JsonConvert.DeserializeObject <EmailResponse.RootObject>(response1.Content);
                //ShareOnWall(profile.Id, accesstoken);
                int            userid         = 0;
                string         email          = "";
                RegisteredUser registeredUser = new RegisteredUser();
                try
                {
                    email = emailresponse.elements[0].handle.emailAddress;
                }
                catch
                {
                }
                if (email != "")
                {
                    var matchuser = db.RegisteredUsers.Where(x => x.Email == email && x.EventId == eventid).ToList();
                    if (matchuser.Count > 0)
                    {
                        exists = true;
                        userid = matchuser.FirstOrDefault().UserId;
                    }
                    else
                    {
                        registeredUser.EventId            = eventid;
                        registeredUser.FirstName          = profile.firstName.localized.en_US;
                        registeredUser.LastName           = profile.lastName.localized.en_US;
                        registeredUser.Email              = email;
                        registeredUser.Country            = "";
                        registeredUser.DateOfRegistration = DateTime.Now;
                        registeredUser.IsDeleted          = false;
                        registeredUser.IsRegistered       = false;
                        registeredUser.ProfileImage       = profile.profilePicture.displayImage.elements.FirstOrDefault().identifiers.FirstOrDefault().identifier;
                        registeredUser.ProfileLink        = profile.id;
                        registeredUser.ProfileId          = profile.id;
                        registeredUser.AuthToken          = accesstoken;
                        registeredUser.ReferalId          = referralid;
                        registeredUser.Source             = "linkedin";
                        var allowuser = db.Packages.Select(x => x.No_of_Registration).FirstOrDefault();
                        var reguser   = db.RegisteredUsers.Where(x => x.EventId == eventid && x.Ispaid == true).Count();

                        //if (allowuser > reguser)
                        //{
                        //    registeredUser.Ispaid = true;
                        //}
                        //else
                        //{
                        registeredUser.Ispaid = false;
                        //}
                        db.RegisteredUsers.Add(registeredUser);
                        db.SaveChanges();

                        userid = registeredUser.UserId;
                    }
                    var eventurl     = db.EventMasters.Find(eventid);
                    var adminsetting = AdminService.GetAdminSetting();
                    var utmsource    = adminsetting.Utm_Source;
                    var utmmedium    = adminsetting.Utm_Medium;
                    var utmcampaign  = eventid;
                    var utmcontent   = referralid;
                    var utmterm      = adminsetting.Utm_Term;
                    return(Json(new { eventurl = eventurl.ResponseURL + "?&eid=" + eventkey + "&r=" + referralid + "&userid=" + userid + "&exists=" + exists + "&accesstoken=" + accesstoken + "&profileid=" + profile.id + "&utm_source=" + utmsource + "&utm_medium=" + utmmedium + "&utm_campaign=" + utmcampaign + "&utm_content=" + utmcontent + "&utm_term=" + utmterm }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { eventurl = "", data = response.Content, error = response.ErrorMessage, ex = response.ErrorException }, JsonRequestBehavior.AllowGet));
                }
            }
            return(Json(new { eventurl = "", data = response.Content, error = response.ErrorMessage, ex = response.ErrorException }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 43
0
 public GamerService(EventService eventService)
 {
     this.eventService = eventService;
     model = Utils.Deserialize<GamerModel>();
 }
Ejemplo n.º 44
0
        public static void Init()
        {
            if (Inited)
            {
                return;
            }
            Inited = true;

            var           platformUtilsService   = Resolve <IPlatformUtilsService>("platformUtilsService");
            var           storageService         = Resolve <IStorageService>("storageService");
            var           secureStorageService   = Resolve <IStorageService>("secureStorageService");
            var           cryptoPrimitiveService = Resolve <ICryptoPrimitiveService>("cryptoPrimitiveService");
            var           i18nService            = Resolve <II18nService>("i18nService");
            var           messagingService       = Resolve <IMessagingService>("messagingService");
            SearchService searchService          = null;

            var stateService          = new StateService();
            var cryptoFunctionService = new PclCryptoFunctionService(cryptoPrimitiveService);
            var cryptoService         = new CryptoService(storageService, secureStorageService, cryptoFunctionService);
            var tokenService          = new TokenService(storageService);
            var apiService            = new ApiService(tokenService, platformUtilsService, (bool expired) => Task.FromResult(0));
            var appIdService          = new AppIdService(storageService);
            var userService           = new UserService(storageService, tokenService);
            var settingsService       = new SettingsService(userService, storageService);
            var cipherService         = new CipherService(cryptoService, userService, settingsService, apiService,
                                                          storageService, i18nService, () => searchService);
            var folderService = new FolderService(cryptoService, userService, apiService, storageService,
                                                  i18nService, cipherService);
            var collectionService = new CollectionService(cryptoService, userService, storageService, i18nService);

            searchService = new SearchService(cipherService);
            var lockService = new LockService(cryptoService, userService, platformUtilsService, storageService,
                                              folderService, cipherService, collectionService, searchService, messagingService, null);
            var syncService = new SyncService(userService, apiService, settingsService, folderService,
                                              cipherService, cryptoService, collectionService, storageService, messagingService,
                                              () => messagingService.Send("logout"));
            var passwordGenerationService = new PasswordGenerationService(cryptoService, storageService,
                                                                          cryptoFunctionService);
            var totpService = new TotpService(storageService, cryptoFunctionService);
            var authService = new AuthService(cryptoService, apiService, userService, tokenService, appIdService,
                                              i18nService, platformUtilsService, messagingService);
            // TODO: export service
            var auditService       = new AuditService(cryptoFunctionService, apiService);
            var environmentService = new EnvironmentService(apiService, storageService);
            var eventService       = new EventService(storageService, apiService, userService, cipherService);

            Register <IStateService>("stateService", stateService);
            Register <ICryptoFunctionService>("cryptoFunctionService", cryptoFunctionService);
            Register <ICryptoService>("cryptoService", cryptoService);
            Register <ITokenService>("tokenService", tokenService);
            Register <IApiService>("apiService", apiService);
            Register <IAppIdService>("appIdService", appIdService);
            Register <IUserService>("userService", userService);
            Register <ISettingsService>("settingsService", settingsService);
            Register <ICipherService>("cipherService", cipherService);
            Register <IFolderService>("folderService", folderService);
            Register <ICollectionService>("collectionService", collectionService);
            Register <ISearchService>("searchService", searchService);
            Register <ISyncService>("syncService", syncService);
            Register <ILockService>("lockService", lockService);
            Register <IPasswordGenerationService>("passwordGenerationService", passwordGenerationService);
            Register <ITotpService>("totpService", totpService);
            Register <IAuthService>("authService", authService);
            Register <IAuditService>("auditService", auditService);
            Register <IEnvironmentService>("environmentService", environmentService);
            Register <IEventService>("eventService", eventService);
        }
Ejemplo n.º 45
0
 public void SetBaseServices(IUIFactoryService uiFactoryService, EventService eventService, ITranslationService translationService)
 {
     this.uiFactoryService = uiFactoryService;
     this.eventService = eventService;
     this.translationService = translationService;
 }
Ejemplo n.º 46
0
 private void initializeDatabase()
 {
     userService  = new MockUserService(this);
     eventService = new MockEventService(this);
 }
Ejemplo n.º 47
0
        public bool EpiloggerStatus()
        {
            //First test if SQL is responding
            try
            {
                var ecount = new EventService().Count();
                if (ecount == 0) return false;
            }
            catch
            {
                return false;
            }

            //Test we can pull up an EPL webpage.
            try
            {
                using (var client = new WebClient())
                {
                    var result = client.DownloadString("http://epilogger.com/home/webstatus");
                    if (result.IndexOf("Epilogger is Up", System.StringComparison.Ordinal) == 0) return false;
                }
            }
            catch
            {
                return false;
            }

            //All is good
            return true;
        }
Ejemplo n.º 48
0
 public BackupService(EventService eventService, BackupRepository backupRepository)
 {
     this.eventService     = eventService;
     this.backupRepository = backupRepository;
 }
Ejemplo n.º 49
0
        public virtual ActionResult SocialBar(int eventid, int photoid)
        {
            var es = new EventService();
            var imgs = new ImageService();
            var ts = new TweetService();

            var model = new PhotoDetailsViewModel();
            var theEvent = es.FindByID(eventid);
            if (theEvent != null)
            {
                model.EventId = eventid;
                model.EventSlug = theEvent.EventSlug;
                model.Image = imgs.FindByID(photoid);
                model.Tweets = ts.FindByImageID(photoid, eventid);
                model.Event = theEvent;
                model.HashTag =
                    theEvent.SearchTerms.Split(new string[] { " OR " }, StringSplitOptions.None)[0].Contains("#")
                        ? theEvent.SearchTerms.Split(new string[] { " OR " }, StringSplitOptions.None)[0]
                        : "#" + theEvent.SearchTerms.Split(new string[] { " OR " }, StringSplitOptions.None)[0];
            }

            var apiClient = new Epilogr.APISoapClient();
            model.ShortURL = apiClient.CreateUrl("http://epilogger.com/events/PhotoDetails/" + eventid + "/" + photoid).ShortenedUrl;


            return PartialView(model);
        }
Ejemplo n.º 50
0
 static void OnProfilerWindowRecordingStateChanged(bool recording)
 {
     EventService.Emit(nameof(EventType.UmpProfilerRecordingStateChanged), new object[] { recording, ProfilerDriver.profileEditor });
     EditorApplication.delayCall += EditorApplication.UpdateMainWindowTitle;
 }
Ejemplo n.º 51
0
 public InfoService(IViewService viewService, IUIFactoryService uiFactoryService, EventService eventService)
 {
     createInfoGameObject(viewService, uiFactoryService);
     addListener(eventService);
 }
Ejemplo n.º 52
0
 static void OnProfilerWindowMemoryRecordModeChanged(ProfilerMemoryRecordMode memRecordMode)
 {
     EventService.Emit(nameof(EventType.UmpProfilerMemRecordModeChanged), (int)memRecordMode);
 }
Ejemplo n.º 53
0
        private void ws_OnMessage(object obj, MessageEventArgs args)
        {
            if (args.Data == "\n")
            {
                try
                {
                    this.ws.Send("\n");
                    this.throwMessage("PONG");
                }
                catch (Exception)
                {
                    this.connected = false;
                }
            }
            else
            {
                this.throwMessage(string.Format("Message from Server: {0}", args.Data));
                if (args.Data.IndexOf("RECEIPT") >= 0)
                {
                    this.subScribeSuccessed = true;
                    this.throwMessage("Subscribe successed.");
                }
                if (args.Data.IndexOf("LOT_JUDGEMENT") >= 0)
                {
                    //»ØÖ´id
                    string ackid    = args.Data.Substring(args.Data.IndexOf("ack:") + 4, args.Data.IndexOf("subscription:") - 5 - args.Data.IndexOf("ack:"));
                    int    index    = args.Data.IndexOf("{\"LOT_JUDGEMENT");
                    string jsonStr  = args.Data.Substring(index, (args.Data.Length - index) - 1);
                    string fileName = string.Format(@"{0}\{1}_{2}.json", this.configuration.MessageInDirectory, DateTime.Now.ToString("yyyyMMddHHmmss"), Guid.NewGuid().ToString());
                    EventService.AppendToLogFileToAbsFile(fileName, args.Data);
                    IList <string> messages = new List <string>();
                    Lot            lot      = new Lot();
                    DbOperation    dbops    = new DbOperation();
                    try
                    {
                        //lot = LotService.ReadLotFromJson(this.configuration.OSATID, jsonStr, messages);
                        //foreach (string str3 in messages)
                        //{
                        //    this.throwMessage(str3);
                        //}
                        //LotService.SaveLotAndInformQA_AND_PE(lot);

                        string insertLogSQL = @"INSERT INTO [dbo].[LOTSImportLogs]
                                                   ([FilePath]
                                                   ,[CreateTime]
                                                   ,[FormatStatus]
                                                   ,[osatID],[Type])
                                                    VALUES
                                                   ('{0}'
                                                   ,GETDATE()
                                                   ,'Pending'
                                                   ,'{1}'
                                                   ,'{2}')";
                        dbops.ExecuteNonQuery(string.Format(insertLogSQL, fileName, this.configuration.OSATID, this.configuration.Type));
                        //·¢ËÍ»ØÖ´id
                        if (!string.IsNullOrEmpty(ackid))
                        {
                            string ackData = "ACK\nid:" + ackid + "\n\n\0";
                            this.ws.Send(ackData);
                            this.throwMessage(ackData);
                        }
                    }
                    catch (Exception)
                    {
                        this.throwMessage(string.Format("LOT_JUDGEMENT process failed. filename is {0}", fileName));
                        foreach (string str4 in messages)
                        {
                            this.throwMessage(str4);
                        }

                        try
                        {
                            string insertSQL    = @"INSERT INTO [dbo].[EMAILS]
                                                   ([EmailID]
                                                   ,[Sender]
                                                   ,[Recipients]
                                                   ,[Subject]
                                                   ,[Body]
                                                   ,[Priority]
                                                   ,[State]
                                                   ,[NextTryTime]
                                                   ,[TryTime])
                                             VALUES
                                                   (NEWID()
                                                   ,'*****@*****.**'
                                                   ,'*****@*****.**'
                                                   ,'{0}'
                                                   ,'{1}'
                                                   ,0
                                                   ,'Unsend'
                                                   ,'{2}'
                                                   ,10)
                                        ";
                            string insertLogSQL = @"INSERT INTO [dbo].[LOTSImportLogs]
                                                   ([FilePath]
                                                   ,[CreateTime]
                                                   ,[FormatStatus]
                                                   ,[osatID],[Type])
                                                    VALUES
                                                   ('{0}'
                                                   ,GETDATE()
                                                   ,'Pending'
                                                   ,'{1},'{2}')";

                            dbops.ExecuteNonQuery(string.Format(insertSQL, this.configuration.OSATID + " Import lot judgement failed-" + lot.AutoJudgeResult + '-' + lot.SubconLot, this.configuration.OSATID + " Import lot judgement failed, filename is:" + fileName, DateTime.Now.AddSeconds(30.0)));
                            dbops.ExecuteNonQuery(string.Format(insertLogSQL, fileName, this.configuration.OSATID, this.configuration.Type));
                        }
                        catch (Exception ex)
                        {
                            this.throwMessage("Send failed mail error:" + ex.Message);
                        }
                    }
                }
            }
        }
Ejemplo n.º 54
0
        public ActionResult OldPost(string signature, string timestamp, string nonce, string echostr)
        {
            LocationService locationService = new LocationService();
            EventService    eventService    = new EventService();

            if (!CheckSignature.Check(signature, timestamp, nonce, Token))
            {
                return(Content("参数错误!"));
            }
            XDocument requestDoc = null;

            try
            {
                requestDoc = XDocument.Load(Request.Body);

                var requestMessage = RequestMessageFactory.GetRequestEntity(new DefaultMpMessageContext(), requestDoc);
                //如果不需要记录requestDoc,只需要:
                //var requestMessage = RequestMessageFactory.GetRequestEntity(Request.InputStream);

                requestDoc.Save(ServerUtility.ContentRootMapPath("~/App_Data/" + SystemTime.Now.Ticks + "_Request_" + requestMessage.FromUserName + ".txt"));//测试时可开启,帮助跟踪数据
                ResponseMessageBase responseMessage = null;
                switch (requestMessage.MsgType)
                {
                case RequestMsgType.Text:    //文字
                {
                    //TODO:交给Service处理具体信息,参考/Service/EventSercice.cs 及 /Service/LocationSercice.cs
                    var strongRequestMessage  = requestMessage as RequestMessageText;
                    var strongresponseMessage =
                        ResponseMessageBase.CreateFromRequestMessage <ResponseMessageText>(requestMessage);
                    strongresponseMessage.Content =
                        string.Format(
                            "您刚才发送了文字信息:{0}\r\n您还可以发送【位置】【图片】【语音】等类型的信息,查看不同格式的回复。\r\nSDK官方地址:http://sdk.weixin.senparc.com",
                            strongRequestMessage.Content);
                    responseMessage = strongresponseMessage;
                    break;
                }

                case RequestMsgType.Location:    //位置
                {
                    responseMessage = locationService.GetResponseMessage(requestMessage as RequestMessageLocation);
                    break;
                }

                case RequestMsgType.Image:    //图片
                {
                    //TODO:交给Service处理具体信息
                    var strongRequestMessage  = requestMessage as RequestMessageImage;
                    var strongresponseMessage =
                        ResponseMessageBase.CreateFromRequestMessage <ResponseMessageNews>(requestMessage);
                    strongresponseMessage.Articles.Add(new Article()
                        {
                            Title       = "您刚才发送了图片信息",
                            Description = "您发送的图片将会显示在边上",
                            PicUrl      = strongRequestMessage.PicUrl,
                            Url         = "http://sdk.weixin.senparc.com"
                        });
                    strongresponseMessage.Articles.Add(new Article()
                        {
                            Title       = "第二条",
                            Description = "第二条带连接的内容",
                            PicUrl      = strongRequestMessage.PicUrl,
                            Url         = "http://sdk.weixin.senparc.com"
                        });
                    responseMessage = strongresponseMessage;
                    break;
                }

                case RequestMsgType.Voice:    //语音
                {
                    //TODO:交给Service处理具体信息
                    var strongRequestMessage  = requestMessage as RequestMessageVoice;
                    var strongresponseMessage =
                        ResponseMessageBase.CreateFromRequestMessage <ResponseMessageMusic>(requestMessage);
                    strongresponseMessage.Music.MusicUrl = "http://sdk.weixin.senparc.com/Content/music1.mp3";
                    responseMessage = strongresponseMessage;
                    break;
                }

                case RequestMsgType.Event:    //事件
                {
                    responseMessage = eventService.GetResponseMessage(requestMessage as RequestMessageEventBase);
                    break;
                }

                default:
                    throw new ArgumentOutOfRangeException();
                }
                var responseDoc = Senparc.NeuChar.Helpers.EntityHelper.ConvertEntityToXml(responseMessage);
                responseDoc.Save(ServerUtility.ContentRootMapPath("~/App_Data/" + SystemTime.Now.Ticks + "_Response_" + responseMessage.ToUserName + ".txt"));//测试时可开启,帮助跟踪数据

                return(Content(responseDoc.ToString()));
                //如果不需要记录responseDoc,只需要:
                //return Content(responseMessage.ConvertEntityToXmlString());
            }
            catch (Exception ex)
            {
                using (
                    TextWriter tw = new StreamWriter(ServerUtility.ContentRootMapPath("~/App_Data/Error_" + SystemTime.Now.Ticks + ".txt")))
                {
                    tw.WriteLine(ex.Message);
                    tw.WriteLine(ex.InnerException.Message);
                    if (requestDoc != null)
                    {
                        tw.WriteLine(requestDoc.ToString());
                    }
                    tw.Flush();
                    tw.Close();
                }
                return(Content(""));
            }
        }
Ejemplo n.º 55
0
 void addViewShowHiddenListeners(EventService eventService)
 {
     eventService.AddListener<ViewShownEvent>(onViewShown);
     eventService.AddListener<ViewHiddenEvent>(onViewHidden);
 }
Ejemplo n.º 56
0
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>   Events controller. </summary>
 /// <remarks>   Andre Beging, 18.06.2018. </remarks>
 /// <param name="eventService"> The service. </param>
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 public EventController(EventService eventService)
 {
     _eventService = eventService;
 }
Ejemplo n.º 57
0
        public ActionResult GetFBProfile(string accesstoken, int eventid, int referralid = 0)
        {
            var eventdetail = EventService.GetEventById(eventid);
            var client      = new RestClient("https://graph.facebook.com/me");
            var request     = new RestRequest(Method.POST);

            request.AddHeader("cache-control", "no-cache");
            request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
            request.AddParameter("undefined", "fields=id,name,email,picture&access_token=" + accesstoken, ParameterType.RequestBody);
            IRestResponse response = client.Execute(request);

            int            userid         = 0;
            var            exists         = false;
            RegisteredUser registeredUser = new RegisteredUser();

            if (response.StatusCode == System.Net.HttpStatusCode.OK)
            {
                var profile = JsonConvert.DeserializeObject <FacebookModel>(response.Content);
                if (profile != null)
                {
                    var matchuser = db.RegisteredUsers.Where(x => x.Email == profile.email && x.EventId == eventid).ToList();
                    if (matchuser.Count > 0)
                    {
                        exists = true;
                        userid = matchuser.FirstOrDefault().UserId;
                    }
                    else
                    {
                        registeredUser.EventId = eventid;
                        if (profile.name != null)
                        {
                            if (profile.name.Split(' ').Length > 0)
                            {
                                registeredUser.FirstName = profile.name.Split(' ')[0];
                                registeredUser.LastName  = profile.name.Split(' ')[1];
                            }
                        }
                        registeredUser.Email              = profile.email;
                        registeredUser.Country            = "";
                        registeredUser.DateOfRegistration = DateTime.Now;
                        registeredUser.IsDeleted          = false;
                        registeredUser.IsRegistered       = false;
                        registeredUser.ProfileImage       = profile.picture.data.url;
                        registeredUser.ProfileLink        = profile.id;
                        registeredUser.ProfileId          = profile.id;
                        registeredUser.AuthToken          = accesstoken;
                        registeredUser.ReferalId          = referralid;
                        registeredUser.Source             = "facebook";
                        var allowuser = db.Packages.Select(x => x.No_of_Registration).FirstOrDefault();
                        var reguser   = db.RegisteredUsers.Where(x => x.EventId == eventid && x.Ispaid == true).Count();

                        //if (allowuser > reguser)
                        //{
                        //    registeredUser.Ispaid = true;
                        //}
                        //else
                        //{
                        registeredUser.Ispaid = false;
                        //}
                        db.RegisteredUsers.Add(registeredUser);
                        db.SaveChanges();

                        userid = registeredUser.UserId;
                    }
                    var eventurl     = db.EventMasters.Find(eventid);
                    var adminsetting = AdminService.GetAdminSetting();
                    var utmsource    = adminsetting.Utm_Source;
                    var utmmedium    = adminsetting.Utm_Medium;
                    var utmcampaign  = eventid;
                    var utmcontent   = referralid;
                    var utmterm      = adminsetting.Utm_Term;
                    return(Json(new { eventurl = eventurl.ResponseURL + "?&eid=" + eventdetail.EventKey + "&r=" + referralid + "&userid=" + userid + "&exists=" + exists + "&accesstoken=" + accesstoken + "&profileid=" + profile.id + "&utm_source=" + utmsource + "&utm_medium=" + utmmedium + "&utm_campaign=" + utmcampaign + "&utm_content=" + utmcontent + "&utm_term=" + utmterm }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { eventurl = "", data = response.Content, error = response.ErrorMessage, ex = response.ErrorException }, JsonRequestBehavior.AllowGet));
                }
            }
            return(Json(new { eventurl = "", data = response.Content, error = response.ErrorMessage, ex = response.ErrorException }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 58
0
 public CategoriesController(EventService eventService, IMapper mapper, ILogger <CategoriesController> logger)
 {
     _eventService = eventService;
     _mapper       = mapper;
     _logger       = logger;
 }
Ejemplo n.º 59
0
 public ShopService(ICurrencyService currencyService, EventService eventService, IAPService iapService)
 {
     this.currencyService = currencyService;
     this.eventService = eventService;
     this.iapService = iapService;
 }
Ejemplo n.º 60
0
        public ActionResult UpdateUserFromCRM(int UserId, string firstname, string lastname, string emailid, string companyname, string jobtitle, string phone, string crmregid, string allowpost,
                                              string senioritylevel, string primaryjob, string natureofbusiness, string country, string topicofinterest, string registeredforglobal,
                                              bool checkbox1, bool checkbox2, bool checkbox3, bool checkbox4, bool iszoomevent, bool isbigmarkerevent)
        {
            try
            {
                var registeredUser = db.RegisteredUsers.Find(UserId);
                registeredUser.CRM_FirstName      = firstname;
                registeredUser.CRM_LastName       = lastname;
                registeredUser.CRM_EmaiId         = emailid;
                registeredUser.CRM_CompanyName    = companyname;
                registeredUser.CRM_JobTitle       = jobtitle;
                registeredUser.CRM_RegistrationId = crmregid;
                registeredUser.IsDeleted          = false;
                registeredUser.IsRegistered       = true;
                db.Entry(registeredUser).State    = EntityState.Modified;
                var allowuser        = db.Packages.Select(x => x.No_of_Registration).FirstOrDefault();
                var reguser          = db.RegisteredUsers.Where(x => x.EventId == registeredUser.EventId && x.Ispaid == true).Count();
                var events           = EventService.GetEventById(Convert.ToInt32(registeredUser.EventId));
                var availablecredits = CustomerService.GetCustomerAvailableCredit(events.CustomerId);
                if (availablecredits > 0)
                {
                    registeredUser.Ispaid = true;
                }
                else
                {
                    registeredUser.Ispaid = false;
                }
                db.SaveChanges();


                if (allowpost == "true" || allowpost == null || allowpost == "undefined")
                {
                    ShareOnWall(Convert.ToInt32(registeredUser.EventId), registeredUser.ProfileId, registeredUser.AuthToken, registeredUser.UserId);
                }

                if (iszoomevent)
                {
                    db.AddZoomUserDetails(0, registeredUser.EventId, registeredUser.UserId, senioritylevel, primaryjob, natureofbusiness, country,
                                          topicofinterest, registeredforglobal, checkbox1, checkbox2, checkbox3, checkbox4, null, null);

                    var zoomtoken = db.SpGetEventToken(events.EventId);
                    try
                    {
                        if (zoomtoken != null)
                        {
                            ZoomModel objZoomModel = new ZoomModel();
                            objZoomModel.id    = events.WebinarId;
                            objZoomModel.token = zoomtoken.FirstOrDefault();
                            objZoomModel.payload.first_name = registeredUser.FirstName;
                            objZoomModel.payload.last_name  = registeredUser.LastName;
                            objZoomModel.payload.email      = registeredUser.Email;
                            objZoomModel.payload.org        = registeredUser.Company;
                            objZoomModel.payload.phone      = phone;
                            objZoomModel.payload.country    = country;
                            var jsonbody = JsonConvert.SerializeObject(objZoomModel);
                            var client   = new RestClient("https://connect-zoom.eventnx.com/api/webinar/register");
                            client.Timeout = -1;
                            var request = new RestRequest(Method.PUT);
                            request.AddHeader("Content-Type", "application/json");
                            request.AddParameter("application/json", jsonbody, ParameterType.RequestBody);
                            IRestResponse <ZoomResponse> response = client.Execute <ZoomResponse>(request);
                            var zoomresponse = response.Data;
                            if (zoomresponse.token != null)
                            {
                                EventService.UpdateZoomTokenEvent(zoomresponse.token, events.CustomerId);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }

                if (isbigmarkerevent)
                {
                    db.AddBigMarkerUserDetails(0, registeredUser.EventId, registeredUser.UserId, senioritylevel, primaryjob, natureofbusiness, country,
                                               topicofinterest, registeredforglobal, checkbox1, checkbox2, checkbox3, checkbox4, null, null);

                    var zoomtoken = db.SpGetBigMarkerEventToken(events.EventId);
                    try
                    {
                        if (zoomtoken != null)
                        {
                            BigMarkerRequest bigMarkerModel = new BigMarkerRequest();
                            bigMarkerModel.Id                    = events.BigMarkerWebinairId;
                            bigMarkerModel.Token                 = zoomtoken.FirstOrDefault();
                            bigMarkerModel.Payload.FirstName     = registeredUser.FirstName;
                            bigMarkerModel.Payload.LastName      = registeredUser.LastName;
                            bigMarkerModel.Payload.Email         = registeredUser.Email;
                            bigMarkerModel.Payload.CustomFields  = "";
                            bigMarkerModel.Payload.UtmBmcrSource = registeredUser.Source;
                            bigMarkerModel.Payload.CustomUserId  = registeredUser.UserId.ToString();
                            var jsonbody = JsonConvert.SerializeObject(bigMarkerModel);
                            var client   = new RestClient("https://connect-zoom.eventnx.com/api/bigmarker/register");
                            client.Timeout = -1;
                            var request = new RestRequest(Method.PUT);
                            request.AddHeader("Content-Type", "application/json");
                            request.AddParameter("application/json", jsonbody, ParameterType.RequestBody);
                            IRestResponse <BigMarkerResponse> response = client.Execute <BigMarkerResponse>(request);
                            var bigmarkeresponse = response.Data;
                            if (bigmarkeresponse.Token != null)
                            {
                                EventService.UpdateBigMarkerTokenEvent(bigmarkeresponse.Token);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }
                return(Json(new { success = true, message = "saved Data successfully" }));
            }
            catch (Exception ex)
            {
                return(Json(new
                {
                    success = false,
                    message = "Could not saved Data" + ex.ToString()
                }));
            }
        }