private void Button_Click(object sender, RoutedEventArgs e)
        {
            InstitutionViewModel obj = new InstitutionViewModel();

            string id = txtIdNumber.Text;
            string pass = txtPassword.Text;
            string conpass = txtConfirmPassword.Text;

            var user = obj.getRegisteredUserLogin(id);
            if(user != null)
            {
            if ( pass != "" && conpass != "")
            {
                if (pass == conpass)
                {
                    obj.updateLogin(id,pass,conpass);
                    messageBox("Your password is been reset");
                        this.Frame.Navigate(typeof(LoginPage));
                }
                else
                {
                    messageBox("Your password must match");
                }
            }
            else {
                messageBox("Enter the correct information");
                }
            }
        }
Exemplo n.º 2
0
        public ObservableCollection <InstitutionViewModel> getAllInstitution()
        {
            institution = new ObservableCollection <InstitutionViewModel>();
            using (var db = new SQLite.SQLiteConnection(app.dbPath))
            {
                var query = db.Table <Institution>();

                foreach (var ins in query)
                {
                    var ins1 = new InstitutionViewModel()
                    {
                        ID   = ins.Id,
                        Name = ins.insitution
                    };
                    institution.Add(ins1);
                }
            }
            return(institution);
        }
        private void btnPassword_Click(object sender, RoutedEventArgs e)
        {
            string id = txtIDnumber.Text;
            string password, username;
            var obj = new InstitutionViewModel();

            var user = obj.getUser(id);
            if(user != null)
            {
                username = user.email;
                password = user.password;

                messageBox("password is " + password + "username is " + username);
            }else
            {
                messageBox("The user does not exist please make sure you enter a valid ID");
            }


        }
Exemplo n.º 4
0
        public ObservableCollection <InstitutionViewModel> getInstituionList(string name)
        {
            string nam = name + "%";

            list = new ObservableCollection <InstitutionViewModel>();
            using (var db = new SQLite.SQLiteConnection(app.dbPath))
            {
                //var query = db.Table<Courses>();
                var query = db.Query <Institution>("select * from Institution where institution  like '" + nam + "'");
                foreach (var ins in query)
                {
                    var ins1 = new InstitutionViewModel()
                    {
                        ID         = ins.Id,
                        Insitution = ins.insitution,
                    };
                    list.Add(ins1);
                }
            }
            return(list);
        }
Exemplo n.º 5
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     model = new InstitutionViewModel();
     if (model.getInstitution() == null)
     {
         model.addInstitution("Tshwane University of Technology");
         model.addInstitution("University of Johannesburg");
         model.addInstitution("Jeppe College");
         model.addInstitution("University of Limpopo");
         model.addInstitution("Tshwane North College");
       
     }
     if (model.getCourse() == null)
     {
         model.addCourse("Information Technology",64);
         model.addCourse("Policing", 64);
         model.addCourse("mechanical Engineering", 64);
         model.addCourse("Analytical chemistry", 65);
         model.addCourse("mechanical Engineering", 65);
         model.addCourse("Phamaceutical", 65);
         model.addCourse("Local Government Management", 66);
         model.addCourse("Policing", 66);
         model.addCourse("Accounting", 66);
         model.addCourse("Computer Sciences", 67);
         model.addCourse("Education", 67);
         model.addCourse("Phamaceutical", 67);
         model.addCourse("Road and Traffic Management", 68);
         model.addCourse("Local Government Management", 68);
         model.addCourse("Information Technology", 68);
         
     }
     if (model.getCareer() == null)
     {
         model.addCareers("Software Developer \n Telecommunication \n Business Analyst", "Information Technology");
         model.addCareers("Hire Resolve \n Construct Executive Research \n Maintanance", "mechanical Engineering");
         model.addCareers("Detective Service \n Criminal Investigator", "Policing");
         model.addCareers("Pharmacist \n Surgeon \n Medical Representative - Pharmaceutical Industry ", "Phamaceutical");
         model.addCareers("Chartered Accountant \n Accounting technician\nBusiness Analyst", "Accounting");
         model.addCareers("Pharmacist \n Laboratory Technician \nLab Analyst", "Analytical chemistry");
         model.addCareers("Supply chain Management \n Finacial Management Support\nConsultant: Waste Management", "Local Government Management");
         model.addCareers("Software Developer \n Data Analyst \n Software Engineer ", "Computer Sciences");
         model.addCareers("Educator \n Lecturer \n Professor and Head of Department ", "Education");
         model.addCareers("Traffic Accommodation Officer \n Specialist: Risk Management \n Traffic Cop ", "Road and Traffic Management");
        
     }
     if (model.getSubjectsOffered() == null)
     {
         model.addSubjectsOffered("Information Technology", "visual basics", "DSO17AT", "R1500");
         model.addSubjectsOffered("Information Technology", "System software", "SSF30AT", "R1700");
     }
     if (model.getSubjectsDone()== null)
     {
         model.addSubjectsDone("Mathematics", "Information Technology");
     }
     if (model.getHowTheyWork() == null)
     {
         model.addHowTheyWork( "Information Technology","Assets/it.jpg");
         model.addHowTheyWork("Policing", "Assets/download.jpg");
     }
     base.OnNavigatedTo(e);
 }