Example #1
0
        private void holdButton_Click(object sender, EventArgs e)
        {
            selectedAssgnContainers.Clear();
            for (int i = 0, loopTo = assignedContainersBunifuDataGridView2.Rows.Count - 1; i <= loopTo; i++)
            {
                if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(assignedContainersBunifuDataGridView2.Rows[i].Cells[0].Value, true, false)))
                {
                    if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(assignedContainersBunifuDataGridView2.Rows[i].Cells[12].Value, true, false)))
                    {
                        assignedContainersBunifuDataGridView2.Rows[i].Cells[12].Value = false;
                        assignedContainersBunifuDataGridView2.Rows[i].Cells[14].Value = "";
                        dbCeres.holdContainer(Conversions.ToInteger(assignedContainersBunifuDataGridView2.Rows[i].Cells[11].Value), false);
                    }
                    else
                    {
                        assignedContainersBunifuDataGridView2.Rows[i].Cells[14].Value = "HOLD";
                        assignedContainersBunifuDataGridView2.Rows[i].Cells[12].Value = true;
                        dbCeres.holdContainer(Conversions.ToInteger(assignedContainersBunifuDataGridView2.Rows[i].Cells[11].Value), true);
                    }

                    selectedAssgnContainers.Add(Conversions.ToString(assignedContainersBunifuDataGridView2.Rows[i].Cells[1].Value), Conversions.ToInteger(assignedContainersBunifuDataGridView2.Rows[i].Cells[11].Value));
                }
            }

            var cep = new CeresExcelPendingSync();

            cep.RecordId      = SelectedMBObj.MiniBookingId;
            cep.EmployeeId    = My.MyProject.Forms.FrmLoginWindow._userID;
            cep.SyncType      = "CONTAINER ASSIGNMENT";
            cep.ExtraInfo     = "";
            cep.CurrentStatus = "QUEUE";
            cep.QtyOfAttempts = 0;
            cep.SyncMessage   = "ADDED TO QUEUE";
            cep.CreatedAt     = DateAndTime.Now;
            CeresExcService.AddOrUpdate(cep);

            // Dim ThisXLSFile As String = ""
            // Dim ThisExcelFile = SelectedMBObj.MinibookingNumber + ".xls"
            // ThisXLSFile = focusedPath + ThisExcelFile

            // '         ThisXLSFile = "C:\Users\vania\Desktop\Booking\" + ThisExcelFile

            // If File.Exists(ThisXLSFile) Then

            // If IsExcelFileOpened(ThisXLSFile) = False Then

            // XLWorkbook = Excel.Workbooks.Open(ThisXLSFile, ReadOnly:=False)
            // XLWorkbook.Application.DisplayAlerts = False

            // Dim ContainerSheet As Worksheet = XLWorkbook.Sheets(2)

            // Call UpdateExcelBooking(ContainerSheet, selectedAssgnContainers, "assignedContainers",
            // SelectedMBObj.MinibookingNumber, False)

            // XLWorkbook.Close(False)
            // selectedAssgnContainers.Clear()
            // populateAssignedCOntainers()

            // MessageBoxCeresOK.ShowDialog("Sucess!", "", Me)

            // checkAssignButtons()
            // checkContainerButton()
            // Else

            // MsgBox(ThisXLSFile + ": Is Currently Opened!", MsgBoxStyle.OkOnly)
            // End If
            // Else

            // MsgBox(ThisXLSFile + ": Is Not Found!", MsgBoxStyle.OkOnly)
            // End If
        }