コード例 #1
0
        //
        // GET: /Technical/

        public ActionResult Index()
        {
            _vm.ListVideos = _reposVideo.getAllItemsByTechnical();
            /*get all data Partnership width picture */
            _vm.ListPartnerships = _repositoryPartner.getAllItems();
            return(View(_vm));
        }
コード例 #2
0
        //
        // GET: /ProductAdmin/Create

        public ActionResult Create()
        {
            try
            {
                //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.Message));
            }
        }
コード例 #3
0
        //
        // GET: /Banner/Create

        public ActionResult Create()
        {
            _bannerModel.PositionBannerType = _repoType.getAllItems().Select(
                x => new SelectListItem
                {
                    Value = x.BannerTypeID.ToString(),
                    Text = x.BannerTypeTitle
                });
            return View(_bannerModel);
        }
コード例 #4
0
        //
        // GET: /Categories/Create

        public ActionResult Create()
        {
            vm.SelectItemDiscount = repositoryD.getAllItems().Select(
                x => new SelectListItem
            {
                Value = x.DiscountID.ToString(),
                Text  = x.Name
            });

            return(View(vm));
        }
コード例 #5
0
        //
        // GET: /Home/

//        [OutputCache(CacheProfile = "flycameCaches")]
        public ActionResult Index()
        {
            try
            {
                /*get all data banner width picture */
                _vm.listBanner = _repositoryBanner.getAllItems().Where(x => x.Published == true && x.Fly_BannerType.BannerTypeTitle.Equals("Banner Home")).Take(ConfiguationSite.NumberBanner).ToList();

                /*get all data video width picture */
                _vm.listVideo = _repositoryVideos.getAllItemsByHome().Take(ConfiguationSite.NumberVideoHome).ToList();

                /*get all data Partnership width picture */
                _vm.listPartnerships = _repositoryPartner.getAllItems().Where(x => x.Published == true).ToList();

                List <Fly_Navigation> listNav = _repositryNav.getAllItems().Take(ConfiguationSite.NumberItemNavigation).ToList();
                ViewData[StaticVariable.Navigation] = listNav;


                /*pass data to partialView by ViewData */
                ViewData[StaticVariable.BannerHome]  = _vm.listBanner;
                ViewData[StaticVariable.VideoHome]   = _vm.listVideo;
                ViewData[StaticVariable.PartnerShip] = _vm.listPartnerships;
                return(View());
            }
            catch (Exception e)
            {
                return(View(e.Message));
            }
        }
コード例 #6
0
        //
        // GET: /Administrator/Customer/Edit/5

        public ActionResult Edit(int id)
        {
            try
            {
                vm.Customer       = repositoryUser.getItem(id);
                vm.CustomerAttr   = vm.Customer.Fly_CustomerAttribute.Single(x => x.CustomerId.Equals(id));
                vm.CustomerAvatar = vm.Customer.Fly_Picture;
                //vm.MappingRole = vm.Customer.Fly_Customer_CustomerRole_Mapping.Where(x => x.CustomerID.Equals(id)).FirstOrDefault();
                vm.ListCustomerRole = repositoryUserRole.getAllItems().Where(x => x.Active == true).ToList();
                //vm.CustomerProductPrice = vm.CustomerRole.Fly_CustomerRole_ProductPrice.Where(x => x.CustomerRoleID.Equals(vm.CustomerRole.CustomerRoleID)).FirstOrDefault();
                //vm.MappingDiscount = vm.CustomerRole.Fly_CustomerRole_Discount_Mapping.Where(x => x.CustomerRoleID.Equals(vm.CustomerRole.CustomerRoleID)).FirstOrDefault(); ;

                vm.isActive   = vm.Customer.Active.GetValueOrDefault();
                vm.isAdmin    = vm.Customer.IsAdmin.GetValueOrDefault();
                vm.selectItem = vm.CustomerAttr.CountryID.GetValueOrDefault();

                vm.PositionCountry = repositoryCountry.getAllItems().Select(
                    x => new SelectListItem
                {
                    Value = x.CountryID.ToString(),
                    Text  = x.Name
                });

                return(View(vm));
            }
            catch (Exception ex)
            {
                return(View(ex.Message));
            }
        }
