Beispiel #1
0
 public void Publish(BasePublishableEntity draft, PublicationStatus status, Base.BaseEntity originalEntity = null)
 {
     if (((DraftProduct)draft).OriginalProduct == null)
     {
         ((DraftProduct)draft).OriginalProduct = new Product()
         {
             Category          = this.Category,
             FullDescription   = this.FullDescription,
             Supplier          = this.Supplier,
             Name              = this.Name,
             Price             = this.Price,
             ShortDescription  = this.ShortDescription,
             urlImage          = this.urlImage,
             PublicationStatus = status
         };
     }
     else
     {
         Product original = (Product)originalEntity;
         original.PublicationStatus = new Entities.PublicationStatus();
         original.Supplier          = this.Supplier;
         original.FullDescription   = this.FullDescription;
         original.Category          = this.Category;
         original.Name              = this.Name;
         original.Price             = this.Price;
         original.ShortDescription  = this.ShortDescription;
         original.urlImage          = this.urlImage;
         original.PublicationStatus = status;
     }
 }
Beispiel #2
0
        public void Publish(BasePublishableEntity draft, PublicationStatus status, BaseEntity originalEntity = null)
        {
            if (((DraftTable)draft).OriginalTable == null)
            {
                ((DraftTable)draft).OriginalTable = new Table()
                {
                    Name = this.Name,
                    Capacity = this.Capacity,
                    TableNumber = this.TableNumber,
                    PublicationStatus = status,
                    Password = this.Password

                };
            }
            else
            {
                Table original = (Table)originalEntity;
                original.PublicationStatus = new Entities.PublicationStatus();
                original.PublicationStatus = status;
                original.Name = this.Name;
                original.TableNumber = this.TableNumber;
                original.Capacity = this.Capacity;
                original.Password = this.Password;
            }
        }
Beispiel #3
0
 public void Publish(BasePublishableEntity draft, PublicationStatus status, Base.BaseEntity originalEntity = null)
 {
     if (((ProdutoRascunho)draft).ProdutoOriginal == null)
     {
         ((ProdutoRascunho)draft).ProdutoOriginal = new Produto()
         {
             Category          = this.CategoriaDoProduto,
             FullDescription   = this.FullDescription,
             Manufactor        = this.Fornecedor,
             Name              = this.Name,
             Price             = this.Price,
             ShortDescription  = this.ShortDescription,
             urlImage          = this.urlImage,
             PublicationStatus = status
         };
     }
     else
     {
         Produto original = (Produto)originalEntity;
         original.PublicationStatus = new Entities.PublicationStatus();
         original.Manufactor        = this.Fornecedor;
         original.FullDescription   = this.FullDescription;
         original.Category          = this.CategoriaDoProduto;
         original.Name              = this.Name;
         original.Price             = this.Price;
         original.ShortDescription  = this.ShortDescription;
         original.urlImage          = this.urlImage;
         original.PublicationStatus = status;
     }
 }
Beispiel #4
0
 public void Publish(BasePublishableEntity draft, PublicationStatus status, BaseEntity originalEntity = null)
 {
     if (((DraftReview)draft).OriginReview == null)
     {
         ((DraftReview)draft).OriginReview = new Review()
         {
             Product           = this.Product,
             PublicationStatus = status,
             ReviewText        = this.ReviewText
         };
     }
     else
     {
         Review original = (Review)originalEntity;
         original.PublicationStatus = new Entities.PublicationStatus();
         original.PublicationStatus = status;
         original.Product           = this.Product;
         original.ReviewText        = this.ReviewText;
     }
 }
Beispiel #5
0
 public void Publish(BasePublishableEntity draft, PublicationStatus status, BaseEntity originalEntity = null)
 {
     if (((DraftReview)draft).OriginReview == null)
     {
         ((DraftReview)draft).OriginReview = new Review()
         {
             Product = this.Product,
             PublicationStatus = status,
             ReviewText = this.ReviewText
         };
     }
     else
     {
         Review original = (Review)originalEntity;
         original.PublicationStatus = new Entities.PublicationStatus();
         original.PublicationStatus = status;
         original.Product = this.Product;
         original.ReviewText = this.ReviewText;
     }
 }
