Esempio n. 1
0
        //public static NavSalesOrderDimensionResponse GetNavSalesOrderDimensionValues(string langCode, string userName, string password, string serviceUrl, bool forceUpdate = false)
        //{
        //	if (!DimensionValues.ContainsKey(langCode))
        //		DimensionValues.GetOrAdd(langCode, new NavSalesOrderDimensionResponse());
        //	if ((DimensionValues[langCode].NavSalesOrderDimensionValues == null) || forceUpdate)
        //		DimensionValues.AddOrUpdate(langCode, _salesOrderCommands.GetNavSalesOrderDimension(userName, password, serviceUrl));
        //	return DimensionValues[langCode];
        //}

        //public static NavSalesOrderPostedInvoiceResponse GetCachedNavSalesOrderValues(string langCode, string userName, string password, string serviceUrl, bool forceUpdate = false)
        //{
        //	if (!CachedNavSalesOrder.ContainsKey(langCode))
        //		CachedNavSalesOrder.GetOrAdd(langCode, new NavSalesOrderPostedInvoiceResponse());
        //	if ((CachedNavSalesOrder[langCode].NavSalesOrder == null) || forceUpdate)
        //		CachedNavSalesOrder.AddOrUpdate(langCode, _salesOrderCommands.GetNavPostedSalesOrderResponse(userName, password, serviceUrl));
        //	return CachedNavSalesOrder[langCode];
        //}

        //public static NavPurchaseOrderPostedInvoiceResponse GetCachedNavPurchaseOrderValues(string langCode, string userName, string password, string serviceUrl, bool forceUpdate = false)
        //{
        //	if (!CachedNavPurchaseOrder.ContainsKey(langCode))
        //		CachedNavPurchaseOrder.GetOrAdd(langCode, new NavPurchaseOrderPostedInvoiceResponse());
        //	if ((CachedNavPurchaseOrder[langCode].NavPurchaseOrder == null) || forceUpdate)
        //		CachedNavPurchaseOrder.AddOrUpdate(langCode, _salesOrderCommands.GetNavPostedPurchaseOrderResponse(userName, password, serviceUrl));
        //	return CachedNavPurchaseOrder[langCode];
        //}

        //public static NavSalesOrderItemResponse GetCachedNavSalesOrderItemValues(string langCode, string userName, string password, string serviceUrl, bool forceUpdate = false)
        //{
        //	if (!CachedNavSalesLine.ContainsKey(langCode))
        //		CachedNavSalesLine.GetOrAdd(langCode, new NavSalesOrderItemResponse());
        //	if ((CachedNavSalesLine[langCode].NavSalesOrderItem == null) || forceUpdate)
        //		CachedNavSalesLine.AddOrUpdate(langCode, _salesOrderCommands.GetNavPostedSalesOrderItemResponse(userName, password, serviceUrl));
        //	return CachedNavSalesLine[langCode];
        //}

        //public static NavPurchaseOrderItemResponse GetCachedNavPurchaseOrderItemValues(string langCode, string userName, string password, string serviceUrl, bool forceUpdate = false)
        //{
        //	if (!CachedNavPurchaseLine.ContainsKey(langCode))
        //		CachedNavPurchaseLine.GetOrAdd(langCode, new NavPurchaseOrderItemResponse());
        //	if ((CachedNavPurchaseLine[langCode].NavPurchaseOrderItem == null) || forceUpdate)
        //		CachedNavPurchaseLine.AddOrUpdate(langCode, _salesOrderCommands.GetNavPostedPurchaseOrderItemResponse(userName, password, serviceUrl));
        //	return CachedNavPurchaseLine[langCode];
        //}

        //public static NAVOrderItemResponse GetNAVOrderItemResponse(string langCode, string userName, string password, string serviceUrl, bool forceUpdate = false)
        //{
        //	if (!NAVOrderItemResponse.ContainsKey(langCode))
        //		NAVOrderItemResponse.GetOrAdd(langCode, new NAVOrderItemResponse());
        //	if ((NAVOrderItemResponse[langCode].OrderItemList == null) || forceUpdate)
        //		NAVOrderItemResponse.AddOrUpdate(langCode, _salesOrderCommands.GetNavNAVOrderItemResponse());
        //	return NAVOrderItemResponse[langCode];
        //}

        #endregion Commented Code

        public static IList <IdRefLangName> GetIdRefLangNames(string langCode, int lookupId, bool forceUpdate = false)
        {
            if (!IdRefLangNames.ContainsKey(langCode))
            {
                IdRefLangNames.GetOrAdd(langCode, new ConcurrentDictionary <int, IList <IdRefLangName> >());
            }
            if (!IdRefLangNames[langCode].ContainsKey(lookupId))
            {
                IdRefLangNames[langCode].GetOrAdd(lookupId, _commands.GetIdRefLangNames(langCode, lookupId));
            }
            else if (!IdRefLangNames[langCode][lookupId].Any() || forceUpdate)
            {
                IdRefLangNames[langCode].AddOrUpdate(lookupId, _commands.GetIdRefLangNames(langCode, lookupId));
            }
            return(IdRefLangNames[langCode][lookupId]);
        }
