public static DetailViewModel ToDetailViewModel(this FeatureDefinition vm, IEnumerable <ActivatedFeature> activatedFeatures)
        {
            string displayName = vm.DisplayName;

            if (activatedFeatures == null)
            {
                activatedFeatures = new List <ActivatedFeature>();
            }

            var items = new List <KeyValuePair <string, string> >();

            items.Add(new KeyValuePair <string, string>(nameof(vm.DisplayName), vm.DisplayName));
            items.Add(new KeyValuePair <string, string>(nameof(vm.Id), vm.Id.ToString()));
            items.Add(new KeyValuePair <string, string>(nameof(vm.Scope), vm.Scope.ToString()));
            items.Add(new KeyValuePair <string, string>(nameof(vm.Title), vm.Title));
            items.Add(new KeyValuePair <string, string>("Times Activated in Farm", activatedFeatures.Count().ToString()));
            items.Add(ConvertActivatedFeatures(activatedFeatures, true));
            items.Add(new KeyValuePair <string, string>(nameof(vm.Name), vm.Name));
            items.Add(new KeyValuePair <string, string>(nameof(vm.CompatibilityLevel), vm.CompatibilityLevel.ToString()));
            items.Add(new KeyValuePair <string, string>(nameof(vm.Description), vm.Description));
            items.Add(new KeyValuePair <string, string>(nameof(vm.Hidden), vm.Hidden.ToString()));
            items.Add(new KeyValuePair <string, string>(nameof(vm.SolutionId), vm.SolutionId.ToString()));
            items.Add(new KeyValuePair <string, string>(nameof(vm.UIVersion), vm.UIVersion.ToString()));
            items.Add(new KeyValuePair <string, string>(nameof(vm.Version), vm.Version == null ? string.Empty : vm.Version.ToString()));
            items.Add(new KeyValuePair <string, string>(nameof(vm.SandBoxedSolutionLocation), vm.SandBoxedSolutionLocation));
            items.Add(new KeyValuePair <string, string>(nameof(vm.Properties), PropertiesToString(vm.Properties)));


            var dvm = new DetailViewModel(displayName, items);

            return(dvm);
        }
Exemple #2
0
        public ActionResult Detail(string id)
        {
            //讀取商品資料
            DetailViewModel vm = DataProcess.GetDetailData(id);

            return(View("Detail", vm));
        }
        public async Task <IActionResult> QuickView(int id)
        {
            ViewData["BodyClass"] = "product-page";
            var model = new DetailViewModel();

            model.Product = await _productService.GetById(id);

            model.Category = await _productCategoryService.GetById(model.Product.CategoryId);

            // model.RelatedProducts = _productService.GetRelatedProducts(id, 9);
            //model.UpsellProducts = _productService.GetUpsellProducts(6);
            model.ProductImages = await _productService.GetImages(id);

            model.ProductImages.Add(new ProductImageViewModel
            {
                Path = model.Product.Image
            });
            model.Tags = await _productService.GetProductTags(id);

            model.Colors = (await _billService.GetColors()).Select(x => new SelectListItem()
            {
                Text  = x.Name,
                Value = x.Id.ToString()
            }).ToList();
            model.Sizes = (await _billService.GetSizes()).Select(x => new SelectListItem()
            {
                Text  = x.Name,
                Value = x.Id.ToString()
            }).ToList();

            return(View(model));
        }
Exemple #4
0
        public async Task <IActionResult> Detail(int id)//Course Id
        {
            var course = await _dbContext
                         .Courses
                         .Include(t => t.Owner)
                         .SingleOrDefaultAsync(t => t.Id == id);

            var user = await GetCurrentUserAsync();

            var Subscribed = user == null ? false : await _dbContext
                             .Subscriptions
                             .SingleOrDefaultAsync(t => t.CourseId == id && t.UserId == user.Id) != null;

            if (course == null)
            {
                return(NotFound());
            }
            var model = new DetailViewModel
            {
                Id               = id,
                Name             = course.Name,
                Description      = course.Description,
                Subscribed       = Subscribed,
                IsOwner          = user.Id == course.OwnerId,
                AuthorName       = course.Owner.NickName,
                DisplayOwnerInfo = course.DisplayOwnerInfo
            };

            return(View(model));
        }
