public ActionResult InsertProductAsync()
        {
            var productModel = new ProductModel ();

            if (TryUpdateModel (productModel))
            {
                using (var uow = new UnitOfWork(UnitOfWorkScopeType.New))
                {
                    var product = productModel.GetProduct();
                    product.CreateDate = DateTime.Now;
                    product.UpdateDate = DateTime.Now;

                    //var productProperty = new ProductProperty {
                    //    Brend = productModel.ProductProperty.Brend,
                    //    Capacity = productModel.ProductProperty.Capacity,
                    //    Country = productModel.ProductProperty.Country,
                    //    Weight = productModel.ProductProperty.Weight
                    //};

                    Repository.Data.Save(product.ProductProperty);
                    //product.ProductProperty = productProperty;
                    Repository.Data.Save(product);
                    uow.Commit();
                }
            }

            return GetProductsAsync(new GridCommand { Page = 1, PageSize = 20 });
        }
        public static LProduct CopyFrom(this LProduct source, ProductModel product, bool update)
        {
            source.Name = product.Name;
            source.Price = product.Price;

            if (update)
                source.ProductProperty.CopyFrom(product.ProductProperty);

            source.StockBalance = product.StockBalance;
            source.UpdateDate = DateTime.Now;
            source.CreateDate = source.CreateDate;
            source.Category = source.Category;
            source.Description = source.Description;
            return source;
        }
        public ActionResult UpdateProductAsync()
        {
            var productModel = new ProductModel();

            if (TryUpdateModel (productModel))
            {
                using (var uow = new UnitOfWork())
                {
                    var product = Repository.Data.Get<Product>(productModel.Id);
                    product.CopyFrom(productModel, true);
                    product.UpdateDate = DateTime.Now;
                    Repository.Data.Save(product);
                    uow.Commit();
                }
            }
            ViewBag.Message = WebStroreResource.ProductUpdatedSuccesfull;
            return GetProductsAsync(new GridCommand { Page = 1, PageSize = 20 });
        }