public void Add(string categoryName, string seo) { _categoryTable.CategoryName = categoryName; _categoryTable.CategorySeo = seo; _categoryContext.Categories.Add(_categoryTable); _categoryContext.SaveChanges(); }
public void Add(string galleryUrl, string galleryCategory) { _galleryTable.ImageUrl = galleryUrl; _galleryTable.Category = galleryCategory; _galleryContext.Gallery.Add(_galleryTable); _galleryContext.SaveChanges(); }
public void Add(string articleTitle, string articleContent, string articleCategory, string articleSeo, string language) { _articlesTable.ArticleTitle = articleTitle; _articlesTable.ArticleContent = articleContent; _articlesTable.ArticleCategory = articleCategory; _articlesTable.ArticleSeo = articleSeo; _articlesTable.Language = language; _articleContext.Articles.Add(_articlesTable); _articleContext.SaveChanges(); }
public void Add(string headlineTitle, string headlineContent, string headlineImageUrl, string seo, string category, string language) { _headlineTable.HeadLineTitle = headlineTitle; _headlineTable.HeadLineContent = headlineContent; _headlineTable.HeadLineImageUrl = headlineImageUrl; _headlineTable.HeadLineSeo = seo; _headlineTable.HeadLineCategory = category; _headlineTable.Language = language; _headlineContext.HeadLine.Add(_headlineTable); _headlineContext.SaveChanges(); }
public bool UpdateAdmin(string adminName, string oldPassword, string newPassword) { var comingAdmin = (from p in _adminContext.Admin select p).First(cId => cId.AdminId > 0); if (oldPassword == comingAdmin.AdminPassword) { comingAdmin.AdminName = adminName; comingAdmin.AdminPassword = newPassword; _adminContext.SaveChanges(); return(true); } else { return(false); } }
public void Log(string userName, string userPassword) { try { AdminInformationTable adminTable = (from p in _FashionSiteContext.Admin select p).First(); if (userName == adminTable.AdminName && userPassword == adminTable.AdminPassword) { Status = true; } else { Status = false; } } catch (Exception) { _adminInformationTable.AdminName = "site"; _adminInformationTable.AdminPassword = "******"; using (FashionSiteContext db = new FashionSiteContext()) { db.Admin.Add(_adminInformationTable); db.SaveChanges(); } _adminInformationTable = (from p in _FashionSiteContext.Admin select p).First(); if (userName == _adminInformationTable.AdminName && userPassword == _adminInformationTable.AdminPassword) { Status = true; } else { Status = false; } } }
public void Add(string mediaUrl) { _mediaTable.MediaUrl = mediaUrl; _mediaContext.Medias.Add(_mediaTable); _mediaContext.SaveChanges(); }