Exemple #5
0
        public ActionResult Detail(string parkCode)
        {
            DetailViewModel model = new DetailViewModel();

            model.ParkDetails     = _dal.GetAllDetailsByParkCode(parkCode);
            model.FiveDayForecast = _dal.GetFiveDayForecast(parkCode);

            //save the park code of the detail view the user navigates to
            Session[parkCodeKey] = model.ParkDetails.ParkCode;

            //pull current temperature unit of measurement
            string sessionTempType = Session[tempTypekey] as string;

            //check current temperature unit to display
            if (sessionTempType != null && sessionTempType == "Celsius")
            {
                model.TempType        = sessionTempType;
                model.FiveDayForecast = ConvertToCelsius(model.FiveDayForecast);
            }
            else
            {
                Session[tempTypekey] = model.TempType;
            }

            return(View("Detail", model));
        }
Exemple #6
0
        public ActionResult Details(string parkCode)
        {
            TempData["code"] = parkCode;
            DetailViewModel model = _dal.GetDetails(parkCode);

            return(View("Details", model));
        }
Exemple #7
0
        public ActionResult SaveMember(DetailViewModel viewModel)
        {
            if (!_memberService.IsUsernameAvailable(viewModel.Member.Username, viewModel.Member.MemberId))
            {
                ModelState.AddModelError("Member.Username", "Username is already being used. Try another.");
            }

            if (ModelState.IsValid)
            {
                var isEditMode = viewModel.Member.MemberId.GetValueOrDefault(0) > 0;

                if (isEditMode)
                {
                    _memberService.UpdateMember(viewModel.Member);
                }
                else
                {
                    var newId = _memberService.AddMember(viewModel.Member);
                    return(Detail(newId));
                }
            }

            if (!ModelState.IsValid && Request.IsAjaxRequest())
            {
                return(PartialView("Detail"));
            }

            return(Detail(viewModel.Member.MemberId));
        }
Exemple #8
0
        public async void Add()
        {
            if (ForSelectOnly)
            {
                selectedList  = Items.Where(a => (a as IDocument).IsSelectedd);
                ForSelectOnly = false;
                CloseWindows();
            }
            else
            {
                try
                {
                    selected = new T();

                    if (selected.DocOpenMod == OpenMode.Attach && ForSelectOnly == false)
                    {
                        //selected.CollectionName = displayName;
                        shell.OpenScreen(await DetailViewModel.Create(selected, selected.GetType(), aggre, shell), $"{this.DisplayName} | {selected.Name}");
                    }
                    else
                    {
                        var ioc = DataHelpers.container;
                        var vm  = ioc.Get <ViewManager>();
                        var c   = await DetailViewModel.Create(selected, selected.GetType(), aggre, shell);

                        await shell.OpenScreenDetach(selected, selected.Name);
                    }
                }
                catch (Exception s)
                {
                    DataHelpers.ShowMessage(s.Message + " " + s.StackTrace);
                    return;
                }
            }
        }
        public ActionResult Detail(string id)
        {
            var vm = new DetailViewModel
            {
            };

            if (id == "food")
            {
                vm.Title = "Food";
                vm.Images.Add(new Image {
                    Name = "Bacon", Url = "/content/images/bacon_500.jpg", Description = "This is bacon, the healthy meat."
                });
                vm.Images.Add(new Image {
                    Name = "Dragonfruit", Url = "/content/images/dragonfruit_500.jpg", Description = "This is dragonfruit that I had in Cambodia. Pretty tasty."
                });
                vm.Images.Add(new Image {
                    Name = "Meat", Url = "/content/images/meat_500.jpg", Description = "The best way to eat meat..."
                });
                vm.Images.Add(new Image {
                    Name = "Lolwut Pear", Url = "/content/images/lolwut_500.jpg", Description = "It would be a bit strange to eat this pear."
                });
            }
            else
            {
                vm.Title = "Humor";
                vm.Images.Add(new Image {
                    Name = "Hulk Hogan", Url = "/content/images/hogan_500.jpg", Description = "Hulk Hogan is pretty awesome."
                });
                vm.Images.Add(new Image {
                    Name = "Mitt Romney", Url = "/content/images/mitt_500.jpg", Description = "I really have nothing to say here."
                });
            }

            return(View(@"~\Views\ThirdPartyLibraries\SenchaTouch\Detail.cshtml", vm));
        }
