private void LoadUnCommunicatedLegs()
        {
            // Populate the legs.
            Facade.IJob facJob = new Facade.Job();
            DataView    dv     = facJob.GetTrafficSheetForJobId(m_jobId).Tables[1].DefaultView;

            dv.RowFilter = "InstructionStateId = 2";

            dgTrafficSheet.DataSource = dv;
            dgTrafficSheet.DataBind();
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["JID"]))
            {
                if (int.TryParse(Request.QueryString["JID"], out m_jobID))
                {
                    bool subbedOutWholeJob = false;
                    _job = GetJobEntityFromCache();

                    foreach (Entities.JobSubContractor jsc in _job.SubContractors)
                    {
                        if (jsc.SubContractWholeJob)
                        {
                            _wholeJobSubcontractor = jsc;
                            _culture          = new CultureInfo(jsc.LCID);
                            subbedOutWholeJob = true;
                            break;
                        }
                    }

                    if (!IsPostBack)
                    {
                        if (!subbedOutWholeJob)
                        {
                            // Only show the legs and orders grid if not subbed out whole job
                            repLegSubbyRates.Visible = true;

                            Facade.IJob facJob = new Facade.Job();
                            DataTable   dt     = facJob.GetTrafficSheetForJobId(m_jobID).Tables[1];
                            repLegSubbyRates.DataSource = dt;
                            repLegSubbyRates.DataBind();
                        }
                        else
                        {
                            // ...otherwise, show the whole job rate controls.
                            fldWholeJobSubcontractInformation.Visible = true;
                            repLegSubbyRates.Visible = false;

                            txtWholeJobSubcontractRate.Attributes.Add("jobSubContractID", _wholeJobSubcontractor.JobSubContractID.ToString());
                            txtWholeJobSubcontractRate.Attributes.Add("LCID", _wholeJobSubcontractor.LCID.ToString());

                            txtWholeJobSubcontractRate.Culture = new CultureInfo(_wholeJobSubcontractor.LCID);
                            txtWholeJobSubcontractRate.Text    = _wholeJobSubcontractor.ForeignRate.ToString();
                            chkIsAttended.Checked = _wholeJobSubcontractor.IsAttended;
                            txtReference.Text     = _wholeJobSubcontractor.Reference;

                            if (_wholeJobSubcontractor.InvoiceID > 0)
                            {
                                // don't allow the user to update information as the invoice has already been generated
                                txtWholeJobSubcontractRate.Enabled = false;
                                chkIsAttended.Enabled  = false;
                                txtReference.Enabled   = false;
                                btnUpdateRates.Enabled = false;
                            }
                        }
                    }
                }
            }

            this.Master.WizardTitle = "Update Sub-Contract Rates";
        }