Esempio n. 1
0
        public IActionResult Head(string articleName)
        {
            logService.LogInformation($"{nameof(this.Head)} has been called");

            string title = "Results";

            switch (articleName)
            {
            case "course":
                title = "Results";
                break;

            case "details":
                title = "Details";
                break;

            default:
                break;
            }

            var model = new HeadViewModel {
                Title = $"{title} | Find a course | National Careers Service", Description = "FAC", Keywords = "fac", CanonicalUrl = "find-a-course", IsHidden = string.Compare(articleName, "searchFreeCourse", StringComparison.CurrentCultureIgnoreCase) == 0
            };

            logService.LogInformation($"{nameof(this.Head)} generated the model and ready to pass to the view");

            return(View(model));
        }
 public MainWindow()
 {
     InitializeComponent();
     hvModel          = new HeadViewModel(tbi);
     this.DataContext = hvModel;
     //Test();
 }
Esempio n. 3
0
 void UpdateHeadOutput(List <HeadModel> heads)
 {
     if (heads.Count > 0)
     {
         HeadViewModel.Update(heads[0]);
     }
 }
        public RepresentationViewModel(HeadViewModel head)
        {
            _head = head;

            RepresentationCells = new ObservableCollection<RepresentationCellViewModel>();

            CommandReset = new RelayCommand(Reset);
            //RaisePropertyChanged("RepresentationCells");
        }
Esempio n. 5
0
 private void CommandChangeProfileRelease(Y_NORM_PROFILE_HEAD profile)
 {
     Parallel.Invoke(() => LoadShow());
     LoadShow();
     Head = new HeadViewModel(profile.Y_NORM_NORMATIVE_HEAD.FirstOrDefault());
     RaisePropertyChanged("Head");
     RaisePropertyChanged("HeadVisibility");
     Parallel.Invoke(() => LoadHide());
 }
Esempio n. 6
0
        public void WhenHeadCalled_ReturnHtml()
        {
            var result = _controller.Head() as ViewResult;
            var vm     = new HeadViewModel {
                PageTitle = "Page Title",
            };
            var pageTitle = vm.PageTitle;

            result.Should().NotBeNull();
            result.Should().BeOfType <ViewResult>();
            result.ViewName.Should().BeNull();
        }
Esempio n. 7
0
        private HeadViewModel BuildHeadViewModel(JobProfileModel jobProfileModel)
        {
            var headModel = new HeadViewModel();

            if (jobProfileModel == null)
            {
                return(headModel);
            }

            headModel = mapper.Map <HeadViewModel>(jobProfileModel);
            headModel.CanonicalUrl = $"{Request.GetBaseAddress()}{ProfilePathRoot}/{jobProfileModel.CanonicalName}";
            return(headModel);
        }
        public void WhenHeadCalled_ReturnHtml()
        {
            var controller = new HomeController(_compositeSettings, _sessionService);

            controller.ControllerContext.HttpContext = new DefaultHttpContext();
            var result = controller.Head() as ViewResult;
            var vm     = new HeadViewModel
            {
                PageTitle = "Page Title",
            };
            var pageTitle = vm.PageTitle;

            result.Should().NotBeNull();
            result.Should().BeOfType <ViewResult>();
            result.ViewName.Should().BeNull();
        }
Esempio n. 9
0
        public async Task <IActionResult> Head(PageRequestModel pageRequestModel)
        {
            var(location, article) = PagesControlerHelpers.ExtractPageLocation(pageRequestModel);
            var viewModel        = new HeadViewModel();
            var contentPageModel = await pagesControlerHelpers.GetContentPageAsync(location, article).ConfigureAwait(false);

            if (contentPageModel != null)
            {
                mapper.Map(contentPageModel, viewModel);
                viewModel.CanonicalUrl = BuildCanonicalUrl(contentPageModel);
            }

            logger.LogInformation($"{nameof(Head)} has returned content for: /{location}/{article}");

            return(this.NegotiateContentResult(viewModel));
        }
Esempio n. 10
0
        public async Task <IActionResult> Head(string category, string article)
        {
            logger.LogInformation($"{nameof(Head)} has been called");

            var viewModel        = new HeadViewModel();
            var contentPageModel = await GetContentPageAsync(category, article).ConfigureAwait(false);

            if (contentPageModel != null)
            {
                mapper.Map(contentPageModel, viewModel);

                viewModel.CanonicalUrl = $"{Request.GetBaseAddress()}{contentPageModel.Category}/{contentPageModel.CanonicalName}";
            }

            logger.LogInformation($"{nameof(Head)} has returned content for: {category}/{article}");

            return(this.NegotiateContentResult(viewModel));
        }