Exemple #10
0
        public InsiderProgramDetailPage()
        {
            this.ViewModel = DetailViewModel.CreateNew(Singleton <InsiderProgramConfig> .Instance);

            this.InitializeComponent();
            new Microsoft.ApplicationInsights.TelemetryClient().TrackPageView(this.GetType().FullName);
        }
        public IActionResult Details(int id)
        {
            ViewData["BodyClass"] = "product-page";

            var details = new DetailViewModel
            {
                Category       = _serviceRegistration.ProductCategoryService.GetById(id),
                Product        = _serviceRegistration.ProductService.GetProductById(id),
                ProductImage   = _serviceRegistration.ProductService.GetImages(id),
                RelatedProduct = _serviceRegistration.ProductService.GetRelatedProducts(id, 9),
                UpSellProduct  = _serviceRegistration.ProductService.GetUpSellProducts(6),
                Tags           = _serviceRegistration.ProductService.GetTags(id),
                Colors         = _serviceRegistration.BillService.GetColors().Select(x => new SelectListItem
                {
                    Text  = x.Name,
                    Value = x.Id.ToString()
                }).ToList(),
                Sizes = _serviceRegistration.BillService.GetSizes().Select(x => new SelectListItem
                {
                    Text  = x.Name,
                    Value = x.Id.ToString()
                }).ToList()
            };

            return(View(details));
        }
        public TripDetailPage(TripLogEntry tripLogEntry)
        {
            BindingContext = new DetailViewModel(tripLogEntry);
            InitializeComponent();

            LoadData();
        }
        public IActionResult Details(int id)
        {
            ViewData["BodyClass"] = "product-page";
            var model = new DetailViewModel
            {
                Product         = _productService.GetById(id),
                RelatedProducts = _productService.GetRelatedProducts(id, 9),
                UpsellProducts  = _productService.GetUpsellProducts(6),
                ProductImages   = _productService.GetImages(id),
                Tags            = _productService.GetProductTags(id),
                ListColors      = _colorService.GetAll().Select(m => new SelectListItem()
                {
                    Value = m.Id.ToString(),
                    Text  = m.Name
                }).ToList(),
                ListSizes = _sizeService.GetAll().Select(m => new SelectListItem()
                {
                    Value = m.Id.ToString(),
                    Text  = m.Name
                }).ToList()
            };

            model.Category = _productCategoryService.GetById(model.Product.CategoryId);
            return(View(model));
        }
        public IActionResult Detail(string Id)
        {
            DetailViewModel detail = new DetailViewModel();

            detail.Movie = MovieRepo.Get(Id);
            return(View(detail));
        }
 private Apprenticeship MapToApprenticeship(DetailViewModel model, int ukprn, List <ApprenticeshipLocation> locations)
 {
     return(new Apprenticeship
     {
         //ApprenticeshipId // For backwards compatibility with Tribal (Where does this come from?)
         //TribalProviderId
         ProviderId = _providerService.GetProviderByPRNAsync(ukprn.ToString()).Result.Value.FirstOrDefault().id,
         ProviderUKPRN = ukprn,
         ApprenticeshipTitle = model.ApprenticeshipTitle,
         ApprenticeshipType = model.ApprenticeshipType,
         StandardCode = model.StandardCode,
         FrameworkCode = model.FrameworkCode,
         ProgType = model.ProgType,
         MarketingInformation = model.Information,
         Url = model.Website,
         ContactTelephone = model.Telephone,
         ContactEmail = model.Email,
         ContactWebsite = model.ContactUsIUrl,
         CreatedDate = DateTime.Now,
         CreatedBy = User.Claims.Where(c => c.Type == "email").Select(c => c.Value).SingleOrDefault(),
         RecordStatus = RecordStatus.Live,
         PathwayCode = model.PathwayCode,
         Version = model.Version ?? (int?)null,
         NotionalNVQLevelv2 = model.NotionalNVQLevelv2,
         ApprenticeshipLocations = locations,
         UpdatedDate = DateTime.UtcNow,
         UpdatedBy = User.Claims.Where(c => c.Type == "email").Select(c => c.Value).SingleOrDefault()
     });
 }
