/// <summary> /// Gets the entry URL. /// </summary> /// <param name="entry">The entry.</param> /// <returns></returns> public static string GetEntryUrl(Entry entry) { if (entry == null) { throw new ArgumentNullException("entry"); } string url = String.Empty; Seo seo = GetLanguageSeo(entry.SeoInfo); if (seo != null) { url = "~/" + seo.Uri; } if (String.IsNullOrEmpty(url) && !String.IsNullOrEmpty(entry.ID) && entry.ID != "0" && !entry.ID.StartsWith("@")) { return(CMSContext.Current.ResolveUrl(NavigationManager.GetUrl("EntryView", "ec", entry.ID))); } else { return(CMSContext.Current.ResolveUrl(url)); } }
public Seo SaveSeoMetaData(Seo seo) { SaveSeoMetaDataCommand saveSeoMetaDataCommand = new SaveSeoMetaDataCommand(seo); saveSeoMetaDataCommand.Execute(); return(saveSeoMetaDataCommand.CommandResult); }
public int ccc([Bind(Include = "categoryID,categoryName,parentCategory,logo")] ProductCategory productCategory, string googletitle, string googledescription, HttpPostedFileBase file) { var hhh = Request.Headers; if (ModelState.IsValid && productCategory.categoryName != null) { Seo seo = new Seo(); seo.categoryID = productCategory.categoryID; seo.title = googletitle; seo.description = googledescription; db.Seos.Add(seo); db.ProductCategories.Add(productCategory); db.SaveChanges(); if (file != null) { file.SaveAs(Server.MapPath("~/Images/Category/Menu/" + productCategory.categoryID + ".jpg")); } return(productCategory.categoryID); } return(0); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapGet("/robots.txt", async context => { await Seo.GenerateRobots(context); }); endpoints.MapGet("/sitemap.txt", async context => { await Seo.GenerateSitemap(context); }); endpoints.MapBlazorHub(); endpoints.MapFallbackToPage("/_Host"); }); }
public Seo GetSeoMetaData(Seo seo) { GetSeoMetaDataCommand getSeoMetaDataCommand = new GetSeoMetaDataCommand(seo); getSeoMetaDataCommand.Execute(); return(getSeoMetaDataCommand.CommandResult); }
public async Task <int> Handle(CreateCategoryCommand request, CancellationToken cancellationToken) { Seo seoEntity = null; if (!request.Seo.IsEmpty) { seoEntity = new Seo { Title = request.Seo.Title, Description = request.Seo.Description, Keywords = request.Seo.Keywords }; _context.Seo.Add(seoEntity); } var entity = new Category { ProjectId = request.ProjectId, Title = request.Title, Description = request.Description, ParentCategoryId = request.ParentCategoryId, Status = Status.Active, Seo = seoEntity }; _context.Categories.Add(entity); await _context.SaveChangesAsync(cancellationToken); return(entity.Id); }
public ActionResult UpdateArticleAdd(HttpPostedFileBase Image, bool?chkPublish, ArticlesTable articleTable) { var seoMake = Seo.Translate(articleTable.ArticleTitle); string filePath = articleTable.Image; int PublishId = articleTable.PublishId; if (Image != null) { filePath = Path.GetFileName(Image.FileName); filePath = seoMake + ".jpg"; var uploadPath = Path.Combine(Server.MapPath("~/Content/Images/"), filePath); Image.SaveAs(uploadPath); } if (chkPublish == true) { PublishId = 1; } else { PublishId = 0; } _modelArticle.UpdateArticleData(articleTable.ArticleTitle, articleTable.ArticleAuthor, articleTable.ArticleContent, articleTable.ArticleTags, DateTime.Now, seoMake, PublishId, filePath, articleTable.ArticleID); return(RedirectToAction("Index", "AdmArticles")); }
protected void btnGiris_Click(object sender, EventArgs e) { DataRow drGiris = klas.GetDataRow("Select * from Kullanici Where KullaniciAdi='" + Seo.Temizle(txtKullaniciAdi.Text) + "' and Sifre='" + Seo.Temizle(txtSifre.Text) + "' and GrupId=1003"); if (drGiris != null) { Session["KullaniciId"] = drGiris["KullaniciId"].ToString(); Response.Redirect("Default.aspx"); } else { DataRow drGiriss = klas.GetDataRow("Select * from Kullanici Where KullaniciAdi='" + Seo.Temizle(txtKullaniciAdi.Text) + "' and Sifre='" + Seo.Temizle(txtSifre.Text) + "' and GrupId=1002"); if (drGiriss != null) { Session["KullaniciId"] = drGiriss["KullaniciId"].ToString(); Response.Redirect("KullaniciAra.aspx"); } else { lblBilgi.Text = "Kullanıcı Adı veya Şifre Hatalı"; } } }
public ActionResult UpdateFilesAdd(HttpPostedFileBase FileImage, bool? chkPublish, FilesTable fileTable) { var seoMake = Seo.Translate(fileTable.FileTitle); string imagePath = fileTable.FileImage; int publishId = 0; if (FileImage != null) { imagePath = Path.GetFileName(FileImage.FileName); imagePath = seoMake + ".jpg"; var uploadPath = Path.Combine(Server.MapPath("~/Content/Images/"), imagePath); FileImage.SaveAs(uploadPath); } if (chkPublish == true) { publishId = 1; } _modelFiles.UpdateFileData(fileTable.FileTitle, fileTable.FileAuthor, fileTable.FileContent, fileTable.FileTags, DateTime.Now, seoMake, publishId, imagePath, fileTable.FileID); return RedirectToAction("Index", "AdmFiles"); }
protected void btnKaydet_Click(object sender, EventArgs e) { if (fuUrunResim.HasFile) { uzanti = Path.GetExtension(fuUrunResim.PostedFile.FileName); string baslik = fuUrunResim.FileName; resimadi = Seo.Temizle(baslik) + "_Urun_" + uzanti; fuUrunResim.SaveAs(Server.MapPath("../UrunResimleri/Silinecek" + uzanti)); int deger = 200; Bitmap resim = new Bitmap(Server.MapPath("../UrunResimleri/Silinecek" + uzanti));// Silinecek resmimizin boyutunu bitmap yapıyoruz using (Bitmap yeniResim = resim) { double Yukseklik = yeniResim.Height; double Genislik = yeniResim.Width; double Oran = 0; if (Genislik >= deger) { Oran = Genislik / Yukseklik; Genislik = deger; Yukseklik = deger / Oran; Size yenidegerler = new Size(Convert.ToInt32(Genislik), Convert.ToInt32(Yukseklik)); Bitmap SonResim = new Bitmap(yeniResim, yenidegerler); SonResim.Save(Server.MapPath("../UrunResimleri/200/" + resimadi)); SonResim.Dispose(); yeniResim.Dispose(); resim.Dispose(); } else { fuUrunResim.SaveAs(Server.MapPath("../UrunResimleri/200/" + uzanti)); } } FileInfo fisilinecek = new FileInfo(Server.MapPath("../UrunResimleri/Silinecek" + uzanti)); fisilinecek.Delete(); SqlConnection baglanti = klas.baglan(); SqlCommand cmd = new SqlCommand("insert into Urun (KategoriId,UrunAd,UrunResim,UrunOzellik) values(@KategoriId,@UrunAd,@UrunResim,@UrunOzellik)", baglanti); cmd.Parameters.Add("KategoriId", ddlKategori.SelectedValue); cmd.Parameters.Add("UrunAd", txtUrunAd.Text); cmd.Parameters.Add("UrunResim", resimadi); cmd.Parameters.Add("UrunOzellik", txtUrunOzellik.Text); cmd.ExecuteNonQuery(); Response.Redirect("UrunEkle.aspx"); } else { SqlConnection baglanti = klas.baglan(); SqlCommand cmd = new SqlCommand("insert into Urun (KategoriId,UrunAd,UrunResim,UrunOzellik) values(@KategoriId,@UrunAd,@UrunResim,@UrunOzellik)", baglanti); cmd.Parameters.Add("KategoriId", ddlKategori.SelectedValue); cmd.Parameters.Add("UrunAd", txtUrunAd.Text); cmd.Parameters.Add("UrunResim", "ResimYok.png"); cmd.Parameters.Add("UrunOzellik", txtUrunOzellik.Text); cmd.ExecuteNonQuery(); Response.Redirect("UrunEkle.aspx"); } }
public void SeoInit(Seo entity) { if (entity != null) { // IMPORTANT ViewData["title"] = entity.Title; ViewData["keywords"] = entity.KeyWords; ViewData["description"] = entity.Description; ViewData["robots"] = entity.Robots; // EXTEND ViewData["author"] = !string.IsNullOrEmpty(entity.Author) ? entity.Author : Utility.GetSetting("domain"); ViewData["type"] = entity.Type; ViewData["url"] = entity.Url; // Fast get, slowly process ViewData["canonical"] = entity.Canonical; ViewData["image"] = entity.Image; ViewData["imageW"] = entity.ImageW; ViewData["imageH"] = entity.ImageH; ViewData["datePublished"] = entity.DatePublished; ViewData["dateModified"] = entity.DateModified; ViewData["footer"] = entity.Footer; ViewData["nameApplicationLdJsonGoogleMeta"] = entity.NameApplicationLdJsonGoogleMeta; ViewData["typeGGS"] = entity.TypeGGS; if (string.IsNullOrEmpty(entity.ImageGG)) { entity.ImageGG = Utility.GetSetting("img-empty-link-default"); entity.ImageGGW = Utility.GetSetting("google-img-w"); entity.ImageGGH = Utility.GetSetting("google-img-h"); } ViewData["imageGG"] = entity.ImageGG; ViewData["imageGGW"] = entity.ImageGGW; ViewData["imageGGH"] = entity.ImageGGH; // You can use Open Graph tags to customize link previews. // Learn more: https://developers.facebook.com/docs/sharing/webmasters //ViewData["fb:app_id"] = entity.AppId; ViewData["typeFb"] = entity.TypeFB; ViewData["tagsFb"] = entity.TagsFB; if (string.IsNullOrEmpty(entity.ImageFB)) { entity.ImageFB = Utility.GetSetting("img-empty-link-default"); entity.ImageFBW = Utility.GetSetting("facebook-img-w"); entity.ImageFBH = Utility.GetSetting("facebook-img-h"); } ViewData["imageFB"] = entity.ImageFB; ViewData["imageFBW"] = entity.ImageFBW; ViewData["imageFBH"] = entity.ImageFBH; ViewData["twitterCard"] = entity.TwitterCard; ViewData["twitterCreator"] = entity.TwitterCreator; ViewData["twitterSite"] = entity.TwitterSite; } }
public Post() { ViewCount = 0; Seo = new Seo(); UIOption = new UIOption(); ActivityLog = new ActivityLog(); }
public static BllSeo ToBll(this Seo entity) { return(new BllSeo { Id = entity.Id, Name = entity.Name }); }
static void Main(string[] args) { try { string Root = null; #if DEBUG Root = Path.GetFullPath(Path.Combine(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName, @"..\..\..\..\", @"HMZ-Software\wwwroot\Blog")); #else Root = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"HMZ-Software\wwwroot\Blog")); #endif //Here we used the GetCurrentDirectory because the working directory is set via Azure Pipelines. string Domain = "https://www.hamzialsheikh.tk"; Console.WriteLine("Cleaning up..."); FileOps.CleanSite(Root); Console.WriteLine("Building the Markdig pipeline and compiling posts if they exist..."); var PostDocuments = MarkupCompilerFactory.GetOrCreate().CompileMarkdown(Root); string MainSiteDataPath = Path.Combine(Root, "Site"); Console.WriteLine("Creating the necessary directories if they're not already created..."); Directory.CreateDirectory(Path.Combine(MainSiteDataPath, "Metadata")); Directory.CreateDirectory(Path.Combine(MainSiteDataPath, "Site")); Console.WriteLine("Writing the compiled data to files in a form of .html and .yml..."); foreach (var Document in PostDocuments) { using (StreamWriter markdownStreamWriter = File.CreateText(Path.Combine(MainSiteDataPath, Document.Yaml.FileName) + ".html")) { markdownStreamWriter.Write(Document.Markdown); } using (StreamWriter yamlStreamWriter1 = File.CreateText(Path.Combine(MainSiteDataPath, Document.Yaml.FileName) + ".yml")) { yamlStreamWriter1.Write(YamlTools.SerializeYaml(Document.Yaml)); } } var YamlMetadata = PostDocuments.Select(p => p.Yaml).ToList(); Console.WriteLine("Constructing blog metadata..."); MetadataTool.ConstructMetadata(Root, YamlMetadata); Console.WriteLine("Building \"Robots.txt\"..."); Seo.ConstructRobots(Domain, YamlMetadata, Root.Substring(0, Root.LastIndexOf('\\') + 1)); Console.WriteLine("Building \"Sitemap.xml\"..."); Seo.ConstructSitemap(Domain, YamlMetadata, Root.Substring(0, Root.LastIndexOf('\\') + 1)); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public IActionResult AddUpdate(Seo seo) { ApiRequest <Seo> apiRequest = new ApiRequest <Seo>() { Body = seo }; ApiResponse <string> response = _business.AddUpdate(apiRequest); return(Ok(response)); }
public int Delete(Seo seo) { string sql = "delete from Seo where Id = @Id"; SqlParameter[] param = { new SqlParameter("@Id", seo.Id) }; return(SqlHelper.ExecuteNonQuery(sql, param)); }
public Property() { HasCarGarage = HasGarden = HasSwimming = false; NumberOfBathRoom = NumberOfBedRoom = NumberOfGarage = 0; OrderStatus = OrderStatus.InProcess; Seo = new Seo(); UIOption = new UIOption(); ActivityLog = new ActivityLog(); }
public UpdatePostViewModels() { BasicInformation = new PostBasicInformation(); Avatar = new List <_ImageCropper>(); HeaderImage = new List <_ImageCropper>(); Seo = new Seo(); UIOption = new UIOption(); ActivityLog = new ActivityLog(); }
/// <summary> /// Создает экземпляр и инициализирует поля класса. /// </summary> public BasePage ( SeoData seo, Navigation navigation, List <Breadcrumb> breadcrumbs ) { Navigation = navigation; Seo = new Seo(seo); Breadcrumbs = breadcrumbs ?? new List <Breadcrumb>(); }
public static Author Create(Hashtag hashtag, Seo seo) { Talent firstTalent = hashtag.Talents.FirstOrDefault(); string name = firstTalent?.Name ?? "גל\"צ"; string imageUrl = firstTalent?.Img ?? seo.Image; return(new Author( name, GalatzConstants.ToAbsoluteUrl(imageUrl))); }
public override object ProcessValue() { var seo = new Seo { Title = Context.Content.HasValue("seoTitle") ? Context.Content.GetPropertyValue <string>("seoTitle") : null, Description = Context.Content.HasValue("seoDescription") ? Context.Content.GetPropertyValue <string>("seoDescription") : null }; return(seo); }
/// <summary> /// Gets the node URL. /// </summary> /// <param name="node">The node.</param> /// <returns></returns> public static string GetNodeUrl(CatalogNode node) { string url = String.Empty; Seo seo = GetLanguageSeo(node.SeoInfo); if (seo != null) { url = "~/" + seo.Uri; } return(url); }
protected void btn_seo_Click(object sender, EventArgs e) { Seo s = new Seo() { Title = txt_seo_title.Text, Meta = txt_seo_meta.Text, MetaKeys = txt_seo_keywords.Text }; dcx.Seos.InsertOnSubmit(s); dcx.SubmitChanges(); }
public static Seo GetSeo(this SqlDataReader dataReader) { Seo result = new Seo(); while (dataReader.Read()) { result.SeoId = new int?(dataReader.GetValue <int>("SEODataId")); result.MetaDescription = dataReader.GetValue <string>("MetaDescription"); result.MetaKeyword = dataReader.GetValue <string>("MetaKeywords"); result.SeoCopyText = dataReader.GetValue <string>("SEOCopy"); } return(result); }
public void UpdateAfterSavingOneC(PyramidFinalContext dbContext, Categories dbObjext, Categories model, bool exist) { if (dbObjext.Seo == null) { var seo = new Seo() { MetaTitle = dbObjext.Title, }; dbContext.Seo.Add(seo); dbContext.SaveChanges(); dbObjext.Seo = seo; } }
public int Add(Seo seo) { string sql = "insert into Seo(Title,Keyword,Description,WebMenuId) values(@Title,@Keyword,@Description,@WebMenuId)"; SqlParameter[] param = { new SqlParameter("@Title", seo.Title), new SqlParameter("@Keyword", seo.Keyword), new SqlParameter("@Description", seo.Description), new SqlParameter("@WebMenuId", seo.WebMenuId) }; return(SqlHelper.ExecuteNonQuery(sql, param)); }
public static INewsItem Create(Hashtag hashtag, Seo seo) { var fullDate = DateTime.Parse(GetFullDate(hashtag)); return(new NewsItem( NewsSource.Galatz, hashtag._Hashtag, null, AuthorFactory.Create(hashtag, seo), fullDate, GalatzConstants.ToAbsoluteUrl(hashtag.Url), GalatzConstants.ToAbsoluteUrl(hashtag.Img), null)); }
public List <Seo> GetSeoList() { string sql = "select * from Seo"; var dt = SqlHelper.Query(sql, null); var list = new List <Seo>(); foreach (DataRow dr in dt.Rows) { Seo s = FillData(dr); list.Add(s); } return(list); }
public int Edit(Seo seo) { string sql = "update Seo set Title = @Title,Keyword=@Keyword,Description=@Description,WebMenuId=@WebMenuId where Id = @Id"; SqlParameter[] param = { new SqlParameter("@Title", seo.Title), new SqlParameter("@Keyword", seo.Keyword), new SqlParameter("@Description", seo.Description), new SqlParameter("@WebMenuId", seo.WebMenuId), new SqlParameter("@Id", seo.Id) }; return(SqlHelper.ExecuteNonQuery(sql, param)); }
public List <Seo> GetSeoListByTitle(string title) { string sql = "select * from Seo where Title like '%" + title + "%'"; var dt = SqlHelper.Query(sql, null); var list = new List <Seo>(); foreach (DataRow dr in dt.Rows) { Seo s = FillData(dr); list.Add(s); } return(list); }