Esempio n. 11
0
        public HeadViewModel Build(WebsiteModel websiteModel, PageModel pageModel, CategoryModel categoryModel, ProductModel productModel)
        {
            SetMetaInfo(pageModel);
            var viewModel = new HeadViewModel();
            var favicon   = websiteModel.Website.Fields.GetValue <Guid?>(AcceleratorWebsiteFieldNameConstants.LogotypeIcon);

            if (favicon.HasValue)
            {
                viewModel.Favicons = _faviconViewModelBuilder.Build(favicon.Value);
            }
            viewModel.MetaDescription = _metaService.GetDescription(pageModel.Page, categoryModel?.Category, productModel?.BaseProduct, productModel?.SelectedVariant);
            viewModel.Canonical       = _metaService.GetCanonical(pageModel.Page, categoryModel?.Category, productModel?.BaseProduct, productModel?.SelectedVariant);
            viewModel.MetaRobots      = _metaService.GetRobots(pageModel.Page, categoryModel?.Category, productModel?.BaseProduct);
            viewModel.Title           = $"{_metaService.GetTitle(pageModel.Page, categoryModel?.Category, productModel?.BaseProduct, productModel?.SelectedVariant)} {"site.title".AsWebSiteString()}";
            viewModel.OpenGraph       = _openGraphViewModelBuilder.Build(websiteModel.Website, pageModel.Page, categoryModel?.Category, productModel?.BaseProduct, productModel?.SelectedVariant);
            viewModel.TrackingScripts = _trackingScriptService.GetHeaderScripts(pageModel.Page);
            return(viewModel);
        }