Exemple #16
0
        public DetailViewModel getDetailViewModel(long id)
        {
            FullPatientData dataModel = cache.loadPatientDataModel(id);
            DetailViewModel model     = new DetailViewModel();

            if (dataModel != null)
            {
                model.observations     = dataModel.observations;
                model.patient          = dataModel.patient;
                model.patientID        = dataModel.patientID;
                model.QRs              = dataModel.QRs;
                model.questionnaireMap = dataModel.questionnaireMap;
            }


            //load selected charts
            ChartSelection charts = chartSelectionRepo.getChartsByTherapistId(0); //0 is therapistID, replace with ID when authentication is impl

            if (charts != null && charts.chartMap.Keys.Contains(id.ToString()))   //saved settings exist
            {
                model.selectedCharts = charts.chartMap[id.ToString()];
            }
            else
            {
                model.selectedCharts = new Dictionary <string, string>();
            }

            return(model);
        }
Exemple #17
0
        public ActionResult Detail(int id)
        {
            string file = Server.MapPath("~/App_Data/data.json");
            string json = System.IO.File.ReadAllText(file);
            List <DetailViewModel> list = JsonConvert.DeserializeObject <List <DetailViewModel> >(json);

            var result = list.Where(n => n.Id == id).FirstOrDefault();

            DetailViewModel viewModel = new DetailViewModel();

            viewModel.Product_Name = result.Product_Name;
            viewModel.Locale       = result.Locale;
            viewModel.Create_Date  = result.Create_Date;
            if (decimal.TryParse(result.Price, out decimal num))
            {
                viewModel.Price = string.Format(new CultureInfo(GetLocale(result.Locale)), "{0:c}", float.Parse(result.Price));
            }
            else
            {
                viewModel.Price = "-";
            }
            if (decimal.TryParse(result.Promote_Price, out decimal num2))
            {
                viewModel.Promote_Price = string.Format(new CultureInfo(GetLocale(result.Locale)), "{0:c}", float.Parse(result.Promote_Price));
            }
            else
            {
                viewModel.Promote_Price = "-";
            }


            return(View(viewModel));
        }
Exemple #18
0
        public IActionResult Detail(string code, string temp)
        {
            if (!HttpContext.Session.Keys.Contains("temp"))
            {
                HttpContext.Session.SetString("temp", "f");
            }

            if (temp != HttpContext.Session.GetString("temp"))
            {
                HttpContext.Session.SetString("temp", temp);
            }

            Park           park    = parkDAO.GetParkByParkCode(code);
            List <Weather> fiveDay = weatherDAO.GetForecast(code);

            DetailViewModel vm = new DetailViewModel();

            vm.FiveDay   = fiveDay;
            vm.forecasts = new List <Forecast>();
            if (HttpContext.Session.GetString("temp") == "f")
            {
                vm.isFahrenheit = true;
            }
            else
            {
                vm.isFahrenheit = false;
            }

            vm.Park = park;
            return(View(vm));
        }
