protected ISessionFactory Build() { Configuration cfg = new Configuration(); cfg.DataBaseIntegration(x => { x.ConnectionString = "Data Source=localhost,1433;User Id=sa;Password=abc,12345678;Initial Catalog=NHPerformance;Application Name=NHPerformance"; x.Driver <SqlClientDriver>(); x.Dialect <MsSql2012Dialect>(); x.LogSqlInConsole = false; }); cfg.SetProperty("adonet.batch_size", "10"); cfg.SetProperty("cache.configuration", "localhost:6379,ssl=False,abortConnect=False"); cfg.SetProperty("cache.use_query_cache", "true"); var regionClienteConfig = new RegionConfig("Cliente", TimeSpan.FromHours(1), false, null, null, true); NHibernate.Caches.StackExchangeRedis.RedisCacheProvider.SetRegionConfiguration("cliente", regionClienteConfig); cfg.Cache(c => { c.Provider <NHibernate.Caches.StackExchangeRedis.RedisCacheProvider>(); }); var mapper = new ModelMapper(); mapper.AddMappings(Assembly.GetExecutingAssembly().GetExportedTypes()); HbmMapping mapping = mapper.CompileMappingForAllExplicitlyAddedEntities(); cfg.AddMapping(mapping); // new SchemaUpdate(cfg).Execute(false, true); return(cfg.BuildSessionFactory()); }
//CurrentRegionInfoを設定する。 protected void SetCurrentRegionInfo() { if (_currentRegion != null && !string.IsNullOrEmpty(_currentRegion.CurrentDestination)) { //現地のUTCからの時差 _currentRegion.TimeDiffFromUTC = RegionConfig.GetRegionTimeDiffFromUTC(_currentRegion.CurrentDestination); //現地通貨の書式および通貨記号 _currentRegion.CurrencyFormat = RegionConfig.GetCurrencyFormat(_currentRegion.CurrentDestination); _currentRegion.CurrencySymbol = RegionConfig.GetCurrencySymbol(_currentRegion.CurrentDestination); _currentRegion.CurrencyFormatWithSymbol = RegionConfig.GetCurrencyFormatWithSymbol(_currentRegion.CurrentDestination); } }
//決済サーバメンテナンス時に決済処理関連ボタンをDisabledにする protected void SetPaymentMaintInf() { //決済処理メンテナンス期間取得 var maintenance_from = TypeHelper.GetDateTime(ConfigurationManager.AppSettings["PaymentMaintenanceFrom"]); var maintenance_to = TypeHelper.GetDateTime(ConfigurationManager.AppSettings["PaymentMaintenanceTo"]); var today = RegionConfig.GetRegionToday(_currentRegion.CurrentDestination); if (maintenance_from <= today && today <= maintenance_to) { ViewBag.PaymentMaintenanceFrom = maintenance_from; ViewBag.PaymentMaintenanceTo = maintenance_to; } }
public RegionViewModel Create(Guid presetId, string regionName) { var newRegion = new RegionConfig { Id = Guid.NewGuid(), Name = regionName }; var regions = GetAllRegions(presetId).ToList(); regions.Add(newRegion); File.WriteAllText(PresetFile.ResolvePresetFilePath(presetId), JsonConvert.SerializeObject(regions)); return(_mapper.Map <RegionViewModel>(newRegion)); }
protected override void OnModelCreating(ModelBuilder modelBuilder) { // Geographic Entities ContinentConfig.SetEntityBuilder(modelBuilder.Entity <Continent>()); CountryConfig.SetEntityBuilder(modelBuilder.Entity <Country>()); RegionConfig.SetEntityBuilder(modelBuilder.Entity <Region>()); // Administrative Entities AdminConfig.SetEntityBuilder(modelBuilder.Entity <Admin>()); EventConfig.SetEntityBuilder(modelBuilder.Entity <Event>()); // Measures Entities SanitaryMeasureConfig.SetEntityBuilder(modelBuilder.Entity <SanitaryMeasure>()); ContainmentMeasureConfig.SetEntityBuilder(modelBuilder.Entity <ContainmentMeasure>()); CmByCountry.SetEntityBuilder(modelBuilder.Entity <CountryContainmentMeasures>()); SmByCountry.SetEntityBuilder(modelBuilder.Entity <CountrySanitaryMeasures>()); // Hospital Entities HospitalConfig.SetEntityBuilder(modelBuilder.Entity <Hospital>()); HEmployeeConfig.SetEntityBuilder(modelBuilder.Entity <HospitalEmployee>()); MedicationConfig.SetEntityBuilder(modelBuilder.Entity <Medication>()); // Person Entities PatientConfig.SetEntityBuilder(modelBuilder.Entity <Patient>()); P_MedicationConfig.SetEntityBuilder(modelBuilder.Entity <PatientMedications>()); Pt_PathologyConfig.SetEntityBuilder(modelBuilder.Entity <PatientPathologies>()); PersonConfig.SetEntityBuilder(modelBuilder.Entity <ContactedPerson>()); Ps_PathologyConfig.SetEntityBuilder(modelBuilder.Entity <PersonPathologies>()); ContactsByPatientConfig.SetEntityBuilder(modelBuilder.Entity <PersonsContactedByPatient>()); // Not related Entities PathologiesConfig.SetEntityBuilder(modelBuilder.Entity <Pathology>()); Pharm_CompanyConfig.SetEntityBuilder(modelBuilder.Entity <PharmaceuticalCompany>()); StatusConfig.SetEntityBuilder(modelBuilder.Entity <PatientStatus>()); // Views and Stored Procedures modelBuilder.Entity <PatientView>().HasNoKey().ToView(null); modelBuilder.Entity <ExportPatient>().HasNoKey().ToView(null); modelBuilder.Entity <CasesView>().HasNoKey().ToView(null); modelBuilder.Entity <ReportView>().HasNoKey().ToView(null); modelBuilder.Entity <MeasureView>().HasNoKey().ToView(null); modelBuilder.Entity <MedicationView>().HasNoKey().ToView(null); modelBuilder.Entity <PatientMedicationView>().HasNoKey().ToView(null); modelBuilder.Entity <PathologyView>().HasNoKey().ToView(null); modelBuilder.Entity <ContactView>().HasNoKey().ToView(null); }
private void SetRedirectResult(string region_cd, ActionExecutingContext filterContext) { string base_url = RegionConfig.GetRegionAttr(region_cd, "base_url"); if (base_url.EndsWith("/")) { base_url = base_url.TrimEnd("/".ToCharArray()); } string path = filterContext.RequestContext.HttpContext.Request.Url.PathAndQuery; path = path.Substring(path.IndexOf("/", 1)); //「/CatWeb/Customer/54545/?xxxx...」の最初の/CatWebの部分を除去。 string to_url = base_url + path; filterContext.Result = new RedirectResult(to_url); }
public static void SpawnRegion(RegionConfig region, TileManager target) { TileManager instance = Instantiate(region.TileSet).gameObject.GetComponent <TileManager>(); target.AppendGrid(instance); //spawn the units and shit UnitSpawnManager spawner = instance.GetComponent <UnitSpawnManager>(); List <UnitSpawnGroupConfig> groups = RegionLoader.GetGroupsForPower(region); if (region.SpawnSquad) { groups.Add(SquadManager.MakeSquadGroup()); } // MDebug.Log("Spawn Groups " + groups.Count); spawner.SpawnGroups(groups); }
/// <summary> /// Decides what to spawn next (camp, or regular region) and starts the region spawning process /// </summary> public virtual void SpawnNext() { if (configsToSpawn.IsNullOrEmpty()) { return; } RegionConfig region = null; region = configsToSpawn[0]; configsToSpawn.RemoveAt(0); if (region == null) { return; } spawned.Add(region); // MDebug.Log("spawning region " + region.name); SpawnRegion(region, TileManager.Instance); }
private static string GetMaintenanceFilePath() { string path = ConfigurationManager.AppSettings["MaintenanceFilePath"]; path = string.IsNullOrWhiteSpace(path) ? String.Empty : path; if (path.Contains("%ROOT%")) { path = path.Replace("%ROOT%", RegionConfig.GetApplicationRootPath()); } if (String.Empty.Equals(path)) { path = RegionConfig.GetApplicationRootPath(); } if (!path.EndsWith("\\")) { path += "\\"; } return(path); }
public static void Load() { if (!File.Exists("SSC/config.json")) { ServerSideCharacter2.Config = ConfigData.DefaultConfig(); } else { try { string data; using (var reader = new StreamReader(defaultName, Encoding.UTF8)) { data = reader.ReadToEnd(); } ServerSideCharacter2.Config = JsonConvert.DeserializeObject <ConfigData>(data); QQAuth.ConnectionStr = $"server={ServerSideCharacter2.Config.ServerAddr};User Id={ServerSideCharacter2.Config.ServerUserID};Password={ServerSideCharacter2.Config.ServerPassword};" + $"Database={ServerSideCharacter2.Config.DatabaseName};port={ServerSideCharacter2.Config.ServerPort}"; } catch (Exception ex) { CommandBoardcast.ConsoleError("读取配置文件出错,重置为默认配置"); CommandBoardcast.ConsoleError(ex); ServerSideCharacter2.Config = ConfigData.DefaultConfig(); } } CommandBoardcast.ConsoleMessage("配置文件已经加载"); CommandBoardcast.ConsoleMessage( $"当前配置 自动保存: {(ServerSideCharacter2.Config.AutoSave ? "开" : "关")},自动保存间隔:{ServerSideCharacter2.Config.SaveInterval / 60f}s"); GroupConfigManager = new GroupConfig(); UnionDataManager = new Unions.UnionConfig(); RegionConfig = new RegionConfig(); ServerSideCharacter2.RankData = RankData.Load(); Save(); }
public static List <UnitSpawnGroupConfig> GetGroupsForPower(RegionConfig region) { // MDebug.Log("Get groups for " + region); //Add all forced groups to choosen ones List <UnitSpawnGroupConfig> choosenGroups = region.Groups.Where(gr => gr.ForceGroup).ToList(); //make a copy of groups but exclude the ones that we already have List <UnitSpawnGroupConfig> groupsCopy = new List <UnitSpawnGroupConfig>(region.Groups).Where(gr => !choosenGroups.Contains(gr)).ToList(); int powerLeft = region.RegionTotalEnemyPower; //list of groupls that are valid for the powerlevel left List <UnitSpawnGroupConfig> validgroups = GetGroupsInPowerLevel(groupsCopy, powerLeft); while (validgroups.Count > 0) { UnitSpawnGroupConfig choosen = M_Weightable.GetWeighted(validgroups); choosenGroups.Add(choosen); groupsCopy.Remove(choosen); int groupPower = choosen.GroupPower; if (groupPower <= 0) { Debug.LogWarning("UNIT POWER 0, aborting to avoid infinite loop"); return(choosenGroups); } powerLeft -= groupPower; if (groupsCopy.Count == 0) { Debug.LogWarning("No groups to spawn left"); return(choosenGroups); } validgroups = GetGroupsInPowerLevel(groupsCopy, powerLeft); } return(choosenGroups); }
///// <summary> ///// 言語が選択された時の処理。 ///// </summary> ///// <param name="region_cd"></param> ///// <returns></returns> //public ActionResult SelectLanguage(string language, string ReturnUrl) { // if (!string.IsNullOrWhiteSpace(language)) { // this.CurrentRegionInfo.CurrentLanguage = language; // Session[Constants.SSKEY_CURRENT_REGION] = this.CurrentRegionInfo; // //Cookieに言語設定を保存。(LocalStorageだと1回めのリクエストと同時に送る事が出来ないので、この用途にはCookieの方が良い。) // SetLanguageCookie(language); // } // if (string.IsNullOrWhiteSpace(ReturnUrl)) { // //クロールエラー対策。検索エンジンロボットの場合はUrlReferrerはnullなのでその場合に500エラーにならない様に。 // if (Request.UrlReferrer != null) { // ReturnUrl = Request.UrlReferrer.ToString(); // } else { // ReturnUrl = ""; // } // } // return RedirectToLocal(ReturnUrl); //} ///// <summary> ///// 希望挙式日が選択された時の処理。 ///// </summary> ///// <param name="region_cd"></param> ///// <returns></returns> //public ActionResult SelectWeddingDate(DateTime? wed_date = null, string region_cd = null, string area_cd = null, bool item_list_display = false, bool type_list_display = false) { // region_cd = string.IsNullOrEmpty(region_cd) ? this.CurrentRegionInfo.CurrentDestination : region_cd; // area_cd = string.IsNullOrEmpty(area_cd) ? this.CurrentSelectItem.area_cd : area_cd; // if (string.IsNullOrEmpty(region_cd)) { // region_cd = TypeHelper.GetStrTrim(ConfigurationManager.AppSettings["DefaultRegion"]); // } // if (string.IsNullOrEmpty(area_cd)) { // area_cd = TypeHelper.GetStrTrim(ConfigurationManager.AppSettings["DefaultArea"]); // } // if (wed_date == null || wed_date.Value < SqlDateTime.MinValue.Value) { // var default_date = RegionConfig.GetRegionToday(region_cd).AddMonths(2); // wed_date = (this.CurrentSelectItem.wed_date == DateTime.MinValue) ? default_date : this.CurrentSelectItem.wed_date; // } // //URLを編集 // var current_url = TypeHelper.GetStr(ConfigurationManager.AppSettings["BaseURL"]); // if (type_list_display) { // current_url += "/Types"; // } else if (item_list_display) { // if (String.IsNullOrEmpty(this.CurrentSelectItem.trf_type)) { // current_url += "/Types"; // //} else { // // current_url += "/Items"; // } // } else if (String.IsNullOrEmpty(this.CurrentSelectItem.trf_type)) { // current_url += "/Types"; // } else if (!String.IsNullOrEmpty(this.CurrentSelectItem.trf_item_cd)) { // current_url += "/Detail"; // //} else { // // current_url += "/Items"; // } // current_url += "/" + region_cd; // current_url += "/" + area_cd; // var str_wed_date = wed_date.Value.ToString("yyyyMMdd"); // current_url += "/" + str_wed_date; // if (!type_list_display && !String.IsNullOrEmpty(this.CurrentSelectItem.trf_type)) { // current_url += "/" + this.CurrentSelectItem.trf_kind; // current_url += "/" + this.CurrentSelectItem.trf_type; // if (!item_list_display && !String.IsNullOrEmpty(this.CurrentSelectItem.trf_item_cd)) { // current_url += "/" + this.CurrentSelectItem.trf_cat; // current_url += "/" + this.CurrentSelectItem.trf_item_cd; // } // } // return RedirectToLocal(current_url); //} //[Route("Detail/{region_cd}/{area_cd}/{trf_kind}/{trf_type}/{trf_cat}/{trf_item_cd}")] //public ActionResult DefaultDetail(string region_cd, string area_cd, string trf_kind, string trf_type, string trf_cat, string trf_item_cd, string lang = null) { // DateTime default_date = RegionConfig.GetRegionToday(region_cd).AddMonths(2); // if (!string.IsNullOrEmpty(lang)) { // this.CurrentRegionInfo.CurrentLanguage = lang; // } // return Detail(region_cd, area_cd, default_date.ToString("yyyyMMdd"), trf_kind, trf_type, trf_cat, trf_item_cd); //} //[Route("Detail/{region_cd}/{area_cd}/{str_wed_date}/{trf_kind}/{trf_type}/{trf_cat}/{trf_item_cd}/{page_number:int?}")] //public ActionResult Detail(string region_cd, string area_cd, string str_wed_date, string trf_kind, string trf_type, string trf_cat, string trf_item_cd, short? page_number = 1) { // if (this.CurrentSelectItem.session_prior) { // //Login直後でPKGアイアムを購入済の場合は、wed_dateをPKGのwed_dateにする // this.CurrentSelectItem.session_prior = false; // SetInformation(this.CurrentRegionInfo.CurrentDestination, this.CurrentSelectItem.area_cd, this.CurrentSelectItem.str_wed_date, trf_kind, trf_type, trf_cat, trf_item_cd); // return SelectWeddingDate(this.CurrentSelectItem.wed_date, this.CurrentRegionInfo.CurrentDestination, this.CurrentSelectItem.area_cd, false, false); // } // SetInformation(region_cd, area_cd, str_wed_date, trf_kind, trf_type, trf_cat, trf_item_cd); // //表示通貨判断 // var is_japan = this.IsJpnClientOrJpnAccount(); // var lang = this.CurrentRegionInfo.CurrentLanguage; // //Item詳細取得 // var model = new WtbApi.Proxy.Destination.TrfItemRepository(region_cd) // .FindItem( // area_cd, // this.CurrentSelectItem.period_id, // trf_kind, // trf_type, // trf_cat, // trf_item_cd, // lang, // is_japan, // CurrentSelectItem.wed_date); // ViewBag.PageNum = page_number; // ViewBag.FbUrl = "Detail/" + region_cd + "/" + area_cd + "/" + trf_kind + "/" + trf_type + "/" + trf_cat + "/" + trf_item_cd + "?lang=" + CurrentRegionInfo.CurrentLanguage; // return View("Detail", model); //} private void SetInformation(string region_cd, string area_cd, string str_wed_date, string item_type, string item_cd = null) { region_cd = TypeHelper.GetStr(region_cd).ToUpper(); area_cd = TypeHelper.GetStr(area_cd).ToUpper(); str_wed_date = TypeHelper.GetStr(str_wed_date).ToUpper(); item_type = TypeHelper.GetStr(item_type).ToUpper(); item_cd = TypeHelper.GetStr(item_cd).ToUpper(); //CurrentRegionInfo //this.CurrentRegionInfo.CurrentLocation = region_cd; this.CurrentRegionInfo.CurrentDestination = region_cd; SetCurrentRegionInfo(); DateTime wed_date; if (!DateTime.TryParseExact(str_wed_date, "yyyyMMdd", null, DateTimeStyles.None, out wed_date)) { wed_date = RegionConfig.GetRegionToday(region_cd).AddMonths(2); } //現在日(現地時間)から3日後より前の日付は指定不可とする。 var min_date = RegionConfig.GetRegionToday(region_cd).AddDays(3); if (wed_date < min_date) { wed_date = min_date; } //CurrentSelectItem this.CurrentSelectItem.area_cd = area_cd; this.CurrentSelectItem.wed_date = wed_date; this.CurrentSelectItem.min_date = min_date; this.CurrentSelectItem.item_type = item_type; this.CurrentSelectItem.item_cd = item_cd; Session[Constants.SSKEY_SELECT_ITEM] = this.CurrentSelectItem; }
protected override void OnActionExecuting(ActionExecutingContext filterContext) { if (!filterContext.IsChildAction) { //メンテナンス中の場合、メンテナンス中画面に遷移 var maintenance_file_name = TypeHelper.GetStrTrim(ConfigurationManager.AppSettings["MaintenanceFileName"]); if (System.IO.File.Exists(GetMaintenanceFilePath() + maintenance_file_name)) { var url = TypeHelper.GetStrTrim(ConfigurationManager.AppSettings["BaseURL"]); if (!url.EndsWith("/")) { url += "/"; } url += maintenance_file_name; filterContext.Result = RedirectToLocal(url); return; } } if (User != null && User.Identity != null && User.Identity.IsAuthenticated) { //LoginUserをセッションからインスタンス変数にセット。 _loginUser = Session[Constants.SSKEY_LOGIN_USER] as CAccount; if (_loginUser == null) { //セッションから取得出来ない場合はDBから読み込んでセッションにセット。 var userEmail = User.Identity.GetUserId(); var repo = new CAccountRepository(); _loginUser = repo.FindById(userEmail); if (_loginUser == null) { AuthenticationManager.SignOut(); } Session[Constants.SSKEY_LOGIN_USER] = _loginUser; } } //RegionInfoをセッションからインスタンス変数にセット。(無ければ生成してセット。) if (Session[Constants.SSKEY_CURRENT_REGION] != null && Session[Constants.SSKEY_CURRENT_REGION] is RegionInfo) { _currentRegion = Session[Constants.SSKEY_CURRENT_REGION] as RegionInfo; } if (_currentRegion == null) { _currentRegion = new RegionInfo(); _currentRegion.CurrentDestination = TypeHelper.GetStrTrim(ConfigurationManager.AppSettings["DefaultRegion"]); } Session[Constants.SSKEY_CURRENT_REGION] = _currentRegion; SetCurrentRegionInfo(); //表示言語がセッションから取得出来ない場合はCookieから取得する。 if (String.IsNullOrEmpty(_currentRegion.CurrentLanguage)) { var cookie = Request.Cookies.Get(Constants.COOKIE_LANG); //Cookieがセットされており、かつ値が'J'または'E'のいずれかであればそれを保持する。J,E以外の不正な値は無視する。 if (cookie != null && !string.IsNullOrEmpty(cookie.Value) && "JE".Contains(cookie.Value) && cookie.Value.Length == 1) { _currentRegion.CurrentLanguage = cookie.Value; } } //表示言語がSessionにもCookieにも設定されていない場合はブラウザの言語設定(Accept-Languageヘッダ)を反映する。 // 1. 言語指定が一つも無い場合は日本語。(検索エンジンのロボットなど) // 2. 'ja*'があれば日本語。 // 3. 上記以外の場合は英語。 if (String.IsNullOrEmpty(_currentRegion.CurrentLanguage)) { var is_japan = (Request.UserLanguages == null) || Request.UserLanguages.Any(i => i.StartsWith("ja")); _currentRegion.CurrentLanguage = is_japan ? Constants.LANGUAGEKEY_JAPANESE : Constants.LANGUAGEKEY_ENGLISH; } //selectItemをセッションからインスタンス変数にセット。 if (Session[Constants.SSKEY_SELECT_ITEM] != null && Session[Constants.SSKEY_SELECT_ITEM] is CurrentItemInfo) { _selectItem = Session[Constants.SSKEY_SELECT_ITEM] as CurrentItemInfo; } if (_selectItem == null) { _selectItem = new CurrentItemInfo(); // _selectItem.area_cd = TypeHelper.GetStrTrim(ConfigurationManager.AppSettings["DefaultArea"]); // this.CurrentSelectItem.wed_date = RegionConfig.GetRegionToday(_currentRegion.CurrentDestination).AddMonths(2); this.CurrentSelectItem.wed_date = RegionConfig.GetRegionToday(_currentRegion.CurrentDestination).AddMonths(2); } Session[Constants.SSKEY_SELECT_ITEM] = _selectItem; ////LoginUser, RegionInfoをViewBagに格納。(Viewから使いやすい様に。) //ViewBag.CurrentLoginUser = _loginUser; //ViewBag.CurrentRegionInfo = _currentRegion; //ViewBag.CurrentSelectItem = _selectItem; //ViewBag.ClientIP = this.GetClientIPAddress(); base.OnActionExecuting(filterContext); }
void OnEnable() { m_config = target as RegionConfig; }
public Region(RegionConfig config) { }
private CBooking EditCBooking( CustomerItem item, int account_id, string c_num, short quantity, DateTime wed_date, DateTime?wed_time, bool is_reserve, CustomerItem currentItem) { //TrfItemDao.ItemInfo型からCBooking型にコピー var booking = new CBooking(); booking.item_cd = item.item_cd; booking.item_name = item.item_name; booking.account_id = account_id; booking.c_num = c_num; booking.area_cd = item.area_cd; //booking.area_name = this.CurrentRegionInfo.CurrentLanguage == "J" ? RegionConfig.GetAreaNameJpn(this.CurrentRegionInfo.CurrentDestination, item.area_cd) : RegionConfig.GetAreaName(this.CurrentRegionInfo.CurrentDestination, item.area_cd); string agent_cd = TypeHelper.GetStrTrim(ConfigurationManager.AppSettings["BookingAgentCd"]); string sub_agent_cd = TypeHelper.GetStrTrim(ConfigurationManager.AppSettings["BookingSubAgentCd"]); booking.agent_cd = agent_cd; booking.sub_agent_cd = sub_agent_cd; booking.item_type = item.item_type; booking.wed_date = wed_date; booking.quantity = quantity; booking.price = item.price.HasValue ? item.price.Value : (Decimal)0; booking.price_new = booking.price; booking.price_type = item.price_type.HasValue ? item.price_type.Value : (short)0; booking.price_cur = item.price_currency; booking.price_cur_new = booking.price_cur; //通貨表記 booking.curfmt_withsymbol = RegionConfig.GetCurrencyFormatWithSymbol(this.CurrentRegionInfo.CurrentDestination); if (String.IsNullOrEmpty(booking.curfmt_withsymbol)) { booking.curfmt_withsymbol = booking.price_cur_new + RegionConfig.GetCurrencyFormat(this.CurrentRegionInfo.CurrentDestination); } booking.cnt_picture_s = item.cnt_picture_s; booking.image_upload_date = item.image_upload_date; booking.service_date = wed_date; booking.service_time = wed_time; booking.rcp_private_room = false; booking.rcp_room_id = 0; booking.payment_status = CBooking.PAYSTATUS_INIT; //booking.fixed_qty = item.fixed_qty; booking.church_cd = item.church_cd; booking.reserve_pkg = is_reserve; if (booking.item_type == "DVD") { booking.dvd_menucolor = currentItem.alb_cover; } else { booking.alb_cover = currentItem.alb_cover; } booking.alb_mount = currentItem.alb_mount; booking.alb_type = currentItem.alb_type; booking.last_person = Constants.LAST_PERSON; booking.app_cd = CBooking.APPCD_WATABECOM_PC; //watabe.comのPC向けサイト return(booking); }
public override void OnActionExecuting(ActionExecutingContext filterContext) { if (filterContext.IsChildAction) { return; } if (filterContext.RequestContext == null) { return; } if (filterContext.RequestContext.HttpContext == null) { return; } if (filterContext.RequestContext.HttpContext.Session == null) { return; } ////Actionメソッドに[AjaxUserSessionFilter]属性が付いている場合はRegionFilter属性は無視する。 //bool skip = filterContext.ActionDescriptor.IsDefined(typeof(AjaxUserSessionFilterAttribute), inherit: true); //Ajaxリクエストの場合はRegionFilter属性は無視する。 bool skip = filterContext.HttpContext.Request.IsAjaxRequest(); if (skip) { return; } RegionInfo currentRegion = filterContext.RequestContext.HttpContext.Session[Constants.SSKEY_CURRENT_REGION] as RegionInfo; if (currentRegion == null) { return; } string currentServerLocation = RegionConfig.GetServerLocation(); //if (_regionRestriction == RegionRestriction.JapanOnly) { // if (!RegionConfig.REGION_ALL.Equals(currentServerLocation)) { // //現地側Webサーバーで動いている場合は日本側へ飛ばす。 // SetRedirectResult(RegionConfig.REGION_ALL, filterContext); // return; // } // else { // //日本側サーバーで動いている場合は単にcurrentLocationをALLにする。 // //if (!RegionConfig.REGION_ALL.Equals(currentRegion.CurrentLocation)) { // // currentRegion.CurrentLocation = RegionConfig.REGION_ALL; // //} // } //} // if (_regionRestriction == RegionRestriction.DestinationsOnly // && RegionConfig.REGION_ALL.Equals(currentRegion.CurrentLocation) // && String.IsNullOrEmpty(currentRegion.CurrentDestination)) { // string base_url = RegionConfig.GetRegionAttr(RegionConfig.REGION_ALL, "base_url"); // if (base_url.EndsWith("/")) base_url = base_url.TrimEnd("/".ToCharArray()); // string to_url = base_url + "/Home/SelectRegion"; // to_url += "?ReturnUrl=" + filterContext.RequestContext.HttpContext.Request.Url.PathAndQuery; // filterContext.Result = new RedirectResult(to_url); // return; // } // if (_regionRestriction == RegionRestriction.SpecificRegion // && !String.IsNullOrEmpty(_region_cd) // && _region_cd.Equals(currentRegion.CurrentLocation)) { // string toServerLocation = RegionConfig.GetRegionAttr(_region_cd, "server_location"); // if (currentServerLocation.Equals(toServerLocation)) { // currentRegion.CurrentLocation = _region_cd; // currentRegion.CurrentDestination = _region_cd; // filterContext.RequestContext.HttpContext.Session[Constants.SSKEY_CURRENT_REGION] = currentRegion; // } // else { // SetRedirectResult(_region_cd, filterContext); // } // } }