Exemplo n.º 1
0
        private void RailList1_RequestRailListModse(bool ActiveUnits)
        {
            MdlLoadingSetting.waitForm.Show();
            RailList1.TakeRailList(FetchRailList(ActiveUnits), true);
            // Call CompareAgainstUnitSources()

            MdlLoadingSetting.waitForm.Close();
        }
Exemplo n.º 2
0
        private void BunifuToggleSwitch1_OnValuechange(object sender, EventArgs e)
        {
            MdlLoadingSetting.waitForm.Show();
            try
            {
                RailList1.TakeRailList(FetchRailList(activeToggleSwitch.Value), true);
            }
            // Call CompareAgainstUnitSources(activeToggleSwitch.Value)
            // Call CompareAgainstUnitSources()
            catch (Exception ex)
            {
                string msg = ex.Message;
            }

            MdlLoadingSetting.waitForm.Close();
        }
Exemplo n.º 3
0
 public void LoadForm(bool Refresh)
 {
     if (Refresh == true)
     {
         Show();
         RailList1.TakeRailList(FetchRailList(true), true);
         // Call CompareAgainstUnitSources(True)
         RailList1.Select();
         btnAssociateBooking.Enabled = false;
         btnEditUnit.Enabled         = false;
     }
     else
     {
         RailList1.RequestSelectedUnitNumbers();
         MdlLoadingSetting.showDialogForm(My.MyProject.Forms.frmAssignUnitToBooking, ParentForm);
     }
     // CarregaUnit()
 }
Exemplo n.º 4
0
        private void btnAssociateBooking_Click(object sender, EventArgs e)
        {
            RailList1.RequestSelectedUnitNumbers();
            var    muRow            = new VW_UnitSourceMiniUnit();
            var    mbMU             = new DataTable();
            var    muRowList        = new List <VW_UnitSourceMiniUnit>();
            var    multiMUList      = new List <VW_UnitSourceMiniUnit>();
            var    muListToAssign   = new List <VW_UnitSourceMiniUnit>();
            string diffCargosList   = "";
            string diffCustomerList = "";
            var    SelectedUs       = UnitSourceService.GetByUnitSourceListById(SelectedUniSourceId);

            if (hasSameCargoTypes(SelectedUs, ref diffCargosList) == false)
            {
                My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("Can not proceed:", "It Seems like different cargo types has been selected. Please, select only one type of cargo type to continue." + Constants.vbNewLine + "Units:" + Constants.vbNewLine + diffCargosList, this);
                return;
            }
            else if (hasSameCustomers(SelectedUs, ref diffCustomerList) == false)
            {
                My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("Can not proceed:", "It Seems like different Customers has been selected. Please, select the same customer name  to continue." + Constants.vbNewLine + "Units:" + Constants.vbNewLine + diffCustomerList, this);
                return;
            }

            {
                var withBlock = My.MyProject.Forms.frmMiniUnitToAssign;

                // Lopp through selected Unit sources
                for (int i = 0, loopTo = SelectedUniSourceId.Count - 1; i <= loopTo; i++)
                {
                    // Get All MiniUnits from unitID
                    muRowList = VW_UnitSOurceMiniUnitService.GetByUnitSourceById(SelectedUniSourceId[i]);

                    // If more than one mu, send them to Form where user will pick the mini unit
                    if (muRowList.Count > 1)
                    {
                        foreach (var mu in muRowList)
                        {
                            multiMUList.Add(mu);
                        }
                        withBlock.VWUnitSourceMiniUnitBindingSource.DataSource = multiMUList;
                    }

                    // If theres only one MU, send it straigt to Form where mini unit will be asn to minibooking
                    else if (muRowList.Count == 1)
                    {
                        muListToAssign.Add(muRowList[0]);
                        My.MyProject.Forms.frmAssignUnitToBooking.dgvMiniUnit.DataSource = muListToAssign;
                    }

                    // If there's no mini unit, give the option to edit unit source, and repeat process
                    else if (My.MyProject.Forms.MessageBoxCeresYesNo.ShowDialog("There is not Mini Unit for this Unit.", "Create Mini Unit ?", My.Resources.Resources.caution, this) == DialogResult.Yes)
                    {
                        // FrmEditAddRailList.

                        var unit     = UnitSourceService.GetVWById(SelectedUniSourceId[i]);
                        var unitList = new List <VW_UnitSource>();
                        unitList.Add(unit);
                        My.MyProject.Forms.FrmEditAddRailList.isNewRecord = false;
                        My.MyProject.Forms.FrmEditAddRailList.isMultiEdit = false;
                        My.MyProject.Forms.FrmEditAddRailList.LoadForm(unitList);
                        RailList1.RequestSelectedUnitNumbers();
                        MdlLoadingSetting.showDialogForm(My.MyProject.Forms.FrmEditAddRailList, My.MyProject.Forms.FrmParentScreen);
                        muRowList = VW_UnitSOurceMiniUnitService.GetByUnitSourceById(SelectedUniSourceId[i]);
                        if (muRowList.Count > 1)
                        {
                            foreach (var mu in muRowList)
                            {
                                multiMUList.Add(mu);
                            }
                            withBlock.VWUnitSourceMiniUnitBindingSource.DataSource = multiMUList;
                        }
                        else if (muRowList.Count == 1)
                        {
                            muListToAssign.Add(muRowList[0]);
                            My.MyProject.Forms.frmAssignUnitToBooking.dgvMiniUnit.DataSource = muListToAssign;
                        }
                    }
                }

                if (My.MyProject.Forms.frmMiniUnitToAssign.VWUnitSourceMiniUnitBindingSource.Count > 1)
                {
                    MdlLoadingSetting.showDialogForm(My.MyProject.Forms.frmMiniUnitToAssign, this);
                }
                else if (Convert.ToInt32(((List <object>)My.MyProject.Forms.frmAssignUnitToBooking.dgvMiniUnit.DataSource).Count) > 0)
                {
                    MdlLoadingSetting.showDialogForm(My.MyProject.Forms.frmAssignUnitToBooking, this);
                }
                else
                {
                    RailList1.TakeRailList(FetchRailList(true), true);
                }
            }
        }
Exemplo n.º 5
0
 private void btnAddManyUnita_Click(object sender, EventArgs e)
 {
     MdlLoadingSetting.showDialogForm(My.MyProject.Forms.FrmAddMultipleUnits, this);
     RailList1.TakeRailList(FetchRailList(true), true);
 }