Exemple #19
0
        // GET: Post
        public ActionResult Detail(int postId)
        {
            Post post = _postService.GetById(postId);

            if (post.ViewCount.HasValue)
            {
                post.ViewCount++;
            }
            else
            {
                post.ViewCount = 1;
            }
            _postService.Update(post);
            _postService.SaveChange();

            DetailViewModel detailViewModel       = new DetailViewModel();
            var             postDetail            = _postService.GetById(postId);
            var             postDetailContentView = Mapper.Map <Post, PostViewModel>(postDetail);
            var             listRelativePosts     = _postService.GetRelativePost(postId);

            detailViewModel.PostDetail       = postDetailContentView;
            detailViewModel.CategoryName     = Mapper.Map <PostCategory, PostCategoryViewModel>(_postCategoryService.GetById(postDetail.CategoryID));
            detailViewModel.ListTags         = Mapper.Map <IEnumerable <Tag>, IEnumerable <TagViewModel> >(_postService.GetListTagByPostId(postId));
            detailViewModel.RelativePost     = listRelativePosts.Count != 0 ? Mapper.Map <List <Post>, List <PostViewModel> >(listRelativePosts) : null;
            detailViewModel.PopularPost      = Mapper.Map <IEnumerable <Post>, IEnumerable <PostViewModel> >(_postService.MostViewCountPost().Take(5));
            detailViewModel.SameCategoryPost = Mapper.Map <IEnumerable <Post>, IEnumerable <PostViewModel> >(_postService.GetSameCategory(postId).OrderByDescending(s => s.CreatedDate).Take(5));
            return(View(detailViewModel));
        }
        public ActionResult Detail(DetailViewModel viewModle)
        {
            if (!this.ModelState.IsValid)

            {
                return(View(viewModle));
            }
            DataTable dt     = new DataTable();
            string    constr = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["NorthwindConnectionString1"].ConnectionString;

            using (SqlConnection con = new SqlConnection(constr))

            {
                string query = "UPDATE [Customers] SET[ContactName]=@ContactName,[ContactTitle]=@ContactTitle   Where [CustomerID]= @id";
                using (SqlCommand cmd = new SqlCommand(query))
                {
                    cmd.Parameters.Add("@id", SqlDbType.NChar, 5);
                    cmd.Parameters["@id"].Value = viewModle.CustomerID;
                    cmd.Parameters.Add("@ContactName", SqlDbType.NVarChar, 30);
                    cmd.Parameters["@ContactName"].Value = viewModle.ContactName;
                    cmd.Parameters.Add("@ContactTitle", SqlDbType.NVarChar, 30);
                    cmd.Parameters["@ContactTitle"].Value = viewModle.ContactTitle;
                    cmd.Connection = con;
                    using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
                    {
                        sda.Fill(dt);
                    }
                }
            }



            return(this.View("Detail", viewModle));
        }
        public async Task <IActionResult> Detail(int productId)
        {
            ViewBag.ProductId = productId;
            DetailViewModel detailViewModel = new DetailViewModel();
            var             response        = await httpClient.GetAsync("/api/cates/0");

            if (response.IsSuccessStatusCode)
            {
                detailViewModel.Product_CategoryDtos = await response.Content.ReadAsJsonAsync <List <Product_CategoryDto> >();
            }

            //最新商品
            var responseNew = await httpClient.GetAsync("/api/0/products/new");

            if (responseNew.IsSuccessStatusCode)
            {
                detailViewModel.NewProducts = await responseNew.Content.ReadAsJsonAsync <List <Product> >();
            }

            var responseProduct = await httpClient.GetAsync($"/api/0/products/{productId}");

            if (responseProduct.IsSuccessStatusCode)
            {
                detailViewModel.Product = await responseProduct.Content.ReadAsJsonAsync <Product>();
            }
            else
            {
                detailViewModel.Product = new Product();
            }

            return(View(detailViewModel));
        }
        public ActionResult CreateDetail(DetailViewModel detail)
        {
            // TODO: ModelState.IsValid - always false because  ModelState.IsValidField("Stockmen") always false
            bool isModelValidWithoutStockmen = ModelState.IsValidField("DetailId") && ModelState.IsValidField("Code") && ModelState.IsValidField("Name") &&
                                               ModelState.IsValidField("Amount") && ModelState.IsValidField("Special") && ModelState.IsValidField("AddDate");

            if (isModelValidWithoutStockmen)
            {
                var stockmensBLL = atlantDbService.GetStockmens();
                AtlantBLL.Models.Stockmen stockmen = stockmensBLL.Select(s => s).Where(s => s.StockmenId == detail.Stockmen.StockmenId).First();

                Mapper.CreateMap <StockmenViewModel, AtlantBLL.Models.Stockmen>();
                Mapper.CreateMap <DetailViewModel, AtlantBLL.Models.Detail>().ForMember(x => x.Stockmen, opt => opt.MapFrom(s => stockmen));
                var detailBLL = Mapper.Map <DetailViewModel, AtlantBLL.Models.Detail>(detail);

                atlantDbService.InsertDetail(detailBLL);

                return(RedirectToAction("ShowDetails"));
            }

            var stockmens = atlantDbService.GetStockmens();

            Mapper.Initialize(cfg => cfg.CreateMap <AtlantBLL.Models.Stockmen, StockmenViewModel>());
            var        stockmensView = Mapper.Map <IEnumerable <AtlantBLL.Models.Stockmen>, List <StockmenViewModel> >(stockmens);
            SelectList stocmensSL    = new SelectList(stockmensView, "StockmenId", "Name");

            ViewBag.Stockmens = stocmensSL;
            return(View(detail));
        }
        public void Setup()
        {
            var navMock       = new Mock <INavService>().Object;
            var analyticsMock = new Mock <IAnalyticsService>().Object;

            _vm = new DetailViewModel(navMock, analyticsMock);
        }