Beispiel #6
0
 public void Publish(BasePublishableEntity draft, PublicationStatus status, BaseEntity originalEntity = null)
 {
     if (((DraftTable)draft).OriginalTable == null)
     {
         ((DraftTable)draft).OriginalTable = new Table()
         {
             Name              = this.Name,
             Capacity          = this.Capacity,
             TableNumber       = this.TableNumber,
             PublicationStatus = status,
             Password          = this.Password
         };
     }
     else
     {
         Table original = (Table)originalEntity;
         original.PublicationStatus = new Entities.PublicationStatus();
         original.PublicationStatus = status;
         original.Name        = this.Name;
         original.TableNumber = this.TableNumber;
         original.Capacity    = this.Capacity;
         original.Password    = this.Password;
     }
 }
Beispiel #7
0
 public void Publish(BasePublishableEntity draft, PublicationStatus status, Base.BaseEntity originalEntity = null)
 {
     if (((DraftProduct)draft).OriginalProduct == null)
     {
         ((DraftProduct)draft).OriginalProduct = new Product()
         {
              Category = this.Category,
               FullDescription = this.FullDescription,
                 Supplier = this.Supplier,
                 Name = this.Name,
                  Price = this.Price,
                   ShortDescription = this.ShortDescription,
                    urlImage = this.urlImage,
                     PublicationStatus = status
         };
     }
     else
     {
         Product original = (Product)originalEntity;
         original.PublicationStatus = new Entities.PublicationStatus();
         original.Supplier = this.Supplier;
         original.FullDescription = this.FullDescription;
         original.Category = this.Category;
         original.Name = this.Name;
         original.Price = this.Price;
         original.ShortDescription = this.ShortDescription;
         original.urlImage = this.urlImage;
         original.PublicationStatus = status;
     }
 }
Beispiel #8
0
 public void Publish(BasePublishableEntity draft, PublicationStatus status, Base.BaseEntity originalEntity = null)
 {
     if (((ProdutoRascunho)draft).ProdutoOriginal == null)
     {
         ((ProdutoRascunho)draft).ProdutoOriginal = new Produto()
         {
              Category = this.CategoriaDoProduto,
               FullDescription = this.FullDescription,
                Manufactor = this.Fornecedor,
                 Name = this.Name,
                  Price = this.Price,
                   ShortDescription = this.ShortDescription,
                    urlImage = this.urlImage,
                     PublicationStatus = status
         };
     }
     else
     {
         Produto original = (Produto)originalEntity;
         original.PublicationStatus = new Entities.PublicationStatus();
         original.Manufactor = this.Fornecedor;
         original.FullDescription = this.FullDescription;
         original.Category = this.CategoriaDoProduto;
         original.Name = this.Name;
         original.Price = this.Price;
         original.ShortDescription = this.ShortDescription;
         original.urlImage = this.urlImage;
         original.PublicationStatus = status;
     }
 }
Beispiel #9
0
 /// <summary>
 /// Update a product's fields with this fields values
 /// </summary>
 /// <returns></returns>
 public void UpdateProduct(auRant.Core.Entities.Product produtoEditavel, ProductCategory category, PublicationStatus productStatus, Supplier supplier)
 {
     produtoEditavel.Name = this.Name;
     produtoEditavel.Category = category;
     produtoEditavel.PublicationStatus = productStatus;
     produtoEditavel.Price = this.Price;
     produtoEditavel.Supplier = supplier;
     produtoEditavel.urlImage = this.urlImage;
     produtoEditavel.ShortDescription = this.ShortDescription;
     produtoEditavel.FullDescription = this.FullDescription;
 }
Beispiel #10
0
 /// <summary>
 /// Transforms itself into a Product entity
 /// </summary>
 /// <returns></returns>
 public auRant.Core.Entities.Product CreateProduct(string urlImage, ProductCategory category, PublicationStatus productStatus, Supplier supplier)
 {
     return new auRant.Core.Entities.Product()
     {
         Name = this.Name,
         Category = category,
         PublicationStatus = productStatus,
         Price = this.Price,
         Supplier = supplier,
         urlImage = urlImage,
         ShortDescription = this.ShortDescription,
         FullDescription = this.FullDescription
     };
 }