コード例 #7
0
        //
        // GET: /User/Create

        public ActionResult Register()
        {
            vm.CountryList = _country.getAllItems().Select(
                x => new SelectListItem
            {
                Value = x.CountryID.ToString(),
                Text  = x.Name.ToString()
            });
            return(View(vm));
        }
コード例 #8
0
        //
        // GET: /Administrator/BlogPost/Create

        public ActionResult Create()
        {
            _vm.PosBlogTypeList = _reposType.getAllItems().Select(
                x => new SelectListItem
            {
                Value = x.BlogPostTypeID.ToString(),
                Text  = x.Title
            });
            return(View(_vm));
        }
コード例 #9
0
        //
        // GET: /BannerType/

        public ActionResult Index()
        {
            try
            {
                IList <Fly_BannerType> lbn = repository.getAllItems();
                return(View(lbn));
            }
            catch
            {
                return(View());
            }
        }
コード例 #10
0
        //
        // GET: /Administrator/Team/

        public ActionResult Index()
        {
            try
            {
                _vm.ListTeam = _repository.getAllItems().Where(x => x.Published == true).ToList();
                return(View(_vm.ListTeam));
            }
            catch (Exception ex)
            {
                return(View(ex.Message));
            }
        }
コード例 #11
0
 //
 // GET: /Administrator/Accessories/
 public ActionResult Index()
 {
     try
     {
         _vm.ProductList = _repository.getAllItems().Where(x => x.isAccessories.GetValueOrDefault(false) == true).ToList();
         return(View(_vm));
     }
     catch (Exception exception)
     {
     }
     return(View());
 }
コード例 #12
0
        //
        // GET: /Categories/

        public ActionResult Index()
        {
            try
            {
                vm.ListCategories = repository.getAllItems().ToList();
                return(View(vm));
            }
            catch (Exception ex)
            {
                return(View(ex.Message));
            }
        }
コード例 #13
0
        //
        // GET: /Partnership/

        public ActionResult Index()
        {
            try
            {
                IList <Fly_Partnership> flyv = repository.getAllItems();
                return(View(flyv));
            }
            catch
            {
                return(View());
            }
        }
コード例 #14
0
        //
        // GET: /ProductAdmin/

        public ActionResult Index()
        {
            try
            {
                vm.ProductList = repository.getAllItems().Where(x => x.isAccessories.GetValueOrDefault(false) == false).ToList();
                return(View(vm));
            }
            catch (Exception ex)
            {
                return(View(ex.Message));
            }
        }
コード例 #15
0
        //
        // GET: /ProductAdmin/

        public ActionResult Index()
        {
            try
            {
                vm.ProductList = repository.getAllItems().ToList();
                return(View(vm));
            }
            catch
            {
                return(View());
            }
        }
