Пример #1
0
        private void TouchAssignExtra_ButtonClick(object sender, EventArgs e)
        {
            int    x = 0;
            string ContainerNumber  = "";
            string ListOfContainers = "";

            ListOfContainers = My.MyProject.Forms.FrmListContainers.ContainerList2.GiveSeletcedContainers();
            if (typeBunifuDropdown3.SelectedItem.Equals("Storage"))
            {
                var loopTo = Strings.Len(ListOfContainers);
                for (x = 1; x <= loopTo; x += 11)
                {
                    ContainerNumber = Strings.Mid(ListOfContainers, x, 11);
                    AssignContainerToStorage(Conversions.ToString('\u0001'), ContainerNumber, selectectedBooking);
                    EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, "CanID: " + ContainerNumber, "ASSIGN", "CONTAINER", "Container assigned to Storage");
                    My.MyProject.Forms.FrmListContainers.ContainerList2.AssignedContainerType(ContainerNumber, Conversions.ToString('\u0002'), selectectedBooking);
                }
            }
            else
            {
                var loopTo1 = Strings.Len(ListOfContainers);
                for (x = 1; x <= loopTo1; x += 11)
                {
                    ContainerNumber = Strings.Mid(ListOfContainers, x, 11);
                    AssignContainerToStorage(Conversions.ToString('\u0002'), Strings.Mid(ListOfContainers, x, 11), selectectedBooking);
                    EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, "CanID: " + ContainerNumber, "ASSIGN", "CONTAINER", "Container assigned To Extra");
                    My.MyProject.Forms.FrmListContainers.ContainerList2.AssignedContainerType(ContainerNumber, Conversions.ToString('\u0002'), selectectedBooking);
                }
            }

            var CeresExcService = new CeresExcelPendingSyncService();
            var cep             = new CeresExcelPendingSync();

            cep.RecordId      = selectedMBId;
            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);
            My.MyProject.Forms.FrmListContainers.ContainerList2.ClearSelectedContainers();
            Close();
        }