public void ProcessRequest(HttpContext context) { //context.Response.ContentType = "text/plain"; //context.Response.Write("Hello World"); if (context.Request.QueryString["id"] != null) { ImportBLL oImportBL = new ImportBLL(); int id = Convert.ToInt32(context.Request.QueryString["id"].ToString()); string name = context.Request.QueryString["n"].ToString(); DataTable dt = oImportBL.GetUploadedDocByID(id); if (dt != null) { Byte[] bytes = (Byte[])dt.Rows[0]["Image"]; context.Response.Buffer = true; context.Response.Charset = ""; context.Response.Cache.SetCacheability(HttpCacheability.NoCache); context.Response.ContentType = dt.Rows[0]["Type"].ToString();// dt.Rows[0]["ContentType"].ToString(); context.Response.AddHeader("content-disposition", "attachment;filename=" + name); context.Response.BinaryWrite(bytes); context.Response.Flush(); context.Response.End(); } } }
//public string[] GetBLNoList(string prefixText, int count,int Location, int Line) public string[] GetBLNoList(string prefixText, int count, string contextKey) { int Location = Convert.ToInt32(contextKey.Split('|')[0].ToString()); int Line = Convert.ToInt32(contextKey.Split('|')[1].ToString()); ImportBLL oImportBLL = new ImportBLL(); DataTable dt = oImportBLL.GetBLNo(Location, Line, prefixText); string[] BlNos = new string[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { BlNos[i] = AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(Convert.ToString(dt.Rows[i]["BLNo"]), Convert.ToString(dt.Rows[i]["BLID"])); } return(BlNos); }
void txtFreightPayableAt_TextChanged(object sender, EventArgs e) { string frtPayable = ((TextBox)txtFreightPayableAt.FindControl("txtPort")).Text; if (frtPayable != string.Empty) { if (frtPayable.Split('|').Length > 1) { string portCode = frtPayable.Split('|')[1].Trim(); int portId = new ImportBLL().GetPortId(portCode); ViewState["FRIEGHTPAYABLEATID"] = portId; } else { ViewState["FRIEGHTPAYABLEATID"] = null; } } else { ViewState["FRIEGHTPAYABLEATID"] = null; } }
void txtIssuePlace_TextChanged(object sender, EventArgs e) { string IssuePlace = ((TextBox)txtIssuePlace.FindControl("txtPort")).Text; if (IssuePlace != string.Empty) { if (IssuePlace.Split('|').Length > 1) { string portCode = IssuePlace.Split('|')[1].Trim(); int portId = new ImportBLL().GetPortId(portCode); ViewState["BLISSUEID"] = portId; } else { ViewState["BLISSUEID"] = null; } } else { ViewState["BLISSUEID"] = null; } }
//PortOfLoading void AC_Port2_TextChanged(object sender, EventArgs e) { string loadingPort = ((TextBox)AC_Port2.FindControl("txtPort")).Text; if (loadingPort != string.Empty) { if (loadingPort.Split('|').Length > 1) { string portCode = loadingPort.Split('|')[1].Trim(); int portId = new ImportBLL().GetPortId(portCode); ViewState["PORTOFLOADINGID"] = portId; hdnPortLoading.Value = loadingPort.Split('|')[0].Trim(); } else { ViewState["PORTOFLOADINGID"] = null; } } else { ViewState["PORTOFLOADINGID"] = null; } }
// 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; } }
protected void Button1_Click(object sender, EventArgs e) { ImportBLL.Importing(); }