private static T GetNew <T>() where T : class, IContent { var currentUserId = Guid.NewGuid(); var groupId = Guid.NewGuid(); var entity = new PlatformEntity(); entity.EntityTypeId = EntityHelper.GetEntityTypeId(typeof(T)); entity.GroupId = groupId; entity.OwnerUserId = currentUserId; var content = Activator.CreateInstance(typeof(T)) as T; content.Culture = "en"; content.VersionNumber = 1; content.IsCurrentVersion = true; content.CreatedByUserId = currentUserId; content.UpdatedByUserId = currentUserId; content.CreatedOn = DateTime.Now; content.UpdatedOn = content.CreatedOn; content.EntityId = entity.Id; content.Entity = entity; return(content); }
static int SwitchPlatform(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 2); IPTest_Login obj = (IPTest_Login)LuaScriptMgr.GetUnityObjectSelf(L, 1, "IPTest_Login"); PlatformEntity arg0 = (PlatformEntity)LuaScriptMgr.GetNetObject(L, 2, typeof(PlatformEntity)); obj.SwitchPlatform(arg0); return(0); }
public void SubmitForm(PlatformEntity platformEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { platformEntity.Modify(keyValue); service.Update(platformEntity); } else { platformEntity.Create(); service.Insert(platformEntity); } }
public PlatformModel(PlatformEntity platformEntity, BitmapImage bitmapImage = null) { foreach (var item in platformEntity.GetType().GetProperties()) { var itm = this.GetType().GetProperty(item.Name); if (itm != null) { itm.SetValue(this, item.GetValue(platformEntity)); } } BitmapImage = bitmapImage; if (bitmapImage != null) { Image = new ImageBrush(bitmapImage); } }
/// <summary> /// 加载类型 /// </summary> protected virtual void Remove() { if (string.IsNullOrEmpty(Request.QueryString["Id"])) { Response.Write("参数错误"); return; } var info = new PlatformEntity { Id = Request.QueryString["Id"].Convert <long>(), SaveType = SaveType.Remove }; Ioc.Resolve <IApplicationService, PlatformEntity>().Save(info); if (info.Errors == null || info.Errors.Count == 0) { Response.Write("操作成功"); return; } Response.Write(string.Format("操作失败:{0}", info.Errors.FirstOrDefault().Message)); }
public ActionResult SubmitForm(PlatformEntity platformEntity, string keyValue) { platformApp.SubmitForm(platformEntity, keyValue); return(Success("操作成功。")); }
public void SwitchPlatform(PlatformEntity platform) { PlatformGameDefine.playform = platform; StartCoroutine(DoSwitchPlatform()); }