public static string Display(this SystemArea value) { var compare = new ResourceManager("SystemArea", Assembly.GetExecutingAssembly()) .GetString("SystemArea_" + value); return(string.IsNullOrEmpty(compare) ? value.ToString() : compare); }
private _BaiTuoAccountInfo GetInfo(PlatSystem platSystem, string areaCity) { _BaiTuoAccountInfo _BaiTuoAccount = new _BaiTuoAccountInfo(); if (platSystem == null) { throw new CreateInterfaceOrderException("平台开关没有设置!"); } string defaultCity = platSystem.SystemBigArea.DefaultCity; //获取区域参数 SystemArea systemArea = platSystem.SystemBigArea.SystemAreas.Where(p => p.City == areaCity).FirstOrDefault(); if (systemArea == null) { systemArea = platSystem.SystemBigArea.SystemAreas.Where(p => p.City == defaultCity).FirstOrDefault(); } if (systemArea == null) { throw new CreateInterfaceOrderException(string.Format("没有找到区域为:{0}或默认区域{1}的接口配置项", areaCity, defaultCity)); } //参数集合 List <AreaParameter> areaParameterList = systemArea.Parameters; _BaiTuoAccount._baiTuoAccout = areaParameterList.Where(p => string.Equals(p.Name, "_baiTuoAccout", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _BaiTuoAccount._baiTuoPassword = areaParameterList.Where(p => string.Equals(p.Name, "_baiTuoPassword", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _BaiTuoAccount._baiTuoAg = areaParameterList.Where(p => string.Equals(p.Name, "_baiTuoAg", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _BaiTuoAccount._PayWay = areaParameterList.Where(p => string.Equals(p.Name, "_PayWay", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _BaiTuoAccount._NotifyUrl = areaParameterList.Where(p => string.Equals(p.Name, "_NotifyUrl", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _BaiTuoAccount._IsChangePNRCP = areaParameterList.Where(p => string.Equals(p.Name, "_IsChangePNRCP", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _BaiTuoAccount._LinkMan = areaParameterList.Where(p => string.Equals(p.Name, "_LinkMan", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _BaiTuoAccount._LinkManPhone = areaParameterList.Where(p => string.Equals(p.Name, "_LinkManPhone", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; return(_BaiTuoAccount); }
private _TodayAccountInfo GetInfo(PlatSystem platSystem, string areaCity) { _TodayAccountInfo _TodayAccount = new _TodayAccountInfo(); if (platSystem == null) { throw new CreateInterfaceOrderException("平台开关没有设置!"); } string defaultCity = platSystem.SystemBigArea.DefaultCity; //获取区域参数 SystemArea systemArea = platSystem.SystemBigArea.SystemAreas.Where(p => p.City == areaCity).FirstOrDefault(); if (systemArea == null) { systemArea = platSystem.SystemBigArea.SystemAreas.Where(p => p.City == defaultCity).FirstOrDefault(); } if (systemArea == null) { throw new CreateInterfaceOrderException(string.Format("没有找到区域为:{0}或默认区域{1}的接口配置项", areaCity, defaultCity)); } //参数集合 List <AreaParameter> areaParameterList = systemArea.Parameters; _TodayAccount._todayAccout = areaParameterList.Where(p => string.Equals(p.Name, "_todayAccout", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _TodayAccount._todayAccout2 = areaParameterList.Where(p => string.Equals(p.Name, "_todayAccout2", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _TodayAccount._PayWay = areaParameterList.Where(p => string.Equals(p.Name, "_PayWay", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; //_TodayAccount._JinriGYCode = areaParameterList.Where(p => string.Equals(p.Name, "_JinriGYCode", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _TodayAccount._privateKey = areaParameterList.Where(p => string.Equals(p.Name, "_privateKey", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; return(_TodayAccount); }
private _YeeXingAccountInfo GetInfo(PlatSystem platSystem, string areaCity) { _YeeXingAccountInfo _YeeXingAccount = new _YeeXingAccountInfo(); if (platSystem == null) { throw new CreateInterfaceOrderException("平台开关没有设置!"); } string defaultCity = platSystem.SystemBigArea.DefaultCity; //获取区域参数 SystemArea systemArea = platSystem.SystemBigArea.SystemAreas.Where(p => p.City == areaCity).FirstOrDefault(); if (systemArea == null) { systemArea = platSystem.SystemBigArea.SystemAreas.Where(p => p.City == defaultCity).FirstOrDefault(); } if (systemArea == null) { throw new CreateInterfaceOrderException(string.Format("没有找到区域为:{0}或默认区域{1}的接口配置项", areaCity, defaultCity)); } //参数集合 List <AreaParameter> areaParameterList = systemArea.Parameters; _YeeXingAccount._yeeXingAccout = areaParameterList.Where(p => string.Equals(p.Name, "_yeeXingAccout", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _YeeXingAccount._yeeXingAccout2 = areaParameterList.Where(p => string.Equals(p.Name, "_yeeXingAccout2", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _YeeXingAccount._yeeXingNotifyUrl = areaParameterList.Where(p => string.Equals(p.Name, "_yeeXingNotifyUrl", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _YeeXingAccount._IsChangePNRCP = areaParameterList.Where(p => string.Equals(p.Name, "_IsChangePNRCP", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _YeeXingAccount._PayWay = areaParameterList.Where(p => string.Equals(p.Name, "_PayWay", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _YeeXingAccount._privateKey = areaParameterList.Where(p => string.Equals(p.Name, "_privateKey", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; _YeeXingAccount._cancel_notify_url = areaParameterList.Where(p => string.Equals(p.Name, "_cancel_notify_url", StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Value; return(_YeeXingAccount); }
/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void RemoveData(object sender, CommandEventArgs e) { if (!string.IsNullOrEmpty(e.CommandArgument.ToString())) { DataTable dt = _AreaBLL.SelectSystemAreaForCity(e.CommandArgument.ToString()); SystemArea _SystemArea = new SystemArea(); _SystemArea.GA03001 = e.CommandArgument.ToString(); _SystemArea.GA03997 = 1; int num = Math.Abs(_AreaBLL.RemoveSystemArea(_SystemArea)); new Sinoo.Common.MessageShow().RemoveMessage(this, num, ""); if (num < 1) { return; } int CurrentPageIndex = this.AspNetPager1.CurrentPageIndex; //当前页 int PageCount = this.AspNetPager1.PageCount; //页总数 int RecordCount = this.AspNetPager1.RecordCount; //记录数 int PageSize = this.AspNetPager1.PageSize; //第页条数 int PageIndex = CurrentPageIndex == PageCount ? (PageCount * PageSize - RecordCount == (PageSize - 1) ? CurrentPageIndex - 1 : CurrentPageIndex) : CurrentPageIndex; InitData(PageIndex); } }
private void LoadFromModel(SystemArea model) { Description = model.Description; ParentId = model.ParentId; if (model.Parent != null) { Parent = new SystemAreaModel(model.Parent); } }
/// <summary> /// 初始化平台接口信息 /// </summary> public static void InitPlatSystem() { try { string _path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config", "platform.config"); if (SystemConsoSwitch.PlatSystems == null) { SystemConsoSwitch.PlatSystems = new List <PlatSystem>(); } SystemConsoSwitch.PlatSystems.Clear(); if (File.Exists(_path)) { var platFormService = StructureMap.ObjectFactory.GetInstance <PlatformCfgService>(); platFormService.GetPlatformConfigurationSection().Platforms.ForEach(p => { PlatSystem platSystem = new PlatSystem(); platSystem.B2B = p.b2bClose; platSystem.BSP = p.bspClose; platSystem.GetPolicyCount = p.ShowCount; platSystem.IssueTicketSpeed = p.IssueSpeed; platSystem.PlatfromCode = p.Name; platSystem.State = !p.IsClosed; if (platSystem.SystemBigArea == null) { platSystem.SystemBigArea = new SystemBigArea(); } platSystem.SystemBigArea.DefaultCity = p.Areas.DefaultCity; if (platSystem.SystemBigArea.SystemAreas == null) { platSystem.SystemBigArea.SystemAreas = new List <SystemArea>(); } p.Areas.Areas.ForEach(m => { SystemArea systemArea = new SystemArea(); systemArea.City = m.City; if (systemArea.Parameters == null) { systemArea.Parameters = new List <AreaParameter>(); } systemArea.Parameters.AddRange(m.Parameters.Select(n => new AreaParameter { Name = n.Name, Value = n.Value }) ); platSystem.SystemBigArea.SystemAreas.Add(systemArea); }); SystemConsoSwitch.PlatSystems.Add(platSystem); }); } } catch (Exception e) { Logger.WriteLog(LogType.ERROR, "初始化平台接口信息失败", e); } }
public string TranslateResponseCode(SystemResponseCode responseCode, SystemArea systemArea, int language, long auditUserId, string auditWorkstation) { if (responseCode == SystemResponseCode.SUCCESS) { return(""); } else { return("Somethinf bad happened"); } }
/// <summary> /// 更新数据 /// </summary> private void SaveData() { if (!string.IsNullOrEmpty(this.txtGA03002.Text)) { SystemArea _SystemArea = new SystemArea(); _SystemArea.GA03001 = Request.QueryString["GA03001"]; _SystemArea.GA03002 = this.txtGA03002.Text.Trim(); _SystemArea.GA03003 = this.drpProvince.SelectedValue; _SystemArea.GA03004 = this.txtGA03004.Text.Trim(); int num = Math.Abs(_AreaBLL.UpdateSystemArea(_SystemArea)); new Sinoo.Common.MessageShow().UpdateMessage(this, num , string.Format("location.href='{0}'", LinkReturn())); } }
/// <summary> /// 保存数据 /// </summary> private void SaveData() { if (!string.IsNullOrEmpty(this.txtGA03002.Text)) { string strid = _AreaBLL.CreateSystemAreaCityId(this.drpProvince.SelectedValue); //获取ID SystemArea _SystemArea = new SystemArea(); _SystemArea.GA03001 = strid; _SystemArea.GA03002 = this.txtGA03002.Text.Trim(); _SystemArea.GA03003 = this.drpProvince.SelectedValue; _SystemArea.GA03004 = this.txtGA03004.Text.Trim(); int num = Math.Abs(_AreaBLL.InsertSystemArea(_SystemArea)); new Sinoo.Common.MessageShow().InsertMessage(this, num, "DataClear()"); } }
/// <summary> /// 删除系统区域表资料 /// </summary> /// <param name="_GA03">实体类</param> /// <returns>影响行数</returns> public int RemoveSystemArea(SystemArea _SystemArea) { try { int num = Provider.ExecuteNonQuery("PRO_GA03", 1, new SqlParameter[] { new SqlParameter() { ParameterName = @"GA03001", Value = _SystemArea.GA03001, DbType = DbType.String }, new SqlParameter() { ParameterName = @"GA03002", Value = "", DbType = DbType.String }, new SqlParameter() { ParameterName = @"GA03003", Value = "", DbType = DbType.String }, new SqlParameter() { ParameterName = @"GA03004", Value = "", DbType = DbType.String }, new SqlParameter() { ParameterName = @"GA03997", Value = _SystemArea.GA03997, DbType = DbType.Int32 }, new SqlParameter() { ParameterName = @"Order", Value = "GA03_Remove", DbType = DbType.String } }); return(num); } catch (Exception ex) { throw ex; } }
/// <summary> /// 删除数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void RemoveData(object sender, CommandEventArgs e) { if (!string.IsNullOrEmpty(e.CommandArgument.ToString())) { DataTable dt = _AreaBLL.SelectSystemAreaForCity(e.CommandArgument.ToString()); if (dt.Rows.Count > 0) { Page.ClientScript.RegisterStartupScript(Page.GetType() , "message" , "<script language='javascript' defer> " + "alert('被删除省份存在关联的城市,请先删除城市后,再尝试删除该省份'); " + " </script>"); } else { SystemArea _SystemArea = new SystemArea(); _SystemArea.GA03001 = e.CommandArgument.ToString(); _SystemArea.GA03997 = 1; int num = Math.Abs(_AreaBLL.RemoveSystemArea(_SystemArea)); new Sinoo.Common.MessageShow().RemoveMessage(this, num, ""); if (num < 1) { return; } int CurrentPageIndex = this.AspNetPager1.CurrentPageIndex; //当前页 int PageCount = this.AspNetPager1.PageCount; //页总数 int RecordCount = this.AspNetPager1.RecordCount; //记录数 int PageSize = this.AspNetPager1.PageSize; //第页条数 int PageIndex = CurrentPageIndex == PageCount ? (PageCount * PageSize - RecordCount == (PageSize - 1) ? CurrentPageIndex - 1 : CurrentPageIndex) : CurrentPageIndex; InitData(PageIndex); } } }
public void RegisterArea(SystemArea area) { this.areasList.Add(area); }
public SystemAreaModel(SystemArea model) : base(model) { LoadFromModel(model); }