コード例 #1
0
        private void back(object sender, RoutedEventArgs e)
        {
            Window a = new HRMWindow(employee);

            a.Show();
            this.Close();
        }
コード例 #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Window home = new HRMWindow(employee);

            home.Show();
            this.Close();
        }
コード例 #3
0
        private void fire(object sender, RoutedEventArgs e)
        {
            DataTable dt3 = new DataTable();

            dt3 = connect.executeQuery("select * from fire where employeeid = '" + emp2.id + "'");
            if (dt3.Rows.Count == 0)
            {
                connect.executeUpdate("insert into fire values ('" + emp2.id + "', 'Pending', 'Manager')");
            }
            else
            {
                DataTable dt4 = new DataTable();
                dt4 = connect.executeQuery("select * from fire where employeeid = '" + emp2.id + "' and status = 'Pending' and acceptedby = 'HRM'");
                if (dt4.Rows.Count != 0)
                {
                    connect.executeQuery("update fire set status ='Accepted' where employeeid = '" + emp2.id + "' and acceptedby = 'HRM'");
                    connect.executeQuery("update employee set status = 'Inactive' where id = '" + emp2.id + "'");
                }
                else
                {
                    MessageBox.Show("Waiting for Manager Approval!");
                    return;
                }
                MessageBox.Show("Done Accepted Fire Request!");
                Window b = new HRMWindow(employee);
                b.Show();
                this.Close();
                return;
            }
            MessageBox.Show("Success Firing Request!");
            Window a = new HRMWindow(employee);

            a.Show();
            this.Close();
        }
コード例 #4
0
        private void submit(object sender, RoutedEventArgs e)
        {
            if (nametxt.Text == "")
            {
                MessageBox.Show("You Must Input Violation Name!");
                return;
            }
            if (combobox.SelectedIndex == -1)
            {
                MessageBox.Show("You Must Select Violation Type!");
                return;
            }
            string violationtype  = "";
            int    violationscore = 0;

            if (combobox.SelectedIndex == 0)
            {
                violationtype  = "Small";
                violationscore = 1;
            }
            else if (combobox.SelectedIndex == 1)
            {
                violationtype  = "Medium";
                violationscore = 2;
            }
            else
            {
                violationtype  = "High";
                violationscore = 3;
            }
            connect.executeUpdate("insert into violation values ('" + nametxt.Text.ToString() + "','" + violationtype + "'," + violationscore + ",'" + emp2.id + "')");
            MessageBox.Show("Done Insert Violation");
            Window a = new HRMWindow(employee);

            a.Show();
            this.Close();
        }
コード例 #5
0
        private void submit(object sender, RoutedEventArgs e)
        {
            string itemid = itemtxt.Text;

            DataTable dt = new DataTable();

            dt = connect.executeQuery("select * from item where employee = '" + employee.id + "' and itemid = '" + itemid + "' limit 1");

            if (dt.Rows.Count == 0)
            {
                label.Content = "Invalid item!";
                return;
            }
            else
            {
                DataRow data;
                data = dt.Rows[0];
                string emp = data["employee"].ToString();
                if (data["itemstatus"].ToString() == "Broken")
                {
                    label.Content = "Item is already reported!";
                    return;
                }
                else
                {
                    MessageBox.Show("Success Reporting Item");

                    connect.executeUpdate("insert into schedule values ('" + itemid + "', 'Teller " + data["itemname"].ToString() + "', CURRENT_DATE + (SELECT((COUNT(*) + 1) / 3) + 1 from item where itemstatus = 'Broken'),'Not Fixed')");

                    connect.executeUpdate("update item set itemstatus = 'Broken' where itemid = '" + itemid + "'");

                    Window back = new HRMWindow(employee);
                    back.Show();
                    this.Close();
                }
            }
        }
コード例 #6
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (username.Text == "")
            {
                MessageBox.Show("USERNAME MUST NOT BE EMPTY!");
                return;
            }
            if (password.Password == "")
            {
                MessageBox.Show("PASSWORD MUST NOT BE EMPTY!");
                return;
            }

            string id   = username.Text;
            string pass = password.Password;


            DataTable dt = new DataTable();

            dt = connect.executeQuery("select * from employee where id = '" + id + "' and password = '******' and status = 'Active' limit 1");

            if (dt.Rows.Count == 0)
            {
                MessageBox.Show("Invalid Username/Password!");
                return;
            }
            else
            {
                DataRow  data = dt.Rows[0];
                Employee emp  = new Employee(data["id"].ToString(), data["name"].ToString(), data["password"].ToString(), Int32.Parse(data["salary"].ToString()), float.Parse(data["rating"].ToString()), Int32.Parse(data["ratecount"].ToString()));
                MessageBox.Show("Success!");
                if (id[0] == 'T')
                {
                    Window tellerwindow = new TellerWindow(emp);
                    tellerwindow.Show();
                    this.Close();
                }
                else if (id[0] == 'C')
                {
                    Window cswindow = new CustomerService.CSWindow(emp);
                    cswindow.Show();
                    this.Close();
                }
                else if (id[0] == 'S')
                {
                    Window swindow = new Security_and_Maintenance_Team.SMWindow(emp);
                    swindow.Show();
                    this.Close();
                }
                else if (id[0] == 'M')
                {
                    Window mwindow = new Manager.ManagerWindow(emp);
                    mwindow.Show();
                    this.Close();
                }
                else if (id[0] == 'H')
                {
                    Window hwindow = new Human_Resource_Management_Team.HRMWindow(emp);
                    hwindow.Show();
                    this.Close();
                }
                else if (id[0] == 'F')
                {
                    Window fwindow = new Finance.FinanceWindow(emp);
                    fwindow.Show();
                    this.Close();
                }
            }
        }