Beispiel #1
0
        private void readBox_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            int orderNumber = Int32.Parse(readBox.Rows[readBox.CurrentCell.RowIndex].Cells[2].Value.ToString());

            //
            using (authenticationID checkID = new authenticationID())
            {
                var result = checkID.ShowDialog();
                if (result == DialogResult.OK)
                {
                    string ID = checkID.ID;
                    if (PackingDB.SelectByOrder(orderNumber)[3][0] == ID)
                    {
                        PackingDB.closeOrder(orderNumber.ToString());
                        updateTable();
                    }
                    else if (PackingDB.SelectByOrder(orderNumber)[3][0] != ID)
                    {
                        MessageBox.Show("Invalid Employee ID Entered");
                    }
                }
            };
        }
Beispiel #2
0
        private void updateTracking()
        {
            if (inputUpdateTrackingOrder.Text != "" && inputUpdateTrackingNew.Text != "")
            {

                if (PackingDB.checkIsDuplicateOrder(inputUpdateTrackingOrder.Text) == true)
                {
                    using (authenticationID checkID = new authenticationID())
                    {
                        var result = checkID.ShowDialog();
                        if (result == DialogResult.OK)
                        {
                            string ID = checkID.ID;
                            try
                            {

                                if (PackingDB.SelectByOrder(Int32.Parse(inputUpdateTrackingOrder.Text))[3][0] == ID)
                                {
                                    PackingDB.updateTracking(inputUpdateTrackingOrder.Text, inputUpdateTrackingNew.Text);
                                    inputUpdateTrackingNew.Clear();
                                    inputUpdateTrackingOrder.Clear();
                                    updateTable();
                                    inputUpdateTrackingOrder.Focus();
                                }
                                else if (PackingDB.SelectByOrder(Int32.Parse(inputUpdateTrackingOrder.Text))[3][0] != ID)
                                {
                                    inputUpdateTrackingNew.Clear();
                                    inputUpdateTrackingOrder.Clear();
                                    MessageBox.Show("Unauthorized user");
                                }
                            }
                            catch { }
                        }

                    }
                }
                else
                {
                    inputUpdateTrackingNew.Clear();
                    inputUpdateTrackingOrder.Clear();
                    MessageBox.Show("Order number not found");
                }
            }
        }
Beispiel #3
0
        private void readBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F12)
            {
                using (authenticationID checkID = new authenticationID())
                {
                    var result = checkID.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        string ID = checkID.ID;

                        try
                        {
                            if (Int32.Parse(PackingDB.checkEmployee(ID)[5][0]) >= 4)
                            {
                                panelMain.Visible = false;
                                panelReports.Visible = true;
                            }
                            else
                            {
                                MessageBox.Show("You shouldn't be here");
                            }

                        }
                        catch
                        {
                            MessageBox.Show("You shouldn't be here");
                        }

                    }

                };
            }
        }