Exemplo n.º 1
0
        /// <summary>
        /// get configuration column name for configuration tables
        /// </summary>
        /// <param name="configType"></param>
        /// <param name="isLogGet">is get from log table</param>
        /// <returns>table name</returns>
        public static string ConfigurationIDColNameGet(ConfigSettingType configType, bool isLogGet)
        {
            string colName = string.Empty;

            switch (configType)
            {
            case ConfigSettingType.POS:
                colName = (isLogGet) ? "PoSConfigurationLogID" : "PoSConfigurationID";
                break;

            case ConfigSettingType.Client:
                colName = (isLogGet) ? "ClientConfigurationLogID" : "ClientConfigurationID";
                break;

            case ConfigSettingType.Supplier:
                colName = (isLogGet) ? "SupplierConfigurationLogID" : "SupplierConfigurationID";
                break;

            case ConfigSettingType.ErrorMap:
                colName = (isLogGet) ? "ErrorMapLogID" : "ErrorMapID";
                break;
            }
            if (string.IsNullOrEmpty(colName))
            {
                Assert.Fail(string.Format("no mapping column Name in DB for {0}!", configType.ToString()));
            }
            return(colName);
        }
Exemplo n.º 2
0
        /// <summary>
        /// get query script
        /// </summary>
        /// <param name="config"></param>
        /// <param name="configType"></param>
        /// <param name="isLogGet"></param>
        /// <param name="topCount"></param>
        /// <param name="sortdirection"></param>
        /// <returns></returns>
        public static string TBLQueryGet(ConfigurationSettingDataTbl config
                                         , ConfigSettingType configType
                                         , bool isLogGet
                                         , int topCount = 0
                                         , CommonEnum.SortDirection sortdirection = CommonEnum.SortDirection.None)
        {
            string topStr = string.Empty;

            if (topCount > 0)
            {
                topStr = "top " + topCount;
            }
            string orderBy = string.Empty;

            if (sortdirection == CommonEnum.SortDirection.ASC)
            {
                orderBy = "order by 1 asc";
            }
            else if (sortdirection == CommonEnum.SortDirection.DESC)
            {
                orderBy = "order by 1 desc";
            }

            string tblName = (isLogGet) ? ConfigSettingHelper.ConfigLogTableNameGet(configType) : ConfigSettingHelper.ConfigTableNameGet(configType);

            string where = TBLQueryGetWhere(config, configType);
            return(string.Format("select {0} * from {1} {2} {3} ", topStr, tblName, where, orderBy));
        }
Exemplo n.º 3
0
            protected void SetSettingValue(ConfigSettingType type, string value)
            {
                var source = (this.TableView.Source as UserConfigTableViewSource);

                if (source != null)
                {
                    source.SetSettingValue(this.TableView, type, value);
                }
            }
Exemplo n.º 4
0
        /// <summary>
        /// get where script
        /// </summary>
        /// <param name="config"></param>
        /// <param name="configType"></param>
        /// <returns></returns>
        public static string TBLQueryGetWhere(ConfigurationSettingDataTbl config, ConfigSettingType configType)
        {
            string where = string.Empty;
            switch (configType)
            {
            case ConfigSettingType.POS:
                where = string.Format("where 1=1 {0} {1}  {2} {3} {4}"
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.jurisdictionCode, "and JurisdictionCode")
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.companyCode, "and CompanyCode")
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.managementUnitCode, "and ManagementUnitCode")
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.settingName, "and SettingName")
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.environment, "and EnvironmentName"));
                break;

            case ConfigSettingType.PoSToWorldspanDefaultSegmentMap:
                where = string.Format("where 1=1 {0} {1}  {2}"
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.jurisdictionCode, "and JurisdictionCode")
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.companyCode, "and CompanyCode")
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.managementUnitCode, "and ManagementUnitCode")
                                      );
                break;

            case ConfigSettingType.Client:
                where = string.Format("where 1=1 {0} {1} {2}"
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.clientID, "and ClientID") //clientID='config.clientID'
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.settingName, "and SettingName")
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.environment, "and EnvironmentName"));
                break;

            case ConfigSettingType.Supplier:
                string updatedBy = "";
                if (config.LastUpdatedBy != null)
                {
                    if (config.UpdateType == supplierUpdateType.Add)
                    {
                        updatedBy = CarSCSCommonHelper.SubConditionQueryGet <string>(config.LastUpdatedBy, "and CreatedBy");
                    }
                    if (config.UpdateType == supplierUpdateType.Update)
                    {
                        updatedBy = CarSCSCommonHelper.SubConditionQueryGet <string>(config.LastUpdatedBy, "and LastUpdatedBy");
                    }
                }
                where = string.Format("where 1=1 {0} {1} {2} {3}"
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.supplierID, "and SupplierID") //SupplierID='config.supplierID'
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.settingName, "and SettingName")
                                      , CarSCSCommonHelper.SubConditionQueryGet <string>(config.environment, "and EnvironmentName")
                                      , updatedBy);

                break;
            }
            return(where);
        }