Exemple #24
0
        public static DetailViewModel ToDetailViewModel(this Location vm, IEnumerable <ActivatedFeature> activatedFeatures)
        {
            string displayName = vm.DisplayName;

            if (activatedFeatures == null)
            {
                activatedFeatures = new List <ActivatedFeature>();
            }

            var items = new List <KeyValuePair <string, string> >();

            items.Add(new KeyValuePair <string, string>(nameof(vm.DisplayName), vm.DisplayName));
            items.Add(new KeyValuePair <string, string>(nameof(Core.Common.Constants.Labels.UniqueLocationId), vm.Id.ToString()));
            items.Add(new KeyValuePair <string, string>(nameof(vm.Scope), vm.Scope.ToString()));
            items.Add(new KeyValuePair <string, string>(nameof(vm.Url), vm.Url));
            items.Add(new KeyValuePair <string, string>(nameof(vm.DataBaseId), vm.DataBaseId == null? string.Empty : vm.DataBaseId.ToString()));
            items.Add(new KeyValuePair <string, string>(nameof(vm.ChildCount), vm.ChildCount.ToString()));
            items.Add(new KeyValuePair <string, string>(Core.Common.Constants.Labels.NumberOfActivatedFeatures, activatedFeatures.Count().ToString()));
            items.Add(ConvertActivatedFeatures(activatedFeatures, false));

            if (!string.IsNullOrEmpty(vm.ParentId))
            {
                items.Add(new KeyValuePair <string, string>(nameof(vm.ParentId), string.Format("Location Id: {0}", vm.ParentId.ToString())));
            }

            var dvm = new DetailViewModel(displayName, items);

            return(dvm);
        }
Exemple #25
0
        public IActionResult Details(int id)
        {
            ViewData["BodyClass"] = "product-page";

            var detail = new DetailViewModel();

            detail.Product         = _productService.GetById(id);
            detail.Category        = _productCategoryService.GetById(detail.Product.CategoryId);
            detail.ProductImages   = _productService.GetImages(id);
            detail.RelatedProducts = _productService.GetRelatedProducts(id, 5);

            detail.UpsellProducts = _productService.GetUpSellProducts(5);
            detail.Colors         = _colorDapperService.GetColors(id).Select(n => new SelectListItem()
            {
                Value = n.Id.ToString(),
                Text  = n.Name
            }).ToList();

            detail.Sizes = _sizesDapperService.GetSizes(id).Select(n => new SelectListItem()
            {
                Value = n.Id.ToString(),
                Text  = n.Name
            }).ToList();

            detail.Tags = _productService.GetProductTags(id);

            return(View(detail));
        }
Exemple #26
0
        public ActionResult BlogDetail(string page, string id)
        {
            var data = new DetailViewModel();

            data.Init();
            return(View("BlogDetail", data));
        }
        public IActionResult Details(int id)
        {
            ViewData["BodyClass"] = "product-page";
            var model = new DetailViewModel();

            model.Product   = _productService.GetById(id);
            model.Category  = _productCategoryService.GetById(model.Product.CategoryId);
            model.Trademark = _productTrademarkService.GetById(model.Product.Id);
            //model.RelatedProducts = _productService.GetRelatedProducts(id, 9);
            //model.UpsellProducts = _productService.GetUpsellProducts(6);
            model.ProductImages = _productService.GetImages(id);
            //model.Tags = _productService.GetProductTags(id);
            model.Colors = _billService.GetColors().Select(x => new SelectListItem()
            {
                Text  = x.Name,
                Value = x.Id.ToString()
            }).ToList();
            model.Sizes = _billService.GetSizes().Select(x => new SelectListItem()
            {
                Text  = x.Name,
                Value = x.Id.ToString()
            }).ToList();

            return(View(model));
        }
