Ejemplo n.º 1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Orchestrator.WebUI.Security.Authorise.EnforceAuthorisation(eSystemPortion.GeneralUsage, eSystemPortion.Plan);

            m_requestId   = Convert.ToInt32(Request.QueryString["RequestId"]);
            m_sourceJobId = Convert.ToInt32(Request.QueryString["SourceJobId"]);
            m_targetJobId = Convert.ToInt32(Request.QueryString["TargetJobId"]);

            m_request = (Entities.PlannerRequest)ViewState[C_REQUEST_VS];

            if (!IsPostBack)
            {
                if (m_requestId > 0)
                {
                    m_isUpdate = true;

                    using (Facade.IPlannerRequest facPlannerRequest = new Facade.PlannerRequest())
                    {
                        m_request = facPlannerRequest.GetPlannerRequestForRequestId(m_requestId);
                        ViewState[C_REQUEST_VS] = m_request;

                        txtRequestText.Text   = m_request.RequestText;
                        txtSourceJobId.Text   = m_request.SourceJobId.ToString();
                        txtTargetJobId.Text   = m_request.TargetJobId.ToString();
                        chkUseDriver.Checked  = m_request.UseDriver;
                        chkUseVehicle.Checked = m_request.UseVehicle;
                        chkUseTrailer.Checked = m_request.UseTrailer;
                    }
                }
                else
                {
                    if (m_sourceJobId > 0)
                    {
                        txtSourceJobId.Text = m_sourceJobId.ToString();
                    }
                    if (m_targetJobId > 0)
                    {
                        txtTargetJobId.Text = m_targetJobId.ToString();
                    }
                }
            }

            if (m_request != null)
            {
                m_isUpdate  = true;
                btnAdd.Text = "Update Request";
            }
            else
            {
                btnAdd.Text = "Add Request";
            }

            lblConfirmation.Visible = false;
        }
Ejemplo n.º 2
0
        private void PopulateRequest()
        {
            if (m_request == null)
            {
                m_request = new Entities.PlannerRequest();
            }

            m_request.SourceJobId = Convert.ToInt32(txtSourceJobId.Text);
            m_request.TargetJobId = Convert.ToInt32(txtTargetJobId.Text);
            m_request.RequestText = txtRequestText.Text;
            m_request.UseDriver   = chkUseDriver.Checked;
            m_request.UseVehicle  = chkUseVehicle.Checked;
            m_request.UseTrailer  = chkUseTrailer.Checked;
        }