// PortOfDischarge void AC_Port3_TextChanged(object sender, EventArgs e) { string dischargePort = ((TextBox)AC_Port3.FindControl("txtPort")).Text; if (dischargePort != string.Empty) { if (dischargePort.Split('|').Length > 1) { string portCode = dischargePort.Split('|')[1].Trim(); int portId = new ImportBLL().GetPortId(portCode); ViewState["PORTOFDISCHARGEID"] = portId; hdnPortDischarge.Value = dischargePort.Split('|')[0].Trim(); } else { ViewState["PORTOFDISCHARGEID"] = null; } } else { ViewState["PORTOFDISCHARGEID"] = null; } }
private void LoadJob() { SearchCriteria newcriteria = new SearchCriteria(); SetDefaultSearchCriteria(newcriteria); IJob job = JobBLL.GetJobs(newcriteria, Convert.ToInt32(ViewState["JOBID"]), null).SingleOrDefault(); DisplayJobType(job.JobTypeID); if (job.JobTypeID == 1 || job.JobTypeID == 2) { lnkContainerDtls.Enabled = true; } else { lnkContainerDtls.Enabled = false; } ddlJobType.SelectedValue = job.JobTypeID.ToString(); ddlJobScope.SelectedValue = job.JobScopeID.ToString(); txtJobDate.Text = job.JobDate.ToShortDateString(); txtJobNo.Text = job.JobNo; ddlOpsControlled.SelectedValue = job.OpsLocID.ToString(); ddlDocControlled.SelectedValue = job.jobLocID.ToString(); ddlSalesControlled.SelectedValue = job.SalesmanID.ToString(); ddlShipmentMode.SelectedValue = job.SmodeID.ToString(); ddlShipmentMode_SelectedIndexChanged(null, null); ddlPrimeDocs.SelectedValue = job.PrDocID.ToString(); txtGrossWeight.Text = job.grwt.ToString(); txtVolumeWeight.Text = job.VolWt.ToString(); txtMTWeight.Text = job.weightMT.ToString(); txtCBMVolume.Text = job.volCBM.ToString(); txtRevenue.Text = job.RevTon.ToString(); txtPlaceReciept.Text = job.PlaceOfReceipt; txtCreditDays.Text = job.CreditDays.ToString(); txtDocumentNo.Text = job.DocumentNo.ToString(); txtJobNote1.Text = job.JobNote1.ToString(); txtJobNote2.Text = job.JobNote2.ToString(); txtVoyageNo.Text = job.Voyage.ToString(); chkPrintHBL.Checked = job.PrintHBL; ddlHblFormat.SelectedValue = job.HBLFormatID.ToString(); //Port of Discharge string dischargePort = new ImportBLL().GetPortNameById(job.fk_DportID); hdnPortDischarge.Value = dischargePort.Split('|')[0].Trim(); ((TextBox)AC_Port3.FindControl("txtPort")).Text = dischargePort; //Port of Loading string loadingPort = new ImportBLL().GetPortNameById(job.fk_LportID); hdnPortLoading.Value = loadingPort.Split('|')[0].Trim(); ((TextBox)AC_Port2.FindControl("txtPort")).Text = loadingPort; ViewState["PORTOFDISCHARGEID"] = job.fk_DportID; ViewState["PORTOFLOADINGID"] = job.fk_LportID; txtDelivery.Text = job.PlaceOfDelivery; ddlShippingLine.SelectedValue = job.FLineID.ToString(); ddlCustomer.SelectedValue = job.fk_CustID.ToString(); ddlCustomsAgent.SelectedValue = job.fk_CustAgentID.ToString(); ddlTransporter.SelectedValue = job.fk_TransID.ToString(); ddlOverseasAgent.SelectedValue = job.fk_OSID.ToString(); ddlCargoSource.SelectedValue = job.CargoSource.ToString(); ddlCompany.SelectedValue = job.CompID.ToString(); if (job.JobActive.ToString() == "C") { btnSave.Visible = false; } }