Esempio n. 2
0
 /// <summary>
 ///     To start English version of it on Application start
 /// </summary>
 /// <param name="langCode">1 for EN</param>
 public static void Initialize(string langCode)
 {
     Tables = new Dictionary <EntitiesAlias, TableReference>();
     RibbonMenus.GetOrAdd(langCode, new List <RibbonMenu>());
     IdRefLangNames.GetOrAdd(langCode, new ConcurrentDictionary <int, IList <IdRefLangName> >());
     PageInfos.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <PageInfo> >());
     Operations.GetOrAdd(langCode, new ConcurrentDictionary <LookupEnums, IList <Operation> >());
     DisplayMessages.GetOrAdd(langCode, new ConcurrentDictionary <string, DisplayMessage>());
     ColumnSettings.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <ViewModels.ColumnSetting> >());
     GridColumnSettings.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <ViewModels.ColumnSetting> >());
     ValidationRegExpressions.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <ValidationRegEx> >());
     MasterTables.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, object>());
     ConditionalOperators.GetOrAdd(langCode, new List <ConditionalOperator>());
     SysSettings.GetOrAdd(langCode, new SysSetting());
     BusinessConfiguration.GetOrAdd(langCode, new BusinessConfiguration());
 }
Esempio n. 3
0
        /// <summary>
        ///     To start English version of it on Application start
        /// </summary>
        /// <param name="langCode">1 for EN</param>
        public static void Initialize(string langCode)
        {
            RibbonMenus.GetOrAdd(langCode, new List <RibbonMenu>());
            IdRefLangNames.GetOrAdd(langCode, new ConcurrentDictionary <int, IList <IdRefLangName> >());
            PageInfos.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <PageInfo> >());
            Operations.GetOrAdd(langCode, new ConcurrentDictionary <LookupEnums, IList <Operation> >());
            DisplayMessages.GetOrAdd(langCode, new ConcurrentDictionary <string, DisplayMessage>());
            ColumnSettings.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <ColumnSetting> >());
            GridColumnSettings.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <ColumnSetting> >());
            ValidationRegExpressions.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <ValidationRegEx> >());
            MasterTables.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, object>());
            ConditionalOperators.GetOrAdd(langCode, new List <ConditionalOperator>());
            BusinessConfiguration.GetOrAdd(langCode, new BusinessConfiguration());
            List <Task> tasks = new List <Task>();

            tasks.Add(Task.Factory.StartNew(() =>
            {
                GetRibbonMenus(langCode);
                GetTables();
                InitializerOperations(langCode);
                GetSystemSettings(langCode);
            }));

            if (tasks.Count > 0)
            {
                Task.WaitAll(tasks.ToArray());
            }

            #region Nav Cache Commented Code

            ////string username = M4PBusinessContext.ComponentSettings.NavAPIUserName;
            ////string password = M4PBusinessContext.ComponentSettings.NavAPIPassword;
            ////string serviceURL = M4PBusinessContext.ComponentSettings.NavAPIUrl;
            ////NAVOrderItemResponse.GetOrAdd(langCode, new NAVOrderItemResponse());
            ////DimensionValues.GetOrAdd(langCode, new NavSalesOrderDimensionResponse());
            ////GetNavSalesOrderDimensionValues(langCode, username, password, serviceURL);
            ////CachedNavSalesOrder.GetOrAdd(langCode, new NavSalesOrderPostedInvoiceResponse());
            ////GetCachedNavSalesOrderValues(langCode, username, password, serviceURL);
            ////CachedNavPurchaseOrder.GetOrAdd(langCode, new NavPurchaseOrderPostedInvoiceResponse());
            ////GetCachedNavPurchaseOrderValues(langCode, username, password, serviceURL);
            ////CachedNavSalesLine.GetOrAdd(langCode, new NavSalesOrderItemResponse());
            ////GetCachedNavSalesOrderItemValues(langCode, username, password, serviceURL);
            ////CachedNavPurchaseLine.GetOrAdd(langCode, new NavPurchaseOrderItemResponse());
            ////GetCachedNavPurchaseOrderItemValues(langCode, username, password, serviceURL);

            #endregion Nav Cache Commented Code
        }