private void fnSetFabTask(fabTasks val) { currentFabTask = val; if (val.Equals(fabTasks.addAdmin) || val.Equals(fabTasks.addManager) || val.Equals(fabTasks.addBus) || val.Equals(fabTasks.addGuard) || val.Equals(fabTasks.addDestination) || val.Equals(fabTasks.addRoute) || val.Equals(fabTasks.makeUserAdmin)) { fabTask.Source = new BitmapImage(new Uri(@"E:\Desktop\res\ic_check_white_48dp.png")); } }
//fab icons private void fnSetFabTask(fabTasks val) { currentFabTask = val; if (val.Equals(fabTasks.signUp) || val.Equals(fabTasks.typeSelection)) { fabTask.Source = new BitmapImage(new Uri(@"E:\Desktop\res\ic_check_white_48dp.png")); } }
private void fab_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (currentFabTask.Equals(fabTasks.unregister)) { //unregister fnSetFabTask(fabTasks.register); } else if (currentFabTask.Equals(fabTasks.register)) { //register fnSetFabTask(fabTasks.unregister); } }
private void fnSetFabTask(fabTasks val) { currentFabTask = val; if (val.Equals(fabTasks.unregister)) { fabTask.Source = new BitmapImage(new Uri(@"E:\Desktop\res\ic_cancel_white_48dp.png")); } else if (val.Equals(fabTasks.register)) { //set image for register fabTask.Source = new BitmapImage(new Uri(@"E:\Desktop\res\ic_assignment_ind_white_48dp.png")); } }
//fab actions private void fab_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (currentFabTask.Equals(fabTasks.typeSelection)) { if (loginAdminRb.IsChecked == true || loginManagerRb.IsChecked == true || loginUserRb.IsChecked == true) { typeSelectionScreen.Visibility = Visibility.Hidden; typeSelectionScreenShadow.Visibility = Visibility.Hidden; credentialScreen.Visibility = Visibility.Visible; credentialScreenShadow.Visibility = Visibility.Visible; actionPanelLabel.Content = "Enter Credentials"; fnSetFabVisible(Visibility.Hidden); fnSetFabTask(fabTasks.logInCredentials); } } else if (currentFabTask.Equals(fabTasks.logInCredentials)) { if (loginName.Text != "Enter Name") { if (loginPassword.Text != "Enter Password") { fnSetFabVisible(Visibility.Visible); logInValidation(); } } } else if (currentFabTask.Equals(fabTasks.signUp)) { table_User user = new table_User(); user.user_name = name.Text; user.user_phone = long.Parse(cell.Text); user.user_email = email.Text; user.user_password = hiddenPassword; user.user_current_login = user.user_last_login = DateTime.Now; user.user_current_login = DateTime.Now; //user.f_event_id = null; UserDAFactory userFac = new UserDAFactory(); if (userFac.signUp(user)) { MessageBox.Show("Saved"); signUpScreen.Visibility = Visibility.Hidden; signUpScreenShadow.Visibility = Visibility.Hidden; name.Text = "Enter Name"; cell.Text = "Enter Cell"; password.Text = "Enter Password"; email.Text = "Enter Email"; welcomeScreen.Visibility = Visibility.Visible; welcomeScreenShadow.Visibility = Visibility.Visible; actionPanelLabel.Content = "Welcome"; btnMainBack.Visibility = Visibility.Hidden; fnSetFabVisible(Visibility.Hidden); } else { MessageBox.Show("Not Saved"); } fnSetFabTask(fabTasks.signUp); } }