private void SaveQuickPollObjects(QuickPollBlock currentBlock)
        {
            var quickPoll = new QuickPollObjects()
            {
                Id = Identity.NewIdentity(Guid.NewGuid()),
                PollID = (currentBlock as IContent).ContentLink.ID,
                Title = currentBlock.QuickPollHeading,
                Question = currentBlock.Question,
                CreatedBy = System.Web.HttpContext.Current.User.Identity.Name,
                IsActive = true
            };

            var quickPollStore = DynamicDataStoreFactory.Instance.GetStore(typeof(QuickPollObjects));
            quickPollStore.Save(quickPoll);

            var quickPollOptions = new QuickPollOptions()
            {
                Id = Identity.NewIdentity(Guid.NewGuid()),
                PollID = Convert.ToString((currentBlock as IContent).ContentLink.ID),
                Option1 = currentBlock.Alternative1,
                Option2 = currentBlock.Alternative2,
                Option3 = currentBlock.Alternative3,
                Option4 = currentBlock.Alternative4,
                Option5 = currentBlock.Alternative5,
                Option6 = currentBlock.Alternative6,
                Option7 = currentBlock.Alternative7,
                Option8 = currentBlock.Alternative8,
                Option9 = currentBlock.Alternative9,
                Option10 = currentBlock.Alternative10
            };

            var quickPollOptionsStores = DynamicDataStoreFactory.Instance.GetStore(typeof(QuickPollOptions));
            quickPollOptionsStores.Save(quickPollOptions);
        }
        private void UpdateQuickPollObjects(QuickPollBlock currentBlock)
        {
            int quickPollID = (currentBlock as IContent).ContentLink.ID;

            var quickPollObjectStore = DynamicDataStoreFactory.Instance.GetStore(typeof(QuickPollObjects));
            var pollObjects = quickPollObjectStore.Find<QuickPollObjects>("PollID", quickPollID).FirstOrDefault();
            pollObjects.Title = currentBlock.QuickPollHeading;
            pollObjects.Question = currentBlock.Question;
            pollObjects.IsActive = true;
            pollObjects.CreatedBy = System.Web.HttpContext.Current.User.Identity.Name;
            quickPollObjectStore.Save(pollObjects);

            var pollOptionsStore = DynamicDataStoreFactory.Instance.GetStore(typeof(QuickPollOptions));
            var pollOptionObjects = pollOptionsStore.Find<QuickPollOptions>("PollID", quickPollID).FirstOrDefault();
            if (pollOptionObjects != null)
            {
                pollOptionObjects.PollID = Convert.ToString(quickPollID);
                pollOptionObjects.Option1 = currentBlock.Alternative1;
                pollOptionObjects.Option2 = currentBlock.Alternative2;
                pollOptionObjects.Option3 = currentBlock.Alternative3;
                pollOptionObjects.Option4 = currentBlock.Alternative4;
                pollOptionObjects.Option5 = currentBlock.Alternative5;
                pollOptionObjects.Option6 = currentBlock.Alternative6;
                pollOptionObjects.Option7 = currentBlock.Alternative7;
                pollOptionObjects.Option8 = currentBlock.Alternative8;
                pollOptionObjects.Option9 = currentBlock.Alternative9;
                pollOptionObjects.Option10 = currentBlock.Alternative10;
            }

            pollOptionsStore.Save(pollOptionObjects);
        }
 public void SaveQuickPoll(QuickPollBlock currentBlock)
 {
     if (!IsPollExists((currentBlock as IContent).ContentLink.ID))
     {
         SaveQuickPollObjects(currentBlock);
     }
     else
     {
         UpdateQuickPollObjects(currentBlock);
     }
 }