public static int GetBuyer(string BuyerCode, PlatformType platformType) { OMS.Core.DoMain.BuyerType bt = OMS.Core.DoMain.BuyerType.find("BuyerCode='" + BuyerCode + "' and PlatformCode ='" + platformType.ToString() + "'").first(); if (bt == null) { bt = new Core.DoMain.BuyerType(); //不存在是的操作 bt.BuyerCode = BuyerCode; bt.PlatformCode = platformType.ToString(); bt.BuyCount++; bt.insert(); } else { bt.BuyCount++; bt.update(); } return bt.Id; }
public WorklistItem OpenWorklistItem(string userName, string shareUser, string sn, PlatformType platform, bool allocated) { try { ServiceContext context = new ServiceContext(); context.UserName = K2User.ApplySecurityLabel(shareUser); GetK2OpenConnection(context.UserName); SourceCode.Workflow.Client.WorklistItem clientItem = null; if (!string.IsNullOrEmpty(shareUser)) clientItem = conn.OpenSharedWorklistItem(shareUser, string.Empty, sn, platform.ToString(), allocated); else clientItem = conn.OpenWorklistItem(sn, platform.ToString(), allocated); WorklistItem item = ObjectConverter.ConvertToWFWorklistItem(context, clientItem); return item; } catch (Exception ex) { throw ex; } finally { conn.Close(); } }
private MQMessage GetMessage(String msgId, Guid id, PlatformType targetSys, bool isSinglePkg) { MQMessage msg = new MQMessage(); msg.HeaderUser.UserServiceId.Value = msgId; msg.HeaderMcd.McdType = MQMessage.MQHeaderMcd.Request; msg.HeaderUser.UserServiceStatus.Value = "0"; msg.HeaderUser.UserServiceGuage.Value = "0"; msg.HeaderUser.UserServiceGuageInfo.Value = ""; msg.HeaderUser.UserTaskCode.Value = ""; //msg.HeaderUser.UserUserId.Value = USER_CODE; msg.HeaderUser.UserDefined.Add(new MQParameter<string>("TARGETSYS", targetSys.ToString())); msg.HeaderUser.UserDefined.Add(new MQParameter<string>("PKGTYPE", isSinglePkg.ToString())); msg.HeaderUser.UserDefined.Add(new MQParameter<string>("GUID", id.ToString())); return msg; }
public override void Initialize(LayoutElementsContainer layout) { var proxy = (BuildTabProxy)Values[0]; _platform = proxy.Selector.Selected; var platformObj = proxy.PerPlatformOptions[_platform]; if (!platformObj.IsSupported) { layout.Label("This platform is not supported on this system.", TextAlignment.Center); } else if (platformObj.IsAvailable) { string name; switch (_platform) { case PlatformType.Windows: name = "Windows"; break; case PlatformType.XboxOne: name = "Xbox One"; break; case PlatformType.UWP: name = "Windows Store"; break; case PlatformType.Linux: name = "Linux"; break; case PlatformType.PS4: name = "PlayStation 4"; break; case PlatformType.XboxScarlett: name = "Xbox Scarlett"; break; case PlatformType.Android: name = "Android"; break; case PlatformType.Switch: name = "Switch"; break; case PlatformType.PS5: name = "PlayStation 5"; break; case PlatformType.Mac: name = "Mac"; break; default: name = CustomEditorsUtil.GetPropertyNameUI(_platform.ToString()); break; } var group = layout.Group(name); group.Object(new ReadOnlyValueContainer(platformObj)); _buildButton = layout.Button("Build").Button; _buildButton.Clicked += OnBuildClicked; } else { platformObj.OnNotAvailableLayout(layout); } }
public virtual bool PublishSymbols(DirectoryReference SymbolStoreDirectory, List <FileReference> Files, string Product, string BuildVersion = null) { CommandUtils.LogWarning("PublishSymbols() has not been implemented for {0}", PlatformType.ToString()); return(false); }
public virtual void StripSymbols(FileReference SourceFile, FileReference TargetFile) { if (SourceFile == TargetFile) { CommandUtils.LogWarning("StripSymbols() has not been implemented for {0}", PlatformType.ToString()); } else { CommandUtils.LogWarning("StripSymbols() has not been implemented for {0}; copying files", PlatformType.ToString()); File.Copy(SourceFile.FullName, TargetFile.FullName, true); } }
/// <summary> /// 获取全局唯一名称 /// </summary> /// <param name="platformType">PlatformType</param> /// <param name="apiBindAttrName">跨程序集的通用名称(如:CustomApi.SendText)</param> /// <returns></returns> private string GetGlobalName(PlatformType platformType, string apiBindAttrName) { return($"{platformType.ToString()}:{apiBindAttrName}");//TODO:生成全局唯一名称 }
private void MakeAtlas(PlatformType pt) { Texture2D[] texs = new Texture2D[_tex.Count]; int area = 0; for(int i =0; i < _tex.Count; i++) { texs[i] = _tex[i]; area += (texs[i].width * texs[i].height); } int imageSize = Mathf.ClosestPowerOfTwo((int)Mathf.Sqrt((int)(area * 1.15f))); Texture2D imgAtlas = new Texture2D (0, 0); AtlasInfo info = new AtlasInfo (); if(pt == PlatformType.ios) { imgAtlas = new Texture2D(imageSize,imageSize,TextureFormat.PVRTC_RGBA4,false); info = new AtlasInfo( imgAtlas.PackTextures(texs,2,imageSize)); } else if(pt == PlatformType.android) { imgAtlas = new Texture2D(imageSize,imageSize, TextureFormat.ASTC_RGBA_8x8,false); info = new AtlasInfo( imgAtlas.PackTextures(texs,2,imageSize)); } else if(pt == PlatformType.pc) { imgAtlas = new Texture2D(imageSize,imageSize, TextureFormat.DXT5,false); info = new AtlasInfo( imgAtlas.PackTextures(texs,2,imageSize)); } byte[] bytes = imgAtlas.EncodeToPNG(); if(!Directory.Exists(ProcessInfo.Path + "/" + pt.ToString())) { Directory.CreateDirectory (ProcessInfo.Path + "/" + pt.ToString()); } if(File.Exists(ProcessInfo.Path + "/" + pt.ToString() + "/" + ProcessInfo.FileName + ".png")) { File.Delete(ProcessInfo.Path + "/" + pt.ToString() + "/" + ProcessInfo.FileName + ".png"); } File.WriteAllBytes(ProcessInfo.Path + "/" + pt.ToString() + "/" + ProcessInfo.FileName + ".png", bytes); string infoJSON = JsonConvert.SerializeObject (info); /*StreamWriter sw = new StreamWriter (ProcessInfo.Path + "/" + pt.ToString() + "/" + ProcessInfo.FileName + ".txt"); sw.Write (infoJSON); sw.Close (); */ }
public ActionResult PaymentToOrders(string ids) { //红包数据 Dictionary <long, ShopBonusInfo> bonusGrantIds = new Dictionary <long, ShopBonusInfo>(); string url = "http://" + Request.Url.Host.ToString() + "/m-weixin/shopbonus/index/"; if (!string.IsNullOrEmpty(ids)) { string[] strIds = ids.Split(','); List <long> longIds = new List <long>(); foreach (string id in strIds) { longIds.Add(long.Parse(id)); } var result = PaymentHelper.GenerateBonus(longIds, Request.Url.Host.ToString()); foreach (var item in result) { bonusGrantIds.Add(item.Key, item.Value); } } ViewBag.Path = url; ViewBag.BonusGrantIds = bonusGrantIds; ViewBag.BaseAddress = "http://" + Request.Url.Host.ToString(); var orders = _iOrderService.GetTopOrders(int.MaxValue, CurrentUser.Id); //待评价 var queryModel = new OrderQuery() { Status = Model.OrderInfo.OrderOperateStatus.Finish, UserId = CurrentUser.Id, PageSize = int.MaxValue, PageNo = 1, Commented = false }; ViewBag.WaitingForComments = _iOrderService.GetOrders <OrderInfo>(queryModel).Total; var member = _iMemberService.GetMember(CurrentUser.Id); ViewBag.AllOrders = orders.Count(); ViewBag.WaitingForRecieve = orders.Count(item => item.OrderStatus == Model.OrderInfo.OrderOperateStatus.WaitReceiving); //获取待结算预约单数 ViewBag.WaitingForPay = orders.Count(item => item.OrderStatus == Model.OrderInfo.OrderOperateStatus.WaitPay); //获取待支付预约单数 var waitdelordnum = orders.Count(item => item.OrderStatus == Model.OrderInfo.OrderOperateStatus.WaitDelivery); //获取待发货预约单数 var fgwaitdelordnum = _iOrderService.GetFightGroupOrderByUser(CurrentUser.Id); ViewBag.WaitingForDelivery = waitdelordnum - fgwaitdelordnum; if (orders != null) { if (orders.Count() > 0) { var order = orders.FirstOrDefault(); if (order.OrderType == OrderInfo.OrderTypes.FightGroup) { var gpord = FightGroupApplication.GetOrder(order.Id); if (gpord != null) { return(Redirect(string.Format("/m-{0}/FightGroup/GroupOrderOk?orderid={1}", PlatformType.ToString(), order.Id))); } } } } return(View("~/Areas/Mobile/Templates/Default/Views/Member/Orders.cshtml")); }
/// <summary> /// 返回已经注册的第一个AppId /// </summary> /// <returns></returns> public static async Task <string> GetFirstOrDefaultAppIdAsync(PlatformType platformType) { string appId = null; switch (platformType) { case PlatformType.MP: appId = Senparc.Weixin.Config.SenparcWeixinSetting.WeixinAppId; break; case PlatformType.Open: appId = Senparc.Weixin.Config.SenparcWeixinSetting.WeixinAppId; break; case PlatformType.WxOpen: appId = Senparc.Weixin.Config.SenparcWeixinSetting.WxOpenAppId; break; case PlatformType.QY: break; case PlatformType.Work: break; default: throw new ArgumentOutOfRangeException($"未知的 PlatformType {nameof(platformType)}:{platformType.ToString()}"); break; } if (appId == null) { var firstBag = (await GetAllItemsAsync().ConfigureAwait(false)).FirstOrDefault() as IBaseContainerBag_AppId; appId = firstBag == null ? null : firstBag.AppId; } return(appId); }
public ActionResult Return(string id) { id = DecodePaymentId(id); string errorMsg = string.Empty; try { var payment = Core.PluginsManagement.GetPlugin <IPaymentPlugin>(id); var payInfo = payment.Biz.ProcessReturn(HttpContext.Request); if (payInfo != null) { var payTime = payInfo.TradeTime; var orderid = payInfo.OrderIds.FirstOrDefault(); var orderIds = _iOrderService.GetOrderPay(orderid).Select(item => item.OrderId).ToList(); ViewBag.OrderIds = string.Join(",", orderIds); _iOrderService.PaySucceed(orderIds, id, payInfo.TradeTime.Value, payInfo.TradNo, payId: orderid); string payStateKey = CacheKeyCollection.PaymentState(string.Join(",", orderIds)); //获取支付状态缓存键 Cache.Insert(payStateKey, true, 15); //标记为已支付 var order = _iOrderService.GetOrder(orderid); if (order != null) { if (order.OrderType == OrderInfo.OrderTypes.FightGroup) { var gpord = _iFightGroupService.GetOrder(orderid); if (gpord != null) { return(Redirect(string.Format("/m-{0}/FightGroup/GroupOrderOk?orderid={1}", PlatformType.ToString(), orderid))); } } } } } catch (Exception ex) { errorMsg = ex.Message; Core.Log.Error("移动端同步返回出错,支持方式:" + id, ex); } ViewBag.Error = errorMsg; return(View()); }
public ActionResult PaymentToOrders(string ids) { //红包数据 var bonusGrantIds = new Dictionary <long, Entities.ShopBonusInfo>(); string url = CurrentUrlHelper.CurrentUrlNoPort() + "/m-weixin/shopbonus/index/"; if (!string.IsNullOrEmpty(ids)) { string[] strIds = ids.Split(','); List <long> longIds = new List <long>(); foreach (string id in strIds) { longIds.Add(long.Parse(id)); } var result = PaymentHelper.GenerateBonus(longIds, Request.Host.ToString()); foreach (var item in result) { bonusGrantIds.Add(item.Key, item.Value); } } ViewBag.Path = url; ViewBag.BonusGrantIds = bonusGrantIds; ViewBag.Shops = ShopApplication.GetShops(bonusGrantIds.Select(p => p.Value.ShopId)); ViewBag.BaseAddress = CurrentUrlHelper.CurrentUrlNoPort(); var statistic = StatisticApplication.GetMemberOrderStatistic(CurrentUser.Id); ViewBag.WaitingForComments = statistic.WaitingForComments; ViewBag.AllOrders = statistic.OrderCount; ViewBag.WaitingForRecieve = statistic.WaitingForRecieve + OrderApplication.GetWaitConsumptionOrderNumByUserId(CurrentUser.Id); ViewBag.WaitingForPay = statistic.WaitingForPay; ViewBag.WaitingForDelivery = statistic.WaitingForDelivery; var order = OrderApplication.GetUserOrders(CurrentUser.Id, 1).FirstOrDefault(); if (order != null && order.OrderType == OrderInfo.OrderTypes.FightGroup) { var gpord = FightGroupApplication.GetOrder(order.Id); if (gpord != null) { return(Redirect(string.Format("/m-{0}/FightGroup/GroupOrderOk?orderid={1}", PlatformType.ToString(), order.Id))); } } return(View("~/Areas/Mobile/Templates/Default/Views/Member/Orders.cshtml")); }
public static HelperBase GetInstance(PlatformType type) { return GetInstance(type.ToString()); }
/// <summary> /// 返回已经注册的第一个AppId /// </summary> /// <returns></returns> public static string GetFirstOrDefaultAppId(PlatformType platformType) { string appId = null; switch (platformType) { case PlatformType.Apps: appId = Senparc.Toutiao.Config.SenparcToutiaoSetting.AppId; break; default: throw new ArgumentOutOfRangeException($"未知的 PlatformType {nameof(platformType)}:{platformType.ToString()}"); } if (appId == null) { var firstBag = GetAllItems().FirstOrDefault() as IBaseContainerBag_AppId; appId = firstBag == null ? null : firstBag.AppId; } return(appId); }
public IPlatform getPlatformFromType(PlatformType platformType) { if (!platformDictionary.ContainsKey(platformType)) { throw new Exception("PlatformType : " + platformType.ToString() + " is not defined"); } return platformDictionary[platformType]; }
public override void ExecuteBuild() { Log("************************* CopySharedCookedBuild"); // Parse the project filename (as a local path) string CmdLinePlatform = ParseParamValue("Platform", null); bool bOnlyCopyAssetRegistry = ParseParam("onlycopyassetregistry"); List <UnrealTargetPlatform> TargetPlatforms = new List <UnrealTargetPlatform>(); var PlatformNames = new List <string>(CmdLinePlatform.Split('+')); foreach (var PlatformName in PlatformNames) { // Look for dependent platforms, Source_1.Dependent_1+Source_2.Dependent_2+Standalone_3 var SubPlatformNames = new List <string>(PlatformName.Split('.')); foreach (var SubPlatformName in SubPlatformNames) { UnrealTargetPlatform NewPlatformType = (UnrealTargetPlatform)Enum.Parse(typeof(UnrealTargetPlatform), SubPlatformName, true); TargetPlatforms.Add(NewPlatformType); } } foreach (var PlatformType in TargetPlatforms) { SharedCookedBuild.CopySharedCookedBuildForTarget(ProjectFile.FullName, PlatformType, PlatformType.ToString(), bOnlyCopyAssetRegistry); SharedCookedBuild.WaitForCopy(); } /* * // Build the list of paths that need syncing * List<string> SyncPaths = new List<string>(); * if(bIsProjectFile) * { * SyncPaths.Add(CommandUtils.CombinePaths(PathSeparator.Slash, BranchRoot, "*")); * SyncPaths.Add(CommandUtils.CombinePaths(PathSeparator.Slash, BranchRoot, "Engine", "...")); * SyncPaths.Add(CommandUtils.CombinePaths(PathSeparator.Slash, CommandUtils.GetDirectoryName(ProjectFileRecord.DepotFile), "...")); * } * else * { * SyncPaths.Add(CommandUtils.CombinePaths(PathSeparator.Slash, CommandUtils.GetDirectoryName(ProjectFileRecord.DepotFile), "...")); * } * * // Sync them down * foreach(string SyncPath in SyncPaths) * { * Log("Syncing {0}@{1}", SyncPath, CL); * P4.Sync(String.Format("{0}@{1}", SyncPath, CL)); * } * * // Get the name of the editor target * string EditorTargetName = "UE4Editor"; * if(bIsProjectFile) * { * string SourceDirectoryName = Path.Combine(Path.GetDirectoryName(ProjectFileName), "Source"); * if(Directory.Exists(SourceDirectoryName)) * { * foreach(string EditorTargetFileName in Directory.EnumerateFiles(SourceDirectoryName, "*Editor.Target.cs")) * { * EditorTargetName = Path.GetFileNameWithoutExtension(Path.GetFileNameWithoutExtension(EditorTargetFileName)); * break; * } * } * } * * // Build everything * UnrealTargetPlatform CurrentPlatform = HostPlatform.Current.HostEditorPlatform; * * UE4Build.BuildAgenda Agenda = new UE4Build.BuildAgenda(); * Agenda.AddTarget("UnrealHeaderTool", CurrentPlatform, UnrealTargetConfiguration.Development); * Agenda.AddTarget(EditorTargetName, CurrentPlatform, UnrealTargetConfiguration.Development, ProjectFileName.EndsWith(".uproject", StringComparison.InvariantCultureIgnoreCase)? new FileReference(ProjectFileName) : null); * Agenda.AddTarget("ShaderCompileWorker", CurrentPlatform, UnrealTargetConfiguration.Development); * Agenda.AddTarget("UnrealLightmass", CurrentPlatform, UnrealTargetConfiguration.Development); * Agenda.AddTarget("CrashReportClient", CurrentPlatform, UnrealTargetConfiguration.Shipping); * * UE4Build Build = new UE4Build(this); * Build.UpdateVersionFiles(ActuallyUpdateVersionFiles: true, ChangelistNumberOverride: CL); * Build.Build(Agenda, InUpdateVersionFiles: false);*/ }
///// <summary> ///// ///// </summary> ///// <returns></returns> private MQMessage GetMessage(String msgId, Guid id, PlatformType targetSys, bool isSinglePkg, String sourceIP, String definedError) { MQMessage msg = new MQMessage(); msg.HeaderUser.UserServiceId.Value = msgId; msg.HeaderMcd.McdType = MQMessage.MQHeaderMcd.Request; //msg.HeaderUser.UserBaseDate.Value = DateTimeHelper.NowDateToString; //msg.HeaderUser.UserServiceId.Value = id.ToString(); msg.HeaderUser.UserServiceStatus.Value = "0"; msg.HeaderUser.UserServiceGuage.Value = "0"; msg.HeaderUser.UserServiceGuageInfo.Value = ""; msg.HeaderUser.UserTaskCode.Value = ""; msg.HeaderUser.UserUserId.Value = ""; msg.HeaderUser.UserDefined.Add(new MQParameter<string>("TARGETSYS", targetSys.ToString())); msg.HeaderUser.UserDefined.Add(new MQParameter<string>("PKGTYPE", isSinglePkg.ToString())); msg.HeaderUser.UserDefined.Add(new MQParameter<string>("GUID", id.ToString())); msg.HeaderUser.UserDefined.Add(new MQParameter<string>("ERROR", definedError)); msg.HeaderUser.UserDefined.Add(new MQParameter<string>("IP", sourceIP)); return msg; }
public override string SetLabel() { return(platformType.ToString()); }