// // GET: /Technical/ public ActionResult Index() { _vm.ListVideos = _reposVideo.getAllItemsByTechnical(); /*get all data Partnership width picture */ _vm.ListPartnerships = _repositoryPartner.getAllItems(); return(View(_vm)); }
// // 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)); } }
// // GET: /Banner/Create public ActionResult Create() { _bannerModel.PositionBannerType = _repoType.getAllItems().Select( x => new SelectListItem { Value = x.BannerTypeID.ToString(), Text = x.BannerTypeTitle }); return View(_bannerModel); }
// // GET: /Categories/Create public ActionResult Create() { vm.SelectItemDiscount = repositoryD.getAllItems().Select( x => new SelectListItem { Value = x.DiscountID.ToString(), Text = x.Name }); return(View(vm)); }
// // 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)); } }
// // 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)); } }
// // 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)); }
// // 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)); }
// // GET: /BannerType/ public ActionResult Index() { try { IList <Fly_BannerType> lbn = repository.getAllItems(); return(View(lbn)); } catch { return(View()); } }
// // 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)); } }
// // 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()); }
// // GET: /Categories/ public ActionResult Index() { try { vm.ListCategories = repository.getAllItems().ToList(); return(View(vm)); } catch (Exception ex) { return(View(ex.Message)); } }
// // GET: /Partnership/ public ActionResult Index() { try { IList <Fly_Partnership> flyv = repository.getAllItems(); return(View(flyv)); } catch { return(View()); } }
// // 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)); } }
// // GET: /ProductAdmin/ public ActionResult Index() { try { vm.ProductList = repository.getAllItems().ToList(); return(View(vm)); } catch { return(View()); } }
// // GET: /Administrator/Discount/ public ActionResult Index() { try { _vm.ListDiscount = _repositryBase.getAllItems().ToList(); return(View(_vm)); } catch (Exception) { throw; } }
// // GET: /Manufacturer/ public ActionResult Index() { try { // get all data vm.ListManufacturer = repository.getAllItems().ToList(); return(View(vm)); } catch { return(View()); } }
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; }
// // 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)); } }
// // 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); } }
// // 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)); }
// // 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)); }
// // 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)); }
// // GET: /Administrator/Navigation/ public ActionResult Index() { return(View(_repositryBase.getAllItems())); }
// // GET: /Administrator/BlogPost/ public ActionResult Index() { _vm.ListBlogPost = _repos.getAllItems().ToList(); return(View(_vm)); }
// // GET: /Administrator/Spec/Create public ActionResult Create() { vm.PositionGalleries = _repoPositionPos.getAllItems().FirstOrDefault(x => x.PositionName.Equals(PositionTab.Specs)); return(View(vm)); }