Exemplo n.º 5
0
            public void SetSettingValue(UITableView tableView, ConfigSettingType type, string value)
            {
                for (int n = 0; n < this.Values.Count; n++)
                {
                    if (this.Values[n].Type == type)
                    {
                        this.Values[n].CurrentValue = value;

                        MainThreadUtility.InvokeOnMain(() =>
                        {
                            this.GetCellInternal(tableView, NSIndexPath.FromRowSection(n, 0));
                        });
                        break;
                    }
                }
            }
Exemplo n.º 6
0
        /// <summary>
        /// 現在の設定オブジェクトの位置を設定
        /// </summary>
        /// <param name="type">設定種別</param>
        /// <param name="setVal">設定値</param>
        private void SetIsSetObjectPosition(ConfigSettingType type, float setVal)
        {
            var objectName = "IsSet";

            switch (type)
            {
            case ConfigSettingType.Bgm:
                objectName += nameof(ConfigSettingType.Bgm);
                break;

            case ConfigSettingType.Se:
                objectName += nameof(ConfigSettingType.Se);
                break;

            case ConfigSettingType.Voice:
                objectName += nameof(ConfigSettingType.Voice);
                break;

            case ConfigSettingType.MessageSpeed:
                objectName += nameof(ConfigSettingType.MessageSpeed);
                break;

            default:
                return;
            }

            // 設定値の箇所にカーソルを持ってくる
            var   cursorObject = GameObject.Find(objectName);
            var   pos          = cursorObject.transform.localPosition;
            float index        = (setVal - 0.2f) / 0.2f;
            float offsetX      = -38.0f;
            float dx           = 51.0f * index;

            pos.x = offsetX + dx;
            cursorObject.transform.localPosition = pos;
        }
Exemplo n.º 7
0
 public ConfigurationDBHelper(string connectionString, ConfigSettingType configType)
 {
     this.ConnectionString  = connectionString;
     this.ConfigurationType = configType;
 }
Exemplo n.º 8
0
 public ConfigurationDBHelper(CommonEnum.ServiceName service, ConfigSettingType configType)
 {
     this.ConnectionString  = CarSCSCommonHelper.DBConnectionStringGet(service);
     this.ConfigurationType = configType;
 }
Exemplo n.º 9
0
 public ConfigurationDBHelper(CommonEnum.ServieProvider serviceProvider, ConfigSettingType configType)
 {
     this.ConnectionString  = CarSCSCommonHelper.DBConnectionStringGet(ConfigSettingHelper.ServiceNameGet(serviceProvider));
     this.ConfigurationType = configType;
 }
Exemplo n.º 10
0
        public static string GetConfigFeature(string configSettingName, TestDataReserve testData, string hostNameKey = "CarBSUri", ConfigSettingType configType = ConfigSettingType.POS)
        {
            //create a configuration request data instance
            ConfigSettingRequestData configSettingRequestData = new ConfigSettingRequestData(hostNameKey, configType);

            configSettingRequestData.TUID = testData.tuid;
            string enableValue = null;
            // get the feature turned value from DB
            string envKey = ServiceConfigUtil.EnvNameGet();

            ///1. mach as EnviromentName and POS's 3 values
            enableValue = CarBSDB.GetServiceConfig(configSettingName, envKey, testData.JurisdictionCountryCode,
                                                   testData.CompanyCode, testData.ManagementUnitCode);
            if (enableValue == null)
            {
                ///2. if 1 is null, mach only with EnviromentName
                enableValue = CarBSDB.GetServiceConfig(configSettingName, envKey);
                if (enableValue == null)
                {
                    ///3. if 2 is null, mach as EnviromentName is null
                    enableValue = CarBSDB.GetServiceConfig(configSettingName);
                    if (enableValue == null)
                    {
                        Assert.Fail("No enable feature value  for " + configSettingName + "in DB,please check the DB.");
                    }
                }
            }
            return(enableValue);
        }