Esempio n. 12
0
        public ActionResult UpdateHead(Head Head)
        {
            try
            {
                int countHead = 0;
                if (AppUtils.GetLoginRoleID() == AppUtils.ResellerRole)
                {
                    int resellerID = AppUtils.GetLoginUserID();
                    countHead = db.Head.Where(x => x.ResellerID == resellerID && x.HeadID != Head.HeadID && x.Status != AppUtils.TableStatusIsDelete && x.HeadeName.ToLower() == Head.HeadeName).Count();
                }
                else
                {
                    countHead = db.Head.Where(x => x.ResellerID == null && x.HeadID != Head.HeadID && x.Status != AppUtils.TableStatusIsDelete && x.HeadeName.ToLower() == Head.HeadeName).Count();
                }
                if (countHead > 0)
                {
                    return(Json(new { success = false, message = "Sorry Head Name Alraeady Exist." }, JsonRequestBehavior.AllowGet));
                }
                Head dbHead = new Head();
                dbHead                 = db.Head.Find(Head.HeadID);
                dbHead.HeadeName       = Head.HeadeName;
                dbHead.HeadTypeID      = Head.HeadTypeID;
                dbHead.UpdateBy        = AppUtils.GetLoginUserID();
                dbHead.UpdateDate      = AppUtils.GetDateTimeNow();
                db.Entry(dbHead).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();

                var HeadInfo =
                    new HeadViewModel()
                {
                    HeadID     = Head.HeadID,
                    HeadName   = Head.HeadeName,
                    HeadTypeId = Head.HeadTypeID,
                    UpdateHead = ISP_ManagementSystemModel.AppUtils.HasAccessInTheList(ISP_ManagementSystemModel.AppUtils.Update_Head) ? true : false,
                };
                var JSON = Json(new { success = true, HeadInfo = HeadInfo }, JsonRequestBehavior.AllowGet);
                JSON.MaxJsonLength = int.MaxValue;
                return(JSON);
            }
            catch (Exception ex)
            {
                return(Json(new { success = false }, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 13
0
        public ActionResult InsertHeadFromPopUp(Head Head)
        {
            try
            {
                int countHead = 0;
                if (AppUtils.GetLoginRoleID() == AppUtils.ResellerRole)
                {
                    int resellerID = AppUtils.GetLoginUserID();
                    countHead = db.Head.Where(x => x.ResellerID == resellerID && x.Status != AppUtils.TableStatusIsDelete && x.HeadeName.ToLower() == Head.HeadeName).Count();
                }
                else
                {
                    countHead = db.Head.Where(x => x.ResellerID == null && x.Status != AppUtils.TableStatusIsDelete && x.HeadeName.ToLower() == Head.HeadeName).Count();
                }
                if (countHead > 0)
                {
                    return(Json(new { success = false, message = "Sorry Head Name Alraeady Exist." }, JsonRequestBehavior.AllowGet));
                }
                if (AppUtils.GetLoginRoleID() == AppUtils.ResellerRole)
                {
                    Head.ResellerID = AppUtils.GetLoginUserID();
                }
                db.Head.Add(Head);
                Head.CreateBy   = AppUtils.GetLoginUserID();
                Head.CreateDate = AppUtils.GetDateTimeNow();
                Head.Status     = AppUtils.TableStatusIsActive;
                db.SaveChanges();
                HeadViewModel HeadInfo = new HeadViewModel
                {
                    HeadID     = Head.HeadID,
                    HeadName   = Head.HeadeName,
                    HeadTypeId = Head.HeadTypeID,
                    UpdateHead = ISP_ManagementSystemModel.AppUtils.HasAccessInTheList(ISP_ManagementSystemModel.AppUtils.Update_Head) ? true : false,
                };


                return(Json(new { SuccessInsert = true, HeadInfo = HeadInfo }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false }, JsonRequestBehavior.AllowGet));
            }
        }
        public List <BaseItemViewModel> SelectAllEquipment()
        {
            var list = new List <BaseItemViewModel>();

            using (var con = new SQLiteConnection(_cs))
            {
                con.Open();

                using (var cmd = new SQLiteCommand("select * from Equipment", con))
                {
                    using (var rdr = cmd.ExecuteReader())
                    {
                        while (rdr.Read())
                        {
                            BaseItemViewModel item;

                            var type = (EquipmentType)rdr.GetInt32(2);

                            switch (type)
                            {
                            case EquipmentType.Slot:
                                return(null);

                            case EquipmentType.Mainhand:
                                item = new MainhandViewModel(_messenger);
                                break;

                            case EquipmentType.Offhand:
                                item = new OffhandViewModel(_messenger);
                                break;

                            case EquipmentType.Head:
                                item = new HeadViewModel(_messenger);
                                break;

                            case EquipmentType.Body:
                                item = new BodyViewModel(_messenger);
                                break;

                            case EquipmentType.Neck:
                                item = new NeckViewModel(_messenger);
                                break;

                            case EquipmentType.Ring:
                                item = new RingViewModel(_messenger);
                                break;

                            case EquipmentType.Accessory:
                                item = new AccessoryViewModel(_messenger);
                                break;

                            case EquipmentType.Pet:
                                item = new PetViewModel(_messenger);
                                break;

                            case EquipmentType.Mount:
                                item = new MountViewModel(_messenger);
                                break;

                            default:
                                return(null);
                            }

                            item.ItemName = rdr.GetString(0);
                            item.Tier     = rdr.GetInt32(1);
                            item.Slot     = (EquipmentType)rdr.GetInt32(2);
                            item.Quality  = (ItemQuality)rdr.GetInt32(3);
                            item.Stats    = new StatsViewModel
                            {
                                Power           = (double)rdr.GetDecimal(5),
                                Stamina         = (double)rdr.GetDecimal(6),
                                Agility         = (double)rdr.GetDecimal(7),
                                AltPower        = (double)rdr.GetDecimal(8),
                                AltStamina      = (double)rdr.GetDecimal(9),
                                AltAgility      = (double)rdr.GetDecimal(10),
                                DamageBonus     = (double)rdr.GetDecimal(11),
                                HealthBonus     = (double)rdr.GetDecimal(12),
                                SpeedBonus      = (double)rdr.GetDecimal(13),
                                CriticalChance  = (double)rdr.GetDecimal(14),
                                CriticalDamage  = (double)rdr.GetDecimal(15),
                                DamageEnrage    = (double)rdr.GetDecimal(16),
                                DualStrike      = (double)rdr.GetDecimal(17),
                                EmpowerChance   = (double)rdr.GetDecimal(18),
                                QuadStrike      = (double)rdr.GetDecimal(19),
                                EvadeChance     = (double)rdr.GetDecimal(20),
                                BlockChance     = (double)rdr.GetDecimal(21),
                                LifeSteal       = (double)rdr.GetDecimal(22),
                                DeflectChance   = (double)rdr.GetDecimal(23),
                                AbsorbChance    = (double)rdr.GetDecimal(24),
                                DamageReduction = (double)rdr.GetDecimal(25),
                                RedirectChance  = (double)rdr.GetDecimal(26),
                                ItemFind        = (double)rdr.GetDecimal(27),
                                GoldFind        = (double)rdr.GetDecimal(28),
                                Experience      = (double)rdr.GetDecimal(29),
                                MovementSpeed   = (double)rdr.GetDecimal(30),
                                CaptureRate     = (double)rdr.GetDecimal(31)
                            };

                            list.Add(item);
                        }
                    }
                }

                con.Close();
            }

            return(list);
        }
Esempio n. 15
0
        public IActionResult Create()
        {
            var model = new HeadViewModel();

            return(View(model));
        }
        // GET: Head
        public ActionResult Head()
        {
            var headModel = new HeadViewModel(Sitecore.Context.Database.Items[siteSettingsItemPath], Sitecore.Context.Item);

            return(View("/Views/Partials/_Head.cshtml", headModel));
        }
Esempio n. 17
0
        public HeadView(HeadViewModel viewModel)
        {
            InitializeComponent();

            DataContext = viewModel;
        }