Esempio n. 1
0
        public void Update()
        {
            SlickCMSDataContext dc = SlickCMSDataContext.Create();

            Property property = dc.Properties.Single(p => p.PropertyID == this.PropertyID);

            property.Reference       = this.Reference;
            property.SaleType        = this.SaleType;
            property.PropertyType    = this.PropertyType;
            property.Address1        = this.Address1;
            property.Address2        = this.Address2;
            property.Address3        = this.Address3;
            property.Address4        = this.Address4;
            property.PostCode        = this.PostCode;
            property.Price           = this.Price;
            property.Parking         = this.Parking;
            property.Garages         = this.Garages;
            property.Receptions      = this.Receptions;
            property.Bedrooms        = this.Bedrooms;
            property.Bathrooms       = this.Bathrooms;
            property.Garden          = this.Garden;
            property.Pets            = this.Pets;
            property.Conservatory    = this.Conservatory;
            property.Furnishings     = this.Furnishings;
            property.Summary         = this.Summary;
            property.FullDescription = this.FullDescription;
            property.KeyFeatures     = this.KeyFeatures;
            property.RightMoveURL    = this.RightMoveURL;
            property.DateModified    = DateTime.Now;
            property.Published       = this.Published;
            property.Tagline         = this.Tagline;

            dc.SubmitChanges();
            dc.Dispose();
        }
Esempio n. 2
0
        public void Delete()
        {
            SlickCMSDataContext dc = SlickCMSDataContext.Create();

            dc.ExecuteCommand("Delete From Documents Where DocumentID = {0}", this.DocumentID);
            dc.Dispose();
        }
Esempio n. 3
0
        /// <summary>
        /// Deletes an existing Comment
        /// </summary>
        public void Delete()
        {
            SlickCMSDataContext dc = SlickCMSDataContext.Create();

            dc.Comments.DeleteOnSubmit(this);
            dc.SubmitChanges();
            dc.Dispose();
        }
Esempio n. 4
0
        private void LogToDatabase()
        {
            SlickCMSDataContext db = SlickCMSDataContext.Create();

            db.Logs.InsertOnSubmit(this);
            db.SubmitChanges();
            db.Dispose();
        }
Esempio n. 5
0
        public void Insert()
        {
            this.Uploaded = DateTime.Now;

            SlickCMSDataContext dc = SlickCMSDataContext.Create();

            dc.Images.InsertOnSubmit(this);
            dc.SubmitChanges();
            dc.Dispose();
        }
Esempio n. 6
0
        /// <summary>
        /// Creates a single Post
        /// </summary>
        public void Insert()
        {
            //set system generated items:
            this.DateCreated  = DateTime.Now;
            this.DateModified = DateTime.Now;

            SlickCMSDataContext dc = SlickCMSDataContext.Create();

            dc.Posts.InsertOnSubmit(this);
            dc.SubmitChanges();
            dc.Dispose();
        }
Esempio n. 7
0
        /// <summary>
        /// Inserts a new User
        /// </summary>
        public void Insert()
        {
            //set system generated items:
            this.UUID         = System.Guid.NewGuid();
            this.DateCreated  = DateTime.Now;
            this.DateModified = DateTime.Now;
            this.Password     = Hash.GenerateHash(this.Password, Hash.HashType.MD5);

            SlickCMSDataContext dc = SlickCMSDataContext.Create();

            dc.Users.InsertOnSubmit(this);
            dc.SubmitChanges();
            dc.Dispose();
        }
Esempio n. 8
0
        public void Update()
        {
            SlickCMSDataContext dc = SlickCMSDataContext.Create();

            Image image = dc.Images.Single(i => i.ImageID == this.ImageID);

            image.Alt      = this.Alt;
            image.Title    = this.Title;
            image.Caption  = this.Caption;
            image.Main     = this.Main;
            image.Rank     = this.Rank;
            image.IsBanner = this.IsBanner;
            image.PostID   = this.PostID;

            dc.SubmitChanges();
            dc.Dispose();
        }
Esempio n. 9
0
        public void Update()
        {
            SlickCMSDataContext dc = SlickCMSDataContext.Create();

            Document document = dc.Documents.Single(d => d.DocumentID == this.DocumentID);

            document.Name       = this.Name;
            document.Extension  = this.Extension;
            document.Caption    = this.Caption;
            document.PropertyID = this.PropertyID;
            document.Type       = this.Type;
            document.Published  = this.Published;
            document.Rank       = this.Rank;

            dc.SubmitChanges();
            dc.Dispose();
        }
Esempio n. 10
0
        /// <summary>
        /// Updates an existing Comment
        /// </summary>
        public void Update()
        {
            SlickCMSDataContext dc = SlickCMSDataContext.Create();

            Comment comment = dc.Comments.Single(c => c.CommentID == this.CommentID);

            comment.PostID          = this.PostID;
            comment.UserID          = this.UserID;
            comment.Name            = this.Name;
            comment.Email           = this.Email;
            comment.URL             = this.URL;
            comment.IP              = this.IP;
            comment.HTTP_USER_AGENT = this.HTTP_USER_AGENT;
            comment.Content         = this.Content;
            comment.DateModified    = DateTime.Now;
            comment.Published       = this.Published;

            dc.SubmitChanges();
            dc.Dispose();
        }
Esempio n. 11
0
        /// <summary>
        /// Updates an existing User
        /// </summary>
        public void Update()
        {
            SlickCMSDataContext dc = SlickCMSDataContext.Create();

            User user = dc.Users.Single(u => u.UserID == this.UserID);

            this.Password = Hash.GenerateHash(this.Password, Hash.HashType.MD5);

            user.Name         = this.Name;
            user.Email        = this.Email;
            user.Password     = this.Password;
            user.URL          = this.URL;
            user.IP           = this.IP;
            user.Biography    = this.Biography;
            user.DateModified = DateTime.Now;
            user.Active       = this.Active;
            user.LoginFails   = this.LoginFails;
            user.RoleID       = this.RoleID;

            dc.SubmitChanges();
            dc.Dispose();
        }
Esempio n. 12
0
        /// <summary>
        /// Updates an existing Post
        /// </summary>
        public void Update()
        {
            SlickCMSDataContext dc = SlickCMSDataContext.Create();

            //Post postToUpdate = GetPost(this.PostID);
            Post post = dc.Posts.Single(p => p.PostID == this.PostID);

            post.UserID       = this.UserID;
            post.Title        = this.Title;
            post.URL          = this.URL;
            post.Summary      = this.Summary;
            post.Content      = this.Content;
            post.Search       = this.Search;
            post.DateModified = DateTime.Now;
            post.Published    = this.Published;
            post.Pageable     = this.Pageable;
            post.ParentPage   = this.ParentPage;
            post.Rank         = this.Rank;
            post.Deleted      = this.Deleted;
            post.Archive      = this.Archive;

            dc.SubmitChanges();
            dc.Dispose();
        }