public MainPageViewModel(ICacheData cache, IPageDialogService dialogService, INavigationService navigationService) : base(navigationService)
 {
     _cache             = cache;
     _navigationService = navigationService;
     _dialogService     = dialogService;
     LoadItems();
 }
示例#2
0
 public bool IsInCache(string input, out ICacheData <T> outputdata)
 {
     if (Cache.TryGetValue(input, out outputdata))
     {
         return(true);
     }
     return(false);
 }
示例#3
0
        public AddPageViewModel(ICacheData cache, IPageDialogService dialogService, INavigationService navigationService) : base(navigationService)
        {
            _navigationService = navigationService;
            _dialogService     = dialogService;
            _cache             = cache;

            Init();
        }
    public static String FetchWinners(String offerId, String storeNames)
    {
        var        ajaxProcessingFunctions = new AjaxProcessingFunctions();
        ICacheData cache            = CurrentRequest.Resolver.Resolve <ICacheData>();
        string     PromoBrkrAddress = String.Format("http://{0}/ams-broker-promotion/instantwin/allwinners", cache.GetSystemOption_UE_ByOptionId(186));

        return(ajaxProcessingFunctions.HttpPost(PromoBrkrAddress, offerId.ConvertToInt32(), storeNames));
    }
示例#5
0
        public static T Check <T>(string input, Func <T> delegatefunction)
        {
            bool functionexceptionthrown = false;

            ICacheData <T>    cachedata = null;
            ICacheManager <T> manager   = null;

            try
            {
                if (TryGetManager <T>(out manager))
                {
                    string hash = _md5System.GetMd5Hash(input);
                    if (manager.DataManager.IsInCache(hash, out cachedata))
                    {
                        manager.DataManager.UpdateExpiration(hash);
                        return(cachedata.CachedObject);
                    }
                    else
                    {
                        if (manager.IsAtMaxCount())
                        {
                            manager.DataManager.RemoveFirstIndex();
                        }

                        T freshobject = delegatefunction();
                        manager.DataManager.AddToCache(hash, freshobject);
                        return(freshobject);
                    }
                }
                else
                {
                    try
                    {
                        return(delegatefunction());
                    }
                    catch
                    {
                        functionexceptionthrown = true;
                        throw;
                    }
                }
            }
            catch
            {
                if (functionexceptionthrown)
                {
                    throw;
                }
                else
                {
                    return(delegatefunction());
                }
            }
        }
示例#6
0
 private void ResolveDepedencies()
 {
     if (string.IsNullOrWhiteSpace(AppName))
     {
         throw new Exception("App Name is not assigned");
     }
     CurrentRequest.Resolver.AppName = AppName;
     Logger          = CurrentRequest.Resolver.Resolve <ILogger>();
     ErrorHandler    = CurrentRequest.Resolver.Resolve <IErrorHandler>();
     SystemSettings  = CurrentRequest.Resolver.Resolve <ISystemSettings>();
     PhraseLib       = CurrentRequest.Resolver.Resolve <IPhraseLib>();
     SystemCacheData = CurrentRequest.Resolver.Resolve <ICacheData>();
 }
    private void ResolveDependencies()
    {
        m_InstantWinService   = CurrentRequest.Resolver.Resolve <CMS.AMS.Contract.IInstantWinConditionService>();
        m_Offer               = CurrentRequest.Resolver.Resolve <CMS.AMS.Contract.IOffer>();
        m_Commondata          = CurrentRequest.Resolver.Resolve <CMS.AMS.Common>();
        m_CommonInc           = CurrentRequest.Resolver.Resolve <CommonInc>();
        m_CacheData           = CurrentRequest.Resolver.Resolve <CacheData>();
        m_LocalizationService = CurrentRequest.Resolver.Resolve <ILocalizationService>();
        m_ActivityLogService  = CurrentRequest.Resolver.Resolve <IActivityLogService>();
        m_OAWService          = CurrentRequest.Resolver.Resolve <IOfferApprovalWorkflowService>();

        m_Commondata = new CMS.AMS.Common(Environment.MachineName, "UEOffer_con_UEInstantWin.aspx");
        LanguageID   = CurrentUser.AdminUser.LanguageID;
        m_Commondata.Open_LogixRT();
    }
示例#8
0
    public void Session_Start(object sender, EventArgs e)
    {
        // Ensure SesssionID exists when the Application Pool Recycles
        string sessionId = Session.SessionID;

        CurrentRequest.Resolver.AppName = "Global.asax";
        ICacheData cachedata = CurrentRequest.Resolver.Resolve <ICacheData>();
        //CMS.AMS.Common common = CurrentWebRequest.Resolver.Resolve<CMS.AMS.Common>();
        //if (common.LRT_Connection_State() != ConnectionState.Open)
        //  common.Open_LogixRT();
        int SessionTimeOut = cachedata.GetSystemOption_General_ByOptionId(158).ConvertToInt32();

        if (SessionTimeOut != 0)
        {
            Session.Timeout = SessionTimeOut;
        }
    }
 public MasterPageViewModel(ICacheData cache, INavigationService navigationService, IPageDialogService dialogService) : base(navigationService)
 {
     _cache         = cache;
     _dialogService = dialogService;
     LoadMenu();
 }
 public NotificationPageViewModel(ICacheData cache, INavigationService navigationService) : base(navigationService)
 {
     _cache = cache;
 }
示例#11
0
 private void ResolveDependencies()
 {
     m_CardTypeService = CurrentRequest.Resolver.Resolve <ICardTypeService>();
     m_CacheData       = CurrentRequest.Resolver.Resolve <ICacheData>();
 }