示例#1
0
        private void DeleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int selectedItem = rulesListView.FocusedItem.Index;
            int ruleID       = Conversions.ToInteger(rulesListView.Items[selectedItem].SubItems[1].Text);

            db.deleteRows(tableName, "where ID = " + ruleID.ToString());
            MdlScripts.populateMessageRules(rulesListView, tableName);
            Size     = (Size) new Point(533, 510);
            Location = new Point((int)Math.Round((My.MyProject.Computer.Screen.Bounds.Size.Width - Width) / 2d), (int)Math.Round((My.MyProject.Computer.Screen.Bounds.Size.Height - Height) / 2d));
            closeTouchButton.Location = new Point(470, 12);
        }
示例#2
0
        private void yesTouchButton_Load(object sender, EventArgs e)
        {
            if (My.MyProject.Forms.FrmDisplayContacts.isContact)
            {
                int selectedRowContact = My.MyProject.Forms.FrmDisplayContacts.contactsBunifuDataGridView.CurrentCell.RowIndex;
                int contactID          = Conversions.ToInteger(My.MyProject.Forms.FrmDisplayContacts.contactsBunifuDataGridView.Rows[selectedRowContact].Cells[5].Value);
                db.deleteRows("Contacts", " where ID = " + contactID.ToString());
                My.MyProject.Forms.FrmDisplayContacts.contactsBunifuDataGridView.Rows.RemoveAt(selectedRowContact);
            }
            else if (My.MyProject.Forms.FrmDisplayTemplates.isTemplate)
            {
                db.deleteRows("[Message Templates]", " where ID = " + My.MyProject.Forms.FrmDisplayTemplates.templatesListView.Items[My.MyProject.Forms.FrmDisplayTemplates.templatesListView.FocusedItem.Index].SubItems[3].Text);
                My.MyProject.Forms.FrmDisplayTemplates.templatesListView.Items[My.MyProject.Forms.FrmDisplayTemplates.templatesListView.FocusedItem.Index].Remove();
            }
            else
            {
                int selectedRow = My.MyProject.Forms.FrmDisplayContacts.companiesBunifuDataGridView.CurrentCell.RowIndex;
                int companyID   = Conversions.ToInteger(My.MyProject.Forms.FrmDisplayContacts.companiesBunifuDataGridView.Rows[selectedRow].Cells[4].Value);
                db.deleteRows("Company", " where CompanyID = " + companyID.ToString());
                My.MyProject.Forms.FrmDisplayContacts.companiesBunifuDataGridView.Rows.RemoveAt(selectedRow);
            }

            Close();
        }
示例#3
0
        private void yesBunifuButton_Click(object sender, EventArgs e)
        {
            buttonPressed = "Yes";
            MdlLoadingSetting.waitForm.Show();
            int    recordID = 0;
            object dataRows;
            string tabName = "";

            if (deleteRecord.Equals("InGate"))
            {
                for (int i = 0, loopTo = My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows.Count - 1; i <= loopTo; i++)
                {
                    if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows[i].Cells[1].Value, true, false)))
                    {
                        recordID = Conversions.ToInteger(My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows[i].Cells[0].Value);
                        break;
                    }
                }

                // dataRows = dbCeres.getTableInfo("[Containers In-Out]", "*", "where [Unique ID] = " + recordID.ToString).Rows(0)
                dbCeres.deleteRows("[Containers In-Out]", "where [Unique ID] = " + recordID.ToString());
                tabName = "IN-GATE";

                // dbLogs.createInOutGateLog(dataRows)

                EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, recordID.ToString(), "DELETE", tabName, "");
                My.MyProject.Forms.FrmInOutGate.getInOutContainers();
            }
            else if (deleteRecord.Equals("OutGate"))
            {
                for (int i = 0, loopTo1 = My.MyProject.Forms.FrmInOutGate.OutGateDataGridView.Rows.Count - 1; i <= loopTo1; i++)
                {
                    if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(My.MyProject.Forms.FrmInOutGate.OutGateDataGridView.Rows[i].Cells[1].Value, true, false)))
                    {
                        recordID = Conversions.ToInteger(My.MyProject.Forms.FrmInOutGate.OutGateDataGridView.Rows[i].Cells[0].Value);
                        break;
                    }
                }

                dbCeres.clearOutGate(recordID.ToString());
                tabName = "OUT-GATE";
                EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, recordID.ToString(), "DELETE", tabName, "");
                My.MyProject.Forms.FrmInOutGate.getInOutContainers();
            }
            else if (deleteRecord.Equals("Transfer"))
            {
                // Dim currentRow As Integer = FrmListTransfers.transfersBunifuDataGridView.CurrentRow.Index
                for (int i = My.MyProject.Forms.FrmListTransfers.transfersBunifuDataGridView.Rows.Count - 1; i >= 0; i -= 1)
                {
                    if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(My.MyProject.Forms.FrmListTransfers.transfersBunifuDataGridView.Rows[i].Cells[1].Value, true, false)))
                    {
                        recordID = Conversions.ToInteger(My.MyProject.Forms.FrmListTransfers.transfersBunifuDataGridView.Rows[i].Cells[0].Value);
                        dbCeres.deleteRows("[Allowed Transfers]", "where [ID] = " + recordID.ToString());
                        My.MyProject.Forms.FrmListTransfers.transfersBunifuDataGridView.Rows.RemoveAt(i);
                    }
                }
            }
            else if (deleteRecord.Equals("Block"))
            {
                // Dim currentRow As Integer = FrmListTransfers.transfersBunifuDataGridView.CurrentRow.Index
                for (int i = My.MyProject.Forms.FrmListBlockedContainers.blockContBunifuDataGridView.Rows.Count - 1; i >= 0; i -= 1)
                {
                    if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(My.MyProject.Forms.FrmListBlockedContainers.blockContBunifuDataGridView.Rows[i].Cells[1].Value, true, false)))
                    {
                        recordID = Conversions.ToInteger(My.MyProject.Forms.FrmListBlockedContainers.blockContBunifuDataGridView.Rows[i].Cells[0].Value);
                        dbCeres.deleteRows("[Blocked Containers]", "where [ID] = " + recordID.ToString());
                        My.MyProject.Forms.FrmListBlockedContainers.blockContBunifuDataGridView.Rows.RemoveAt(i);
                    }
                }
            }
            else if (deleteRecord.Equals("assign"))
            {
                My.MyProject.Forms.FrmAssignContainer.isDeletedFromExcel = true;
                Close();
            }
            else if (deleteRecord.Equals("Booking"))
            {
            }

            // Dim currentRow As Integer = FrmListTransfers.transfersBunifuDataGridView.CurrentRow.Index
            // Dim bokngNumb As String = FrmBookingList.selectedBookings(0)
            // dbCeres.deleteRows("[Bookings]", "where [Booking Number] = '" + bokngNumb + "'")
            // FrmBookingList.FetchBookingListing(True, "")
            else
            {
                Close();
            }
            // record deletion into Logs Database

            mainMessageLabel.Text        = "Record was deleted successfully";
            imageWarningLabel.ImageIndex = 1;
            tileLabel.Hide();
            confirmationPanel.Hide();
            confirmationBunifuTextBox.Text = "";
            ButtonPanel.Hide();
            MdlLoadingSetting.waitForm.Close();
        }