コード例 #1
0
 public void Add(string categoryName, string seo)
 {
     _categoryTable.CategoryName = categoryName;
     _categoryTable.CategorySeo  = seo;
     _categoryContext.Categories.Add(_categoryTable);
     _categoryContext.SaveChanges();
 }
コード例 #2
0
 public void Add(string galleryUrl, string galleryCategory)
 {
     _galleryTable.ImageUrl = galleryUrl;
     _galleryTable.Category = galleryCategory;
     _galleryContext.Gallery.Add(_galleryTable);
     _galleryContext.SaveChanges();
 }
コード例 #3
0
 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();
 }
コード例 #4
0
 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();
 }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
        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;
                }
            }
        }
コード例 #7
0
ファイル: ModelMedia.cs プロジェクト: ersintarhan/FashionSite
 public void Add(string mediaUrl)
 {
     _mediaTable.MediaUrl = mediaUrl;
     _mediaContext.Medias.Add(_mediaTable);
     _mediaContext.SaveChanges();
 }