コード例 #16
0
        //
        // GET: /Administrator/Discount/

        public ActionResult Index()
        {
            try
            {
                _vm.ListDiscount = _repositryBase.getAllItems().ToList();
                return(View(_vm));
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #17
0
        //
        // GET: /Manufacturer/

        public ActionResult Index()
        {
            try
            {
                // get all data
                vm.ListManufacturer = repository.getAllItems().ToList();
                return(View(vm));
            }
            catch
            {
                return(View());
            }
        }
コード例 #18
0
        public ProductController()
        {
            _reposProduct      = new ProductDAO();
            _repositoryPartner = new PartnershipDAO();
            _reposVideo        = new VideosDAO();
            _repositoryUser    = new CustomerDAO();
            _repositryNav      = new NavigationDao();

            _vm = new ProductsVM();

            List <Fly_Navigation> listNav = _repositryNav.getAllItems().ToList();

            ViewData[StaticVariable.Navigation] = listNav;
        }
コード例 #19
0
        //
        // GET: /Administrator/Customer/Edit/5

        public ActionResult Edit(int id)
        {
            try
            {
                _vm.Customer = _repositoryUser.getItem(id);
                if (_vm.Customer != null)
                {
                    _vm.CustomerAttr   = _vm.Customer.Fly_CustomerAttribute.FirstOrDefault(x => x.CustomerId.Equals(id));
                    _vm.CustomerAvatar = _vm.Customer.Fly_Picture;
                    //vm.MappingRole = vm.Customer.Fly_Customer_CustomerRole_Mapping.Where(x => x.CustomerID.Equals(id)).FirstOrDefault();
                    _vm.ListCustomerRole = _repositoryUserRole.getAllItems().Where(x => x.Active == true).ToList();

                    foreach (var valuemp in _vm.ListCustomerRole)
                    {
                        foreach (var cusmpRole in _vm.Customer.Fly_Customer_CustomerRole_Mapping)
                        {
                            if (valuemp.CustomerRoleID.Equals(cusmpRole.CustomerRoleID))
                            {
                                valuemp.Selected = true;
                            }
                        }
                    }
                    //vm.CustomerProductPrice = vm.CustomerRole.Fly_CustomerRole_ProductPrice.Where(x => x.CustomerRoleID.Equals(vm.CustomerRole.CustomerRoleID)).FirstOrDefault();
                    //vm.MappingDiscount = vm.CustomerRole.Fly_CustomerRole_Discount_Mapping.Where(x => x.CustomerRoleID.Equals(vm.CustomerRole.CustomerRoleID)).FirstOrDefault(); ;

                    _vm.isActive = _vm.Customer.Active.GetValueOrDefault();
                    _vm.isAdmin  = _vm.Customer.IsAdmin.GetValueOrDefault();
                }
                if (_vm.CustomerAttr != null)
                {
                    _vm.selectItem = _vm.CustomerAttr.CountryID.GetValueOrDefault();
                }

                if (_repositoryCountry != null)
                {
                    _vm.PositionCountry = _repositoryCountry.getAllItems().Select(
                        x => new SelectListItem
                    {
                        Value = x.CountryID.ToString(),
                        Text  = x.Name
                    });
                }

                return(View(_vm));
            }
            catch (Exception ex)
            {
                return(View(ex.Message));
            }
        }
コード例 #20
0
        //
        // GET: /Banner/

        public ActionResult Index()
        {
            IList<Fly_Banner> bn = new List<Fly_Banner>();
            try
            {

                bn = _repository.getAllItems();
                return View(bn);
            }
            catch (Exception e)
            {
                return View(e.Message);
            }
        }
コード例 #21
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));
        }
コード例 #22
0
        //
        // GET: /Product/

        public ActionResult Index()
        {
            // get List of Product
            _vm.ProductList = _reposProduct.getAllItems();

            /*get all data Partnership width picture */
            _vm.listPartnerships = _repositoryPartner.getAllItems();

            //ViewData[StaticVariable.PartnerShip] = vm.listPartnerships;

            /* return data pagination */
            _paging.TotalItem   = _vm.ProductList.Count();
            _paging.PageSize    = ConfiguationSite.PageSize;
            _paging.CurrentPage = 1;
            ViewData[StaticVariable.Pagination] = _paging;


            /*return data breadcrumbs */
            List <BreadcrumbsModel> listbreadcrums = new List <BreadcrumbsModel>()
            {
                new BreadcrumbsModel()
                {
                    isFirst        = true,
                    ControllerName = "Home",
                    ActionName     = "Index",
                    isLast         = false
                },
                new BreadcrumbsModel()
                {
                    isFirst        = false,
                    ControllerName = ControllerContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString(),
                    ActionName     = ControllerContext.Controller.ValueProvider.GetValue("action").RawValue.ToString(),
                    isLast         = true
                }
            };

            ViewData[StaticVariable.Breadcrumbs] = listbreadcrums;

            _vm.ProductList = _vm.ProductList.Take(_paging.PageSize).ToList();



            return(View(_vm));
        }
コード例 #23
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));
        }
コード例 #24
0
        //
        // GET: /Administrator/Navigation/

        public ActionResult Index()
        {
            return(View(_repositryBase.getAllItems()));
        }
コード例 #25
0
        //
        // GET: /Administrator/BlogPost/

        public ActionResult Index()
        {
            _vm.ListBlogPost = _repos.getAllItems().ToList();
            return(View(_vm));
        }
コード例 #26
0
        //
        // GET: /Administrator/Spec/Create

        public ActionResult Create()
        {
            vm.PositionGalleries = _repoPositionPos.getAllItems().FirstOrDefault(x => x.PositionName.Equals(PositionTab.Specs));
            return(View(vm));
        }