예제 #1
0
 public static IHtmlContent GovUkBackLink(
     this IHtmlHelper htmlHelper,
     BackLinkViewModel backLinkViewModel)
 {
     return(htmlHelper.Partial("~/Partials/BackLink.cshtml", backLinkViewModel));
 }
 public static IHtmlContent GovUkBackLink(
     this IHtmlHelper htmlHelper,
     BackLinkViewModel backLinkViewModel)
 {
     return(htmlHelper.Partial("/GovUkDesignSystemComponents/BackLink.cshtml", backLinkViewModel));
 }
예제 #3
0
        public ActionResult Details(string amountRange, string daRange)
        {
            if (amountRange == "0-0")
            {
                amountRange = null;
            }


            decimal startAmount = 0;

            decimal endAmount = 100000000;

            if (amountRange != null)
            {
                string[] amountItems = amountRange.Split('-');

                startAmount = Convert.ToDecimal(amountItems[0]);

                endAmount = Convert.ToDecimal(amountItems[1]);
            }

            int startDa = 0;

            int endDa = 100;

            if (daRange != null)
            {
                string[] items = daRange.Split('-');

                startDa = Convert.ToInt32(items[0]);

                endDa = Convert.ToInt32(items[1]);
            }



            Guid textId = new Guid("4c7ef240-8d78-4bdc-b332-3303608c9c7a");
            BackLinkViewModel backLink = new BackLinkViewModel();
            Text text = db.Texts.Find(textId);

            //backLink.Text = db.Texts.Where(current => current.Id == new Guid("4088d9fd-3930-4daa-8d70-07dfd73c0491")).FirstOrDefault();
            backLink.Questions = db.AskedQuestions.Where(current => current.IsDeleted == false && current.Param == "backlink" && current.IsActive == true).OrderBy(current => current.Order).ToList();

            backLink.BackLinks = GetBackLinks(endDa, startDa, endAmount, startAmount);

            backLink.Menu       = menu.ReturnMenu();
            backLink.FooterLink = menu.GetFooterLink();
            backLink.Username   = menu.ReturnUsername();
            backLink.Body       = db.Texts.Find(textId).Body;
            backLink.BottomText = GetTextById("d6169cea-9b7b-4ddf-a8c3-6757e7d8ece9");
            backLink.Rate       = text.AverageRate.Value.ToString().Replace('/', '.');
            ViewBag.Title       = text.PageTitle;
            ViewBag.Description = text.MetaDescription;
            ViewBag.Canonical   = "https://www.rushweb.ir/backlink";
            ViewBag.param       = null;
            ViewBag.rate        = text.AverageRate.Value.ToString().Replace('/', '.');
            int rateCount = db.Rates.Where(current => current.EntityId == text.Id).Count();

            if (rateCount > 0)
            {
                ViewBag.RatingCount = rateCount;
            }
            else
            {
                ViewBag.RatingCount = 1;
            }
            ViewBag.image        = "https://www.rushweb.ir" + text.ImageUrl;
            ViewBag.creationDate = text.CreationDate.ToString(CultureInfo.InvariantCulture);

            if (!string.IsNullOrEmpty(text.LastModifiedDate.ToString()))
            {
                ViewBag.ModifiedDate = text.LastModifiedDate.Value.ToString(CultureInfo.InvariantCulture);
            }
            else
            {
                ViewBag.ModifiedDate = text.CreationDate.ToString(CultureInfo.InvariantCulture);
            }
            return(View(backLink));
        }