Example #1
0
 static ApplicationWindows()
 {
     try
     {
         DashboardWindow        = new DashboardWindow();
         MetadataWindow         = new AddonMetadataWindow();
         AddonWindow            = new AddonWindow();
         PluginWindow           = new PluginWindow();
         TypeWindow             = new TypeWindow();
         InstanceWindow         = new InstanceWindow();
         ActionWindow           = new ActionWindow();
         ConditionWindow        = new ConditionWindow();
         ExpressionWindow       = new ExpressionWindow();
         LanguageWindow         = new LanguageWindow();
         TestWidnow             = new TestWindow();
         OptionsWindow          = new OptionsWindow();
         FindAndReplaceWindow   = new SearchAndReplaceWindow();
         EffectPropertiesWindow = new EffectPropertiesWindow();
         EffectParameterWindow  = new EffectParameterWindow();
         EffectCodeWindow       = new EffectCodeWindow();
         C2Runtime = new C2RuntimeWindow();
         CssWindow = new CssWindow();
     }
     catch (Exception ex)
     {
         LogManager.AddErrorLog(ex);
         throw;
     }
 }
Example #2
0
        private void Login_Click(object sender, RoutedEventArgs e)
        {
            UserModel user = SQLToolbox.Login(Username.Text, Password.Password);

            if (user.Type != 0)
            {
                DashboardWindow dashboard = new DashboardWindow(user);
                dashboard.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Invalid username or password.");
            }
        }
        /// <summary>
        /// login to the wellness app by retrieving user
        /// </summary>
        private void Login(object obj)
        {
            Message = null;
            MyWellnessAppBusiness myWellnessAppBusiness = new MyWellnessAppBusiness();
            //List<User> user = myWellnessAppBusiness.RetreiveAllUserFromDataPath();
            List <User> user = myWellnessAppBusiness.GetAllUsers();

            if (!String.IsNullOrEmpty(InputUsername) && !String.IsNullOrEmpty(InputPassword))
            {
                foreach (var u in user)
                {
                    try
                    {
                        if (u.UserName == InputUsername && u.Password == InputPassword)
                        {
                            DashboardWindowViewModel dashboardWindowViewModel = new DashboardWindowViewModel(myWellnessAppBusiness.GetUser(u.ID));
                            DashboardWindow          dashboardWindow          = new DashboardWindow();

                            dashboardWindow.DataContext = dashboardWindowViewModel;
                            dashboardWindow.Show();

                            if (obj is System.Windows.Window)
                            {
                                (obj as System.Windows.Window).Close();
                            }
                        }
                        else
                        {
                            Message = "INCORRECT USERNAME OR PASSWORD";
                        }
                    }
                    catch (Exception e)
                    {
                        string m = e.Message;
                        throw;
                    }
                }
            }
            else
            {
                Message = "PLEASE VERIFY THAT YOU HAVE ENTER THE CORRECT USERNAME AND PASSWORD";
            }
        }
Example #4
0
        private void LoadWorkspaceAsync(string dbFile)
        {
            spinner.IsAdornerVisible = true;
            window.IsEnabled         = false;

            Thread th = new Thread(() =>
            {
                try
                {
                    Workspace.LoadWorkspace(workspacePath, dbFile);

                    Settings.LastPath = WorkspacePath;
                    Settings.Save();

                    GUI.Invoke(() =>
                    {
                        DashboardWindow dashboard = new DashboardWindow();
                        dashboard.Show();
                        window.Close();
                    });
                }
                catch (Exception e)
                {
                    GUI.Invoke(() => MessageBoxFactory.ShowError(e));
                }
                finally
                {
                    GUI.Invoke(() =>
                    {
                        window.IsEnabled         = true;
                        spinner.IsAdornerVisible = false;
                    });
                }
            });

            th.Start();
        }
Example #5
0
 public void MyAction(object parameter)
 {
     //MessageBox.Show("Command Fired with no code behind");
     using (DataAccess da = new DataAccess()) {
         try
         {
             //if (validateForm())
             //{
             DataTable dt = da.ValidateUserLogin(_email.Trim(), _password.Trim());
             if (dt.Rows.Count == 1)
             {
                 //LoginWindow loginWindow = new LoginWindow();
                 //loginWindow.Hide();
                 // this.Hide();
                 // setting global variables ToDO
                 Application.Current.MainWindow.Close();
                 DashboardWindow dashboardWindow = new DashboardWindow();
                 dashboardWindow.ShowDialog();
             }
             else
             {
                 MessageBox.Show("Invalid Username or Password!");
                 logger.LogError("Invalid Username or Password");
             }
             //}
             //else
             //{
             //    MessageBoxResult result = MessageBox.Show((string)Application.Current.FindResource("InvalidFormDataWarningMessage"), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
             //}
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
             logger.LogException(ex);
         }
     }
 }
        private void BtnLogin_Click(object sender, RoutedEventArgs e)
        {
            string login    = tbLogin.Text.Trim();
            string password = tbPassword.Password.Trim();
            Login  lg       = new Login();
            bool   a        = lg.LoginCheck(login, password);

            if (a)
            {
                DashboardWindow dashboard = new DashboardWindow();
                dashboard.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Login Or Password Wrong");
            }

            //DateTime a = DateTime.Now.AddDays(8);
            //DateTime b = DateTime.Now;
            //string c = (a - b).ToString();
            //string[] n =c.Split('.');
            //MessageBox.Show(n[0]);
        }
Example #7
0
        private void DashboardButton_Click(object sender, RoutedEventArgs e)
        {
            DashboardWindow window = new DashboardWindow();

            window.Show();
        }