void My_PictureBox_MouseHover(object sender, EventArgs e)
        {
            Job_Display_Form temp = new Job_Display_Form();

            temp.Show();
        }
Beispiel #2
0
        public Form_Reminder()
        {
            InitializeComponent();

            crypting_Object = new Useful_Functions.SimpleAES();
            load_Values_From_Registry();

            reset_Event       = new System.Threading.ManualResetEvent(false);
            login_Reset_Event = new System.Threading.ManualResetEvent(false);
            db_Connect        = new DBConnect(database_Server, database_Name, database_Uid, database_Password);

            wipe_Out_The_User_Name_In_The_Registry();
            LoginWindow  login_Window      = new LoginWindow();
            bool         cancel_Pressed    = false;
            Company_Info temp_Company_Info = null;

            login_Window.button_Ok_Login.Click += new EventHandler((sender_0, e_0) =>
            {
                if (login_Window.textBox_Username_Login.Text == "")
                {
                    MessageBox.Show(login_Window, "Username can't be Empty", "Suggestion");
                    return;
                }
                else if (login_Window.textBox_Password_Login.Text == "")
                {
                    MessageBox.Show(login_Window, "Password can't be Empty");
                    return;
                }
                string encrypted_General_password = crypting_Object.EncryptToString(login_Window.textBox_Password_Login.Text);
                if (!db_Connect.Check_User_Account(login_Window.textBox_Username_Login.Text, encrypted_General_password, company_Name))
                {
                    MessageBox.Show(login_Window, "Username/Password is wrong");
                }
                else
                {
                    temp_Company_Info = db_Connect.get_Company_Info_For_This_Company_Name(company_Name);
                    username          = login_Window.textBox_Username_Login.Text;
                    put_This_User_Name_In_The_Registry(username);
                    login_Window.Hide();
                }
                login_Reset_Event.Set();
            });
            login_Window.button_Cancel_Login.Click += new EventHandler((sender_0, e_0) => {
                login_Window.Hide();
                cancel_Pressed = true;
                login_Reset_Event.Set();
            });
            login_Window.FormClosed += new FormClosedEventHandler((sender_0, e_0) => {
                login_Window.Hide();
                cancel_Pressed = true;
                login_Reset_Event.Set();
            });
            login_Window.ShowDialog();
            login_Reset_Event.WaitOne();

            if (cancel_Pressed)
            {
                Environment.Exit(0);
            }

            if (temp_Company_Info != null)
            {
                if (temp_Company_Info.message_Image_Path != "")
                {
                    Welcome_Window temp_Welcome_Window = new Welcome_Window(temp_Company_Info.message_Image_Path, temp_Company_Info.message);
                    temp_Welcome_Window.ShowDialog();
                }
            }

            Initialize_WebSocket();
            reset_Event.WaitOne();

            this.MouseClick += new MouseEventHandler(form_Reminder_MouseClick);

            clicked_My_PictureBox = null;
            picture_Boxes         = new List <My_PictureBox>();
            align_Picture_Boxes();

            this.Load   += new EventHandler(Form_Reminder_Load);
            this.Resize += new EventHandler((sender, e) => {
                if (WindowState == FormWindowState.Minimized)
                {
                    this.Hide();
                }
            });
            this.MinimizeBox = true;
            this.MaximizeBox = false;

            job_Display_Form = new Job_Display_Form();
            job_Display_Form.Hide();

            threads        = new List <System.Threading.Thread>();
            exit_Requested = false;
        }