示例#1
0
        private void btnComplete_Click(object sender, EventArgs e)
        {
            var pudoService = new RelOrderPickUpDropOffLocationService();
            var pudo = new RelOrderPickUpDropOffLocation();
            if (isNewRecord)
            {
                pudo.ReleaseOrderId = My.MyProject.Forms.FrmUpdateReqStatus.SelectedReleaseOrder.ReleaseOrderId;
            }
            else
            {
                pudo = RelOrderPickUpDropOffLocationService.GetById(relPuDol.RelOrderPickUpDropOffLocationId);
            }

            pudo.PickUpTerminalId = Conversions.ToInteger(cbPickUp.SelectedValue);
            pudo.DropOffYardLocationId = Conversions.ToInteger(cbDropOff.SelectedValue);
            pudo.QtyPickUpDropOff = (int)Math.Round(nudQtyCans.Value);
            if (pudoService.AddOrUpdate(pudo))
            {
                Close();
            }
            else
            {
                My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("An error occurred", "Something happened and the information was not saved", this);
            }
        }
示例#2
0
 private void btnEditDistReq_Click(object sender, EventArgs e)
 {
     if (dgvPickUpDropOf.Rows.Count > 0)
     {
         var VWRel = ReleaseService.GetVWByReleaseId(SelectedReleaseOrder.ReleaseId);
         My.MyProject.Forms.FrmAddEditRelease.PopulateInfo(VWRel);
         MdlLoadingSetting.showDialogForm(My.MyProject.Forms.FrmAddEditRelease, this);
         VWRelOrderPickUpDropOffLocationBindingSource.DataSource = RelOrderPickUpDropOffLocationService.GetByReleaseOrderId(SelectedReleaseOrder.ReleaseOrderId);
     }
 }
示例#3
0
 private void cboRelOrder_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!Information.IsNothing(cboRelOrder.DataSource))
     {
         SelectedReleaseOrder        = (VW_ReleaseOrder)cboRelOrder.SelectedItem;
         PickUpDropOffLocations      = RelOrderPickUpDropOffLocationService.GetByReleaseOrderId(SelectedReleaseOrder.ReleaseOrderId);
         dgvPickUpDropOff.DataSource = null;
         dgvPickUpDropOff.DataSource = PickUpDropOffLocations;
     }
 }
示例#4
0
 private void btnAddNewPUDO_Click(object sender, EventArgs e)
 {
     My.MyProject.Forms.FrmAddEditReleasePickUpDropOff.LoadForm();
     My.MyProject.Forms.FrmAddEditReleasePickUpDropOff.isNewRecord = true;
     MdlLoadingSetting.showDialogForm(My.MyProject.Forms.FrmAddEditReleasePickUpDropOff, this);
     PickUpDropOffLocations      = RelOrderPickUpDropOffLocationService.GetByReleaseOrderId(SelectedReleaseOrder.ReleaseOrderId);
     dgvPickUpDropOff.DataSource = null;
     dgvPickUpDropOff.DataSource = PickUpDropOffLocations;
     CalculateQtys();
 }
示例#5
0
        private void btnEditPuDo_Click(object sender, EventArgs e)
        {
            VW_RelOrderPickUpDropOffLocation relDistReq = (VW_RelOrderPickUpDropOffLocation)dgvPickUpDropOf.CurrentRow.DataBoundItem;

            My.MyProject.Forms.FrmAddEditReleasePickUpDropOff.PopulateInfo(relDistReq);
            MdlLoadingSetting.showDialogForm(My.MyProject.Forms.FrmAddEditReleasePickUpDropOff, this);
            var list       = RelOrderPickUpDropOffLocationService.GetByReleaseOrderId(SelectedReleaseOrder.ReleaseOrderId);
            var PickUpList = new SortableBindingList <VW_RelOrderPickUpDropOffLocation>(list);

            VWRelOrderPickUpDropOffLocationBindingSource.DataSource = PickUpList;
        }
示例#6
0
        /// <summary>
        /// 0 = RelOrderPudoList; 1 = RelDistReqList; 2 = PUDODateList
        /// </summary>
        public void RefreshList(int listId)
        {
            switch (listId)
            {
            case 0:
            {
                firstLoad = true;
                var list = RelOrderPickUpDropOffLocationService.GetAllByOpenStatus(tgOpenCloseRequest.Value);
                RelOrderPudoList = new SortableBindingList <VW_RelOrderPickUpDropOffLocation>(list);
                VWRelOrderPickUpDropOffLocationBindingSource.DataSource = null;
                VWRelOrderPickUpDropOffLocationBindingSource.DataSource = RelOrderPudoList;
                firstLoad = false;
                break;
            }

            case 1:
            {
                firstLoad = true;
                var list = ReleaseDistributionRequestService.GetByRelPUDOId(SelectedRelPUDORow.RelOrderPickUpDropOffLocationId);
                RelDistReqList = new SortableBindingList <VW_ReleaseDistributionRequest>(list);
                VWReleaseDistributionRequestBindingSource.DataSource = RelDistReqList;
                dgvRelDistReq.Refresh();
                if (RelDistReqList.Count > 0)
                {
                    SelRelDistReq = (VW_ReleaseDistributionRequest)dgvRelDistReq.CurrentRow.DataBoundItem;
                    CalculateTotals();
                    firstLoad = false;
                    RefreshList(2);
                }
                else
                {
                    RelDistRequestScheduleBindingSource.DataSource = null;
                }

                firstLoad = false;
                break;
            }

            case 2:
            {
                firstLoad = true;
                var list = RelDistRequestScheduleService.GetAllByRelDistReqId(SelRelDistReq.ReleaseDistributionRequestId);
                PUDOSchDateList = new SortableBindingList <RelDistRequestSchedule>(list);
                RelDistRequestScheduleBindingSource.DataSource = PUDOSchDateList;
                firstLoad = false;
                CalculateTotals();
                break;
            }
            }
        }
示例#7
0
        private void dgvReleases_SelectionChanged(object sender, EventArgs e)
        {
            if (dgvReleases.Rows.Count > 0 && firstLoad == false)
            {
                SelectedReleaseOrder = (VW_ReleaseOrder)dgvReleases.CurrentRow.DataBoundItem;
                var list = RelOrderPickUpDropOffLocationService.GetByReleaseOrderId(SelectedReleaseOrder.ReleaseOrderId);
                PudoList = new SortableBindingList <VW_RelOrderPickUpDropOffLocation>(list);
                VWRelOrderPickUpDropOffLocationBindingSource.DataSource = PudoList;
            }
            else if (dgvReleases.Rows.Count == 0)
            {
                VWRelOrderPickUpDropOffLocationBindingSource.DataSource = null;
            }

            CheckButtons();
        }
示例#8
0
        private void btnDelPuDo_Click(object sender, EventArgs e)
        {
            if (dgvPickUpDropOf.Rows.Count > 0)
            {
                var pudoSevice = new RelOrderPickUpDropOffLocationService();
                VW_RelOrderPickUpDropOffLocation selRow = (VW_RelOrderPickUpDropOffLocation)dgvPickUpDropOf.CurrentRow.DataBoundItem;
                var result = My.MyProject.Forms.MessageBoxCeresYesNo.ShowDialog("Are you sure of this?", "Pick up: " + selRow.PickUpTerminalName + Constants.vbNewLine + "Drop off: " + selRow.YardName + Constants.vbNewLine + "Are you sure you want to delete this location? This can not be undone", My.Resources.Resources.warning, this);
                if (result == DialogResult.Yes)
                {
                    if (pudoSevice.Delete(selRow.RelOrderPickUpDropOffLocationId))
                    {
                        VWRelOrderPickUpDropOffLocationBindingSource.DataSource = RelOrderPickUpDropOffLocationService.GetByReleaseOrderId(SelectedReleaseOrder.ReleaseOrderId);
                        Close();
                    }
                    else
                    {
                        My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("Location not deleted.", "Something went wrong and the location was not deleted. Please try again.", this);
                    }
                }

                CheckButtons();
            }
        }