// // 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)); }
// // 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)); }
public ActionResult Edit(int id) { try { _vm.FlyDiscount = _repositryBase.getItem(id); return(View(_vm)); } catch (Exception) { throw; } }
// // GET: /Home/Edit/5 public ActionResult Edit(int id) { try { var _item = repository.getItem(id); return(View(_item)); } catch { return(View()); } }
// // 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()); } }
// // 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()); } }
// // 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); }
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)); } }
// // 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: /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)); }
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)); } }
// // 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: /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)); } }