Ejemplo n.º 1
0
        //
        // GET: /Product/Overview/5

        public ActionResult Overview(int id)
        {
            _vm.Products = _reposProduct.getItem(id);
            /*get all data Partnership width picture */
            _vm.listPartnerships = _repositoryPartner.getAllItems();
            return(View(_vm));
        }
Ejemplo n.º 2
0
        //
        // GET: /Administrator/BlogPost/Edit/5

        public ActionResult Edit(int id)
        {
            _vm.Blogpost     = _repos.getItem(id);
            _vm.IsVideo      = _vm.Blogpost.BlogPostTypeID.GetValueOrDefault(0);
            _vm.IsPublish    = _vm.Blogpost.Published.GetValueOrDefault(true);
            _vm.BlogpostType = _reposType.getItem(_vm.IsVideo);
            return(View(_vm));
        }
Ejemplo n.º 3
0
 public ActionResult Edit(int id)
 {
     try
     {
         _vm.FlyDiscount = _repositryBase.getItem(id);
         return(View(_vm));
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 4
0
        //
        // GET: /Home/Edit/5

        public ActionResult Edit(int id)
        {
            try
            {
                var _item = repository.getItem(id);
                return(View(_item));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 5
0
        //
        // GET: /Partnership/Edit/5

        public ActionResult Edit(int id)
        {
            try
            {
                //get one data
                vm.Partnership = repository.getItem(id);
                vm.isDelete    = vm.Partnership.Deleted.GetValueOrDefault(false);
                vm.isPublish   = vm.Partnership.Published.GetValueOrDefault(true);
                return(View(vm));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 6
0
        //
        // GET: /Manufacturer/Edit/5

        public ActionResult Edit(int id)
        {
            try
            {
                vm.Manufacturer          = repository.getItem(id);
                vm.isPubish              = vm.Manufacturer.Published.GetValueOrDefault(true);
                vm.isDelete              = vm.Manufacturer.Deleted.GetValueOrDefault(false);
                vm.ManufacturerLocalized = vm.Manufacturer.Fly_ManufacturerLocalized.FirstOrDefault();
                return(View(vm));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 7
0
        //
        // GET: /Banner/Edit/5

        public ActionResult Edit(int id)
        {
            _bannerModel.banner = _repository.getItem(id);
            _bannerModel.isDelete = _bannerModel.banner.Deleted.GetValueOrDefault(false);
            _bannerModel.isPublish = _bannerModel.banner.Published.GetValueOrDefault(false);
            _bannerModel.positionType = _bannerModel.banner.BannerTypeID.GetValueOrDefault();

            _bannerModel.PositionBannerType = _repoType.getAllItems().Select(
                x => new SelectListItem
                {
                    Value = x.BannerTypeID.ToString(),
                    Text = x.BannerTypeTitle
                });
            return View(_bannerModel);
        }
Ejemplo n.º 8
0
        public ActionResult Edit(int id)
        {
            try
            {
                _vm.Navigation  = _repositryBase.getItem(id);
                _vm.SubProducts = _vm.Navigation.title_en;
                _vm.Publish     = _vm.Navigation.Published.GetValueOrDefault();
                _vm.Deleted     = _vm.Navigation.Deleted.GetValueOrDefault();

                return(View(_vm));
            }
            catch (Exception e)
            {
                return(View(e.Message));
            }
        }
Ejemplo n.º 9
0
        //
        // GET: /Accessories/

        public ActionResult Index(int id)
        {
            _vm.Products = _reposProduct.getItem(id);
            if (_vm.Products.Fly_SectionGallery != null)
            {
                _vm.SectionGalleries = _vm.Products.Fly_SectionGallery.FirstOrDefault(x => x.ProductID == _vm.Products.ProductId);
            }

            if (_vm.Products.Fly_ProductVariant != null)
            {
                _vm.ProductVariant = _vm.Products.Fly_ProductVariant.FirstOrDefault(x => x.ProductID == _vm.Products.ProductId);
            }

            /*get all data Partnership width picture */
            _vm.listPartnerships = _repositoryPartner.getAllItems();
            return(View(_vm));
        }
Ejemplo n.º 10
0
        //
        // GET: /Categories/Edit/5

        public ActionResult Edit(int id)
        {
            // get Categories
            vm.Categories = repository.getItem(id);
            vm.isDelete   = vm.Categories.Deleted.GetValueOrDefault(true);
            vm.isPublish  = vm.Categories.Published.GetValueOrDefault(false);
            vm.isHome     = vm.Categories.ShowOnHomePage.GetValueOrDefault(true);
            // get CategoryDiscountMapping
            vm.CategoryDiscountMapping = vm.Categories.Fly_Category_Discount_Mapping.FirstOrDefault();
            vm.SelectValues            = (vm.CategoryDiscountMapping != null) ? vm.CategoryDiscountMapping.DiscountID : 0;
            vm.CategoriesLocalized     = vm.Categories.Fly_CategoryLocalized.FirstOrDefault();

            vm.SelectItemDiscount = repositoryD.getAllItems().Select(
                x => new SelectListItem
            {
                Value = x.DiscountID.ToString(),
                Text  = x.Name
            });
            return(View(vm));
        }
Ejemplo n.º 11
0
        public ActionResult Edit(int id)
        {
            try
            {
                _vm.Team      = _repository.getItem(id);
                _vm.IsPublish = _vm.Team.Published.GetValueOrDefault();
                _vm.IsDelete  = _vm.Team.Deleted.GetValueOrDefault();

                if (_vm.Team.Deleted == true)
                {
                    _vm.Team      = null;
                    _vm.IsPublish = true;
                    _vm.IsDelete  = false;
                }
                return(View(_vm));
            }
            catch (Exception ex)
            {
                return(View(ex.Message));
            }
        }
Ejemplo n.º 12
0
        //
        // GET: /Payment/
        public ActionResult Index(int cusId, int productId)
        {
            _vm.Customer = _repositoryUser.getItem(cusId);
            if (_vm.Customer.Fly_CustomerAttribute != null && _vm.Customer.Fly_CustomerAttribute.Count > 0)
            {
                _vm.CustomerAttr =
                    _vm.Customer.Fly_CustomerAttribute.Single(x => x.CustomerId.Equals(_vm.Customer.CustomerID));
            }
            _vm.Products       = _reposProduct.getItem(productId);
            _vm.ProductVariant = _vm.Products.Fly_ProductVariant.Single(x => x.ProductID.Equals(_vm.Products.ProductId));
            _vm.Order          = new Fly_Order {
                OrderTotal = _vm.ProductVariant.Price
            };

            _vm.ListCountryItems = _repositoryCountry.getAllItems().Select(
                x => new SelectListItem
            {
                Value = x.CountryID.ToString(),
                Text  = x.Name
            });
            _vm.SelectIndexCountry = 229; // default choose Vietnamese

            _vm.ListShippingItems = _repositryShipping.getAllItems().Select(
                x => new SelectListItem
            {
                Value = x.ShippingMethodID.ToString(),
                Text  = x.Name
            });

            _vm.ListPaymentMethodItems = _repositryPaymentMethod.getAllItems().Select(
                x => new SelectListItem
            {
                Value = x.VisibleName,
                Text  = x.VisibleName
            });



            return(View(_vm));
        }
Ejemplo n.º 13
0
        //
        // GET: /ProductAdmin/Edit/5

        public ActionResult Edit(int id)
        {
            try
            {
                // get product table
                vm.Product = repository.getItem(id);

                //set product entity
                vm.Product.Published      = vm.Product.Published;
                vm.Product.Deleted        = vm.Product.Deleted;
                vm.Product.isAccessories  = vm.Product.isAccessories;
                vm.Product.ShowOnHomePage = vm.Product.ShowOnHomePage;

                // set productvariant entity
                vm.ProductVariant = vm.Product.Fly_ProductVariant.FirstOrDefault();

                vm.ProductVariantLocalized = vm.ProductVariant.Fly_ProductVariantLocalized.FirstOrDefault();

                // set ProductLocalized & ProductPictures entity
                vm.ProductLocalized = vm.Product.Fly_ProductLocalized.FirstOrDefault();
                vm.ProductPictures  = vm.Product.Fly_ProductPicture.FirstOrDefault();

                // set index Cate
                vm.MappingCategories = vm.Product.Fly_Product_Category_Mapping.FirstOrDefault();
                vm.indexCate         = (vm.MappingCategories != null) ? vm.MappingCategories.CategoryID.GetValueOrDefault(0) : 0;

                // set index Manufacturer
                vm.MappingManufacturer = vm.Product.Fly_Product_Manufacturer_Mapping.FirstOrDefault();
                vm.indexManufacturer   = (vm.MappingManufacturer != null) ? vm.MappingManufacturer.ManufacturerID.GetValueOrDefault(0) : 0;

                // set index Discount
                vm.MappingDiscount = vm.ProductVariant.Fly_ProductVariant_Discount_Mapping.FirstOrDefault();
                vm.indexDiscount   = (vm.MappingDiscount != null) ? vm.MappingDiscount.DiscountID : 0;


                //get all categories of product
                vm.CategoriesItemList = _repoCategories.getAllItems().ToList().Where(c => c.Deleted == false).Select(
                    x => new SelectListItem
                {
                    Value = x.CategoryID.ToString(),
                    Text  = x.Name
                });

                //get all manufacturer of product
                vm.ManufacturerItemList = _repoManufacturer.getAllItems().ToList().Where(c => c.Deleted == false).Select(
                    x => new SelectListItem
                {
                    Value = x.ManufacturerID.ToString(),
                    Text  = x.Name
                });

                //get all Discount of product
                vm.DiscountItemList = _repoDiscount.getAllItems().ToList().Where(c => c.Deleted == false).Select(
                    x => new SelectListItem
                {
                    Value = x.DiscountID.ToString(),
                    Text  = x.Name
                });

                return(View(vm));
            }
            catch (Exception e)
            {
                return(View(e.StackTrace));
            }
        }