Exemple #28
0
        public FirstView()
        {
            InitializeComponent();

            // Navigation to detail page
            this.listCharacters.ItemSelected += (object sender, SelectedItemChangedEventArgs e) =>
            {
                TVShowItemViewModel show = (TVShowItemViewModel)e.SelectedItem;
                var detailVm             = new DetailViewModel(show.Id);

                var detailView = new DetailView(detailVm);

                this.Navigation.PushAsync(detailView);
            };


            Device.OnPlatform(WinPhone: () =>
                              listCharacters.ItemTemplate = new DataTemplate(() =>
            {
                var nativeCell = new NativeCell();
                nativeCell.SetBinding(NativeCell.NameProperty, "Name");
                nativeCell.SetBinding(NativeCell.ThumbnailProperty, "Thumbnail");

                return(nativeCell);
            }));

            _vm            = new FirstViewModel();
            BindingContext = _vm;
        }
Exemple #29
0
        public void NavigateToContact(DetailViewModel fromModel)
        {
            var detailActivity = GetActivity <DetailViewModel, DetailActivity>(fromModel);
            var contactIntent  = new Intent(detailActivity, typeof(ContactActivity));

            detailActivity.NotNull().StartActivityForResult(contactIntent, 1);
        }
        public ActionResult Detail(long id, string mode)
        {
            var model       = new DetailViewModel();
            var detailModel = new List <PaymentDetailViewModel>();

            Payment payment       = paymentProvider.GetPayment(id);
            var     paymentDetail = paymentProvider.GetPaymentDetail(id);
            var     orderDetail   = orderProvider.GetOrderDetail(payment.OrderId);
            var     order         = orderProvider.GetOrder(payment.OrderId);

            mapper.Map(payment, model);
            mapper.Map(paymentDetail, detailModel);

            //model.ServiceCharge = order.ServiceCharge;
            model.TaxValue       = order.TaxAmount;
            model.DeliveryCharge = order.DeliveryCharge;
            model.DiscValue      = order.DiscValue;
            model.OrderId        = order.Id;
            model.UnitPriceMode  = orderProvider.GetUnitPriceMode(order.UnitPriceMode);
            model.List           = detailModel;
            model.OrderDetails   = mapper.Map <List <OrderViewModel.OrderDetailEntryViewModel> >(orderDetail);
            ViewBag.mode         = mode.XorString();
            if (!IsDetailModeValid(ViewBag.mode))
            {
                return(RedirectToAction("Index", "Home", new { area = String.Empty }));
            }

            return(View(model));
        }
Exemple #31
0
        public ShellViewModel(DetailViewModel bugDetails, ListViewModel bugList)
        {
            BugDetails = bugDetails;
            BugList = bugList;

            BugDetails.ActivateWith(this);
            BugList.ActivateWith(this);
        }
 public object Convert(object value, Type targetType, object parameter, string language)
 {
     if (value == null)
     {
         return null;
     }
     var feedItem = value as FeedItemViewModel;
     var detailVM = new DetailViewModel(feedItem);
     return detailVM;
 }
        public ActionResult Detail(string id)
        {
            var vm = new DetailViewModel
            {
            };

            if (id == "food")
            {
                vm.Title = "Food";
                vm.Images.Add("/content/images/bacon_500.jpg");
                vm.Images.Add("/content/images/dragonfruit_500.jpg");
                vm.Images.Add("/content/images/meat_500.jpg");
                vm.Images.Add("/content/images/lolwut_500.jpg");
            }
            else
            {
                vm.Title = "Humor";
                vm.Images.Add("/content/images/hogan_500.jpg");
                vm.Images.Add("/content/images/mitt_500.jpg");
            }

            return View(@"~\Views\ThirdPartyLibraries\KendoUIMobile\Detail.cshtml", vm);
        }
        public ActionResult Detail(string id)
        {
            var vm = new DetailViewModel
            {
            };

            if (id == "food")
            {
                vm.Title = "Food";
                vm.Images.Add(new Image { Name = "Bacon", Url = "/content/images/bacon_500.jpg", Description = "This is bacon, the healthy meat." });
                vm.Images.Add(new Image { Name = "Dragonfruit", Url = "/content/images/dragonfruit_500.jpg", Description = "This is dragonfruit that I had in Cambodia. Pretty tasty." });
                vm.Images.Add(new Image { Name = "Meat", Url = "/content/images/meat_500.jpg", Description = "The best way to eat meat..." });
                vm.Images.Add(new Image { Name = "Lolwut Pear", Url = "/content/images/lolwut_500.jpg", Description = "It would be a bit strange to eat this pear." });
            }
            else
            {
                vm.Title = "Humor";
                vm.Images.Add(new Image { Name = "Hulk Hogan", Url = "/content/images/hogan_500.jpg", Description = "Hulk Hogan is pretty awesome." });
                vm.Images.Add(new Image { Name = "Mitt Romney", Url = "/content/images/mitt_500.jpg", Description = "I really have nothing to say here." });
            }

            return View(@"~\Views\ThirdPartyLibraries\SenchaTouch\Detail.cshtml", vm);
        }
 public TopProductsDetailPage()
 {
     this.ViewModel = new DetailViewModel<DynamicStorageDataConfig, TopProducts1Schema>(new TopProductsConfig());
     this.InitializeComponent();            
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            RequestedTheme = Settings.Theme;

            if (e.Parameter != null)
            {
                var feedItem = e.Parameter as FeedItemViewModel;
                Vm = new DetailViewModel(feedItem);
            }
        }
 private void OnUnloaded(object sender, RoutedEventArgs e)
 {
     Vm = null;
     //await WebView.ClearTemporaryWebDataAsync();
     Debug.WriteLine("Unloaded");
 }
 public AlbumsDetailPage()
 {
     this.ViewModel = new DetailViewModel<LocalStorageDataConfig, Albums1Schema>(new AlbumsConfig());
     this.InitializeComponent();            
 }
 public OurStaffMembersDetailPage()
 {
     this.ViewModel = new DetailViewModel<DynamicStorageDataConfig, OurStaffMembers1Schema>(new OurStaffMembersConfig());
     this.InitializeComponent();            
 }
 public CollectionDetailPage()
 {
     this.ViewModel = new DetailViewModel<DynamicStorageDataConfig, Collection1Schema>(new CollectionConfig());
     this.InitializeComponent();            
 }
 public TeamDetailPage()
 {
     this.ViewModel = new DetailViewModel<Team1Schema>(new TeamConfig());
     this.InitializeComponent();            
 }
 public BlogDetailPage()
 {
     this.ViewModel = new DetailViewModel<RssDataConfig, RssSchema>(new BlogConfig());
     this.InitializeComponent();            
 }
 public CatalogDetailPage()
 {
     this.ViewModel = new DetailViewModel<Catalog1Schema>(new CatalogConfig());
     this.InitializeComponent();            
 }
 public LatestNewsDetailPage()
 {
     this.ViewModel = new DetailViewModel<RssDataConfig, RssSchema>(new LatestNewsConfig());
     this.InitializeComponent();            
 }
 public DiscographyDetailPage()
 {
     this.ViewModel = new DetailViewModel<DynamicStorageDataConfig, Discography1Schema>(new DiscographyConfig());
     this.InitializeComponent();            
 }
 public VideosDetailPage()
        : base(true)
 {
     this.ViewModel = new DetailViewModel<YouTubeDataConfig, YouTubeSchema>(new VideosConfig());
     this.InitializeComponent();            
 }
 public GalleryDetailPage()
        : base(true)
 {
     this.ViewModel = new DetailViewModel<DynamicStorageDataConfig, Gallery1Schema>(new GalleryConfig());
     this.InitializeComponent();            
 }
 public XboxMusicDetailPage()
 {
     this.ViewModel = new DetailViewModel<DynamicStorageDataConfig, XboxMusic1Schema>(new XboxMusicConfig());
     this.InitializeComponent();            
 }
 public FacebookDetailPage()
 {
     this.ViewModel = new DetailViewModel<FacebookDataConfig, FacebookSchema>(new FacebookConfig());
     this.InitializeComponent();            
 }
		public void Setup()
		{
			var navMock = new Mock<INavService> ().Object;
			vm = new DetailViewModel (navMock);
		}
 public InstagramDetailPage()
        : base(true)
 {
     this.ViewModel = new DetailViewModel<InstagramDataConfig, InstagramSchema>(new InstagramConfig());
     this.InitializeComponent();            
 }
 public DetailView(Zombie zombie)
 {
     InitializeComponent();
     var viewModel = new DetailViewModel(zombie);
     this.BindingContext = viewModel;
 }