public void Log(string userName, string userPassword)
        {
            try
            {
                AdminInformationsTable adminTable = (from p in _loginContext.AdminInformations select p).First();

                if (userName == adminTable.AdminName && userPassword == adminTable.AdminPassword)
                {
                    status = true;
                }
                else
                {
                    status = false;
                }

            }
            catch (Exception)
            {

                _adminMainTable.AdminName = "admin";
                _adminMainTable.AdminPassword = "******";
                using (MyWebContext db = new MyWebContext())
                {
                    db.AdminInformations.Add(_adminMainTable);
                    db.SaveChanges();
                }

                _adminMainTable = (from p in _loginContext.AdminInformations select p).First();

                if (userName == _adminMainTable.AdminName && userPassword == _adminMainTable.AdminPassword)
                {
                    status = true;
                }
                else
                {
                    status = false;
                }

            }
        }
        public ModelMail()
        {
            _mailContext = new MyWebContext();

            _mailsTable = new MailsTable();
        }
 public ModelFiles()
 {
     _filesTable = new FilesTable();
     _filesContext = new MyWebContext();
 }
 public ModelArticle()
 {
     _articlesContext = new MyWebContext();
     _articlesTable = new ArticlesTable();
 }
 public ModelMedia()
 {
     _mediaContext = new MyWebContext();
     _mediasTable = new MediasTable();
 }
 public ModelHome()
 {
     _homeContext=new MyWebContext();
 }
 public AdmSocialMediaController()
 {
     _socialMediasTable = new SocialMediasTable();
     _socialContext = new MyWebContext();
     _modelSocialMedia = new ModelSocialMedia();
 }
 public ModelWhatIDo()
 {
     _whatIDoContext = new MyWebContext();
     _whatIDoTable = new WhatIDoTable();
 }
 public ModelContact()
 {
     _messagesTable = new MessagesTable();
     _contactContext = new MyWebContext();
 }
 public LoginCore()
 {
     _adminMainTable = new AdminInformationsTable();
     _loginContext = new MyWebContext();
 }
 public ModelWhatIDo()
 {
     _whatIDoContext=new MyWebContext();
 }
Ejemplo n.º 12
0
 public ModelSeo()
 {
     _seoContentsTable=new SeoContentsTable();
     _seoContext=new MyWebContext();
 }
 public ModelContact()
 {
     _contactContext=new MyWebContext();
     _contactsTable=new ContactsTable();
 }
 public ContentDetailController()
 {
     _detailContext = new MyWebContext();
     _commentTable = new CommentsTable();
     _modelDetail = new ModelDetail();
 }
 public ModelTags()
 {
     _tagsContext = new MyWebContext();
 }
 public ModelComment()
 {
     _commentContext=new MyWebContext();
 }
 public ModelDetail()
 {
     _detailContext = new MyWebContext();
     _commentTable = new CommentsTable();
 }
 public ModelInformation()
 {
     _admContext=new MyWebContext();
 }
 public ModelFile()
 {
     _fileContext=new MyWebContext();
 }
 public ModelSearch()
 {
     _searchContext=new MyWebContext();
 }
 public ModelArticles()
 {
     _articlesContext = new MyWebContext();
 }