Пример #1
0
        public void UpdateHesap(int incomingID, string incomingnickname, string incomingpassword)
        {
            User_Table control = dbContext.User_Table.Where(u => u.user_id == incomingID).FirstOrDefault();

            control.user_nickname = incomingnickname;
            control.user_password = incomingpassword;
            dbContext.SaveChanges();
        }
Пример #2
0
        public void BookAdd(string incomingBookname, string incomingWritename, string incomingChoise, int incomingUser_id)
        {
            Book_Table newuser = new Book_Table();

            newuser.user_id     = incomingUser_id;
            newuser.book_name   = incomingBookname;
            newuser.writer_name = incomingWritename;
            newuser.book_choise = incomingChoise;
            dbContext.Book_Table.Add(newuser);
            dbContext.SaveChanges();
        }
Пример #3
0
        public int SignUp(string incomingUsername, string incomingName, string incomingSurname, string incomingMail, string incomingPassword)
        {
            User_Table controlUsername = dbContext.User_Table.Where(u => u.user_nickname == incomingUsername).FirstOrDefault();
            User_Table controlMail     = dbContext.User_Table.Where(u => u.user_email == incomingName).FirstOrDefault();

            if (controlUsername != null)
            {
                return(-1);
            }
            else if (controlMail != null)
            {
                return(-2);
            }
            else
            {
                User_Table newuser = new User_Table();
                newuser.user_nickname = incomingUsername;
                newuser.user_name     = incomingName;
                newuser.user_surname  = incomingSurname;
                newuser.user_email    = incomingMail;
                newuser.user_password = incomingPassword;
                dbContext.User_Table.Add(newuser);
                dbContext.SaveChanges();
                return(newuser.user_id);
            }
        }
Пример #4
0
        public void UpdateAnswers(int incomingQuestionsID, string answermessage)
        {
            Travel_Questions_Table controlquestion = dbContext.Travel_Questions_Table.Where(u => u.travel_questions_id == incomingQuestionsID).FirstOrDefault();

            controlquestion.travel_answers_message = answermessage;
            dbContext.SaveChanges();
        }
Пример #5
0
        public void GetReliabilityPlus(int inComingID)
        {
            User_Info_Table control = dbContext.User_Info_Table.Where(u => u.user_id == inComingID).FirstOrDefault();

            control.user_info_reliability = +1;
            dbContext.SaveChanges();
        }