Beispiel #1
0
        public void RegisterStd(string username, string password, string ques, string answer)
        {
            STUDENT std = new STUDENT();

            std.UserName1 = username;
            STUDENTDL.username.Add(username);
            std.Password1 = password;
            STUDENTDL.password.Add(password);
            std.SecretQuestion1 = ques;
            STUDENTDL.secretQ.Add(ques);
            std.Answer1 = answer;
            STUDENTDL.answer.Add(answer);

            /*bool x;
             * foreach (STUDENT s in STUDENTDL.list)
             * {
             *  if (s.UserName1 == username)
             *  {
             *      x = true;
             *  }
             * }
             * if (x == true)
             * {
             *  MessageBox.Show("User Already exists");
             * }*/
            STUDENTDL.list.Add(std);
        }
Beispiel #2
0
        public void RegisterStd(string username, string password, string ques, string answer)
        {
            STUDENT std = new STUDENT();

            std.UserName1 = username;
            std.Password1 = password;
            STUDENTDL.password.Add(password);
            std.SecretQuestion1 = ques;
            STUDENTDL.secretQ.Add(ques);
            std.Answer1 = answer;
            STUDENTDL.answer.Add(answer);
            STUDENTDL.list.Add(std);
        }
Beispiel #3
0
        public bool isValidUser(string userName, string password)
        {
            STUDENT stu     = new STUDENT();
            bool    isFound = false;

            foreach (STUDENT u in STUDENTDL.list)
            {
                if (u.UserName1 == userName && u.Password1 == password)
                {
                    STUDENTDL.username.Clear();
                    stu.UserName1 = userName;
                    STUDENTDL.username.Add(stu);
                    isFound = true;
                }
            }
            return(isFound);

            throw new NotImplementedException();
        }