Exemplo n.º 1
0
        ///	<summary>
        /// Populate Trailer
        ///	</summary>
        private void populateTrailer()
        {
            if (ViewState["trailer"] == null)
            {
                trailer = new Entities.Trailer();
                if (m_resourceId > 0)
                {
                    trailer.ResourceId = m_resourceId;
                }
            }
            else
            {
                trailer = (Entities.Trailer)ViewState["trailer"];
            }

            trailer.TrailerRef            = txtTrailerRef.Text;
            trailer.TrailerTypeId         = Convert.ToInt32(cboTrailerType.Items[cboTrailerType.SelectedIndex].Value);
            trailer.TrailerManufacturerId = Convert.ToInt32(cboTrailerManufacturer.Items[cboTrailerManufacturer.SelectedIndex].Value);
            trailer.TrailerDescriptionId  = cboTrailerDescription.SelectedIndex;
            trailer.HomePointId           = Convert.ToInt32(cboPoint.SelectedValue);

            trailer.ResourceType = eResourceType.Trailer;
            trailer.GPSUnitID    = txtGPSUnitID.Text;
            if (chkDelete.Checked)
            {
                trailer.ResourceStatus = eResourceStatus.Deleted;
            }
            else
            {
                trailer.ResourceStatus = eResourceStatus.Active;
            }

            trailer.ThirdPartyIntegrationID = (string.IsNullOrEmpty(txtThirdPartyIntegrationID.Text)) ? (long?)null : (long?)long.Parse(txtThirdPartyIntegrationID.Text);
        }
Exemplo n.º 2
0
        private void LoadTrailerAuditTrail()
        {
            pnlTrailer.Visible = true;

            Facade.ITrailer  facTrailer     = new Facade.Resource();
            Entities.Trailer currentTrailer = facTrailer.GetForTrailerId(currentID);

            lblPalletBalanceType.Text = "Trailer Pallet Audit Trail : " + currentTrailer.TrailerRef;

            Facade.IPalletBalance facPalletBalance = new Facade.Pallet();
            lvTrailerAudit.DataSource = facPalletBalance.GetTrailerAuditTrail(currentID, int.Parse(rcbPalletType.SelectedValue), rdiStartDate.SelectedDate.Value, rdiEndDate.SelectedDate.Value);
            lvTrailerAudit.DataBind();
        }
Exemplo n.º 3
0
        ///	<summary>
        /// Load Trailer
        ///	</summary>
        private void LoadTrailer()
        {
            if (ViewState["trailer"] == null)
            {
                Facade.ITrailer facTrailer = new Facade.Resource();
                trailer = facTrailer.GetForTrailerId(m_resourceId, true);
                ViewState["trailer"] = trailer;
            }
            else
            {
                trailer = (Entities.Trailer)ViewState["trailer"];
            }

            if (trailer != null)
            {
                txtTrailerRef.Text = trailer.TrailerRef;

                cboTrailerType.Items.FindByValue(trailer.TrailerTypeId.ToString()).Selected = true;
                cboTrailerManufacturer.Items.FindByValue(trailer.TrailerManufacturerId.ToString()).Selected = true;

                Facade.IPoint  facPoint = new Facade.Point();
                Entities.Point point    = facPoint.GetPointForPointId(trailer.HomePointId);

                cboOrganisation.Text          = point.OrganisationName;
                cboOrganisation.SelectedValue = point.IdentityId.ToString();

                m_organisationId = point.IdentityId;

                m_startTown   = point.PostTown.TownName;
                m_startTownId = point.PostTown.TownId;

                if (trailer.VehicleResourceID.HasValue)
                {
                    lblVehicle.Text = trailer.VehicleResource;
                }

                txtGPSUnitID.Text      = trailer.GPSUnitID;
                cboPoint.Text          = point.Description;
                cboPoint.SelectedValue = point.PointId.ToString();
                m_pointId = point.PointId;

                cboTrailerDescription.SelectedIndex = trailer.TrailerDescriptionId + 1;

                if (trailer.ResourceStatus == eResourceStatus.Deleted)
                {
                    chkDelete.Checked = true;
                }

                Entities.ControlArea ca = null;
                Entities.TrafficArea ta = null;

                using (Facade.IResource facResource = new Facade.Resource())
                    facResource.GetControllerForResourceId(trailer.ResourceId, ref ca, ref ta);

                if (ca != null && ta != null)
                {
                    cboControlArea.ClearSelection();
                    cboControlArea.Items.FindByValue(ca.ControlAreaId.ToString()).Selected = true;
                    cboTrafficArea.ClearSelection();
                    cboTrafficArea.Items.FindByValue(ta.TrafficAreaId.ToString()).Selected = true;
                }

                chkDelete.Visible         = true;
                pnlTrailerDeleted.Visible = true;

                txtThirdPartyIntegrationID.Text = (trailer.ThirdPartyIntegrationID.HasValue) ? trailer.ThirdPartyIntegrationID.ToString() : string.Empty;
            }

            btnAdd.Text = "Update";
        }
        private void BuildTrailerComments(eDriverCommunicationType communicationType, StringBuilder sbComments, Entities.Trailer trailer)
        {
            switch (communicationType)
            {
            case eDriverCommunicationType.Phone:
                sbComments.Append("TRAILER: ");
                break;

            case eDriverCommunicationType.Text:
                sbComments.Append("T: ");
                break;
            }
            sbComments.Append(trailer.TrailerRef);
            sbComments.Append(". ");
        }