/// <summary>
        /// Update Product
        /// </summary>
        /// <param name="productID"></param>
        /// <param name="productCode"></param>
        /// <param name="description"></param>
        /// <param name="unitPrice"></param>
        /// <param name="unitOfMeasure"></param>
        /// <param name="transaction"></param>
        /// <returns></returns>
        public Product UpdateProduct(Guid productID, string productCode, string description, decimal unitPrice, string unitOfMeasure, out TransactionalInformation transaction)
        {
            transaction = new TransactionalInformation();

            ProductsBusinessRules productsBusinessRules = new ProductsBusinessRules();

            Product product = new Product();

            try
            {
                productsDataService.CreateSession();

                product               = productsDataService.GetProduct(productID);
                product.ProductCode   = productCode;
                product.Description   = description;
                product.UnitPrice     = unitPrice;
                product.UnitOfMeasure = unitOfMeasure;

                productsBusinessRules.ValidateProductUpdate(product, productsDataService);

                if (productsBusinessRules.ValidationStatus == true)
                {
                    productsDataService.BeginTransaction();
                    productsDataService.UpdateProduct(product);
                    productsDataService.CommitTransaction(true);
                    transaction.ReturnStatus = true;
                    transaction.ReturnMessage.Add("Product successfully updated at " + product.DateUpdated.ToString());
                }
                else
                {
                    transaction.ReturnStatus     = productsBusinessRules.ValidationStatus;
                    transaction.ReturnMessage    = productsBusinessRules.ValidationMessage;
                    transaction.ValidationErrors = productsBusinessRules.ValidationErrors;
                }
            }
            catch (Exception ex)
            {
                transaction.ReturnMessage = new List <string>();
                string errorMessage = ex.Message;
                transaction.ReturnStatus = false;
                transaction.ReturnMessage.Add(errorMessage);
            }
            finally
            {
                productsDataService.CloseSession();
            }

            return(product);
        }
        /// <summary>
        /// Update Product
        /// </summary>
        /// <param name="productID"></param>
        /// <param name="productCode"></param>
        /// <param name="description"></param>
        /// <param name="unitPrice"></param>
        /// <param name="unitOfMeasure"></param>
        /// <param name="transaction"></param>
        /// <returns></returns>
        public Product UpdateProduct(Guid productID, string productCode, string description, decimal unitPrice, string unitOfMeasure, out TransactionalInformation transaction)
        {

            transaction = new TransactionalInformation();

            ProductsBusinessRules productsBusinessRules = new ProductsBusinessRules();

            Product product = new Product();

            try
            {

                productsDataService.CreateSession();

                product = productsDataService.GetProduct(productID);
                product.ProductCode = productCode;
                product.Description = description;
                product.UnitPrice = unitPrice;
                product.UnitOfMeasure = unitOfMeasure;            

                productsBusinessRules.ValidateProductUpdate(product, productsDataService);

                if (productsBusinessRules.ValidationStatus == true)
                {
                    productsDataService.BeginTransaction();
                    productsDataService.UpdateProduct(product);
                    productsDataService.CommitTransaction(true);
                    transaction.ReturnStatus = true;
                    transaction.ReturnMessage.Add("Product successfully updated at " + product.DateUpdated.ToString());
                }
                else
                {
                    transaction.ReturnStatus = productsBusinessRules.ValidationStatus;
                    transaction.ReturnMessage = productsBusinessRules.ValidationMessage;
                    transaction.ValidationErrors = productsBusinessRules.ValidationErrors;
                }

            }
            catch (Exception ex)
            {
                transaction.ReturnMessage = new List<string>();
                string errorMessage = ex.Message;
                transaction.ReturnStatus = false;
                transaction.ReturnMessage.Add(errorMessage);
            }
            finally
            {
                productsDataService.CloseSession();
            }

            return product;


        }