Example #1
0
    private void InsertOrUpdate(User @new, User old)
    {
        ((IPersistable)@new).OnSaving();

            DataHelper.StoreObject(@new, @new.UUID, ModelExtensions.UserDataType);

            ((IPersistable)@new).OnSaved();
    }
Example #2
0
        public static SiteUserEntity ToEntity(this Kooboo.CMS.Sites.Models.User user, SiteUserEntity entity = null)
        {
            if (entity == null)
            {
                entity = new SiteUserEntity();
            }
            entity.SiteName = user.Site.Name;
            entity.UserName = user.UserName;

            entity.ObjectXml = DataContractSerializationHelper.SerializeAsXml(user);

            return(entity);
        }
Example #3
0
        public static Kooboo.CMS.Sites.Models.User ToUser(this SiteUserEntity entity)
        {
            if (entity == null)
            {
                return null;
            }
            var dummy = new Kooboo.CMS.Sites.Models.User() { Site = new Site(entity.SiteName), UserName = entity.UserName };

            var user = DataContractSerializationHelper.DeserializeFromXml<Kooboo.CMS.Sites.Models.User>(entity.ObjectXml);

            ((IPersistable)user).Init(dummy);

            return user;
        }
Example #4
0
        public static Kooboo.CMS.Sites.Models.User ToUser(this SiteUserEntity entity)
        {
            if (entity == null)
            {
                return(null);
            }
            var dummy = new Kooboo.CMS.Sites.Models.User()
            {
                Site = new Site(entity.SiteName), UserName = entity.UserName
            };

            var user = DataContractSerializationHelper.DeserializeFromXml <Kooboo.CMS.Sites.Models.User>(entity.ObjectXml);

            ((IPersistable)user).Init(dummy);

            return(user);
        }
Example #5
0
 public DataFilePath(User user)
 {
     this.PhysicalPath = Path.Combine(GetBasePath(user.Site), user.UserName + ".config");
 }