コード例 #1
0
        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);
        }
コード例 #2
0
    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);
    }
コード例 #3
0
 public void SubmitForm(PlatformEntity platformEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         platformEntity.Modify(keyValue);
         service.Update(platformEntity);
     }
     else
     {
         platformEntity.Create();
         service.Insert(platformEntity);
     }
 }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
        /// <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));
        }
コード例 #6
0
 public ActionResult SubmitForm(PlatformEntity platformEntity, string keyValue)
 {
     platformApp.SubmitForm(platformEntity, keyValue);
     return(Success("操作成功。"));
 }
コード例 #7
0
ファイル: IPTest_Login.cs プロジェクト: linml/Assets
    public void SwitchPlatform(PlatformEntity platform)
    {
        PlatformGameDefine.playform = platform;

        StartCoroutine(DoSwitchPlatform());
    }