private Entity.VoyageEntity AssignVoyageProp(string voyageID) { Entity.VoyageEntity voyage = new Entity.VoyageEntity(); voyage.pk_VoyageID = Convert.ToInt32(voyageID); voyage.AltLGNo = txtAltLGNo.Text.ToUpper(); voyage.CargoDesc = txtCargoDesc.Text.ToUpper(); voyage.ImpXChangeRate = txtExcRate.Text.Trim() == "" ? 0 : Convert.ToDecimal(txtExcRate.Text.Trim()); voyage.IGMNo = txtIGMNo.Text.ToUpper(); //voyage.CallSign = txtCallSign.Text.ToUpper(); voyage.LGNo = txtLGNo.Text.ToUpper(); voyage.LightHouseDue = txtLightHouse.Text.Trim() == "" ? 0 : Convert.ToInt32(txtLightHouse.Text.Trim()); voyage.MotherDaughterDtl = txtMotherDaughter.Text.ToUpper(); voyage.PCCNo = txtPCCNo.Text.ToUpper(); voyage.ETATime = txtTime.Text.ToUpper(); voyage.TotalLines = txtTotLine.Text.ToUpper(); voyage.VCN = txtVCN.Text.ToUpper(); voyage.fk_VesselID = Convert.ToInt32(ddlVessel.SelectedValue); voyage.VIANo = txtVIA.Text.ToUpper(); voyage.VoyageNo = txtVoyageNo.Text.ToUpper(); voyage.CrewEffectList = ddlCrewEffList.SelectedValue; voyage.CrewList = ddlCrewList.SelectedValue; voyage.MaritimeList = ddlMaritime.SelectedValue; voyage.PassengerList = ddlPessengerList.SelectedValue; voyage.SameButtonCargo = ddlSameButton.SelectedValue; voyage.ShipStoreSubmitted = ddlShipStoreSubmitted.SelectedValue; voyage.fl_TerminalID = Convert.ToInt32(ddlTerminalID.SelectedValue); voyage.VesselType = ddlVesselType.SelectedValue; voyage.AddLandingDate = string.IsNullOrEmpty(txtdtAddLand.Text.Trim()) ? (Nullable <DateTime>)null : Convert.ToDateTime(txtdtAddLand.Text); voyage.ETADate = string.IsNullOrEmpty(txtdtETA.Text.Trim()) ? (Nullable <DateTime>)null : Convert.ToDateTime(txtdtETA.Text); voyage.IGMDate = string.IsNullOrEmpty(txtDtIGM.Text.Trim()) ? (Nullable <DateTime>)null : Convert.ToDateTime(txtDtIGM.Text); //voyage.OLandingDate = Convert.ToDateTime(hdnOldLandingDT.Value); voyage.OLandingDate = string.IsNullOrEmpty(hdnOldLandingDT.Value.Trim()) ? (Nullable <DateTime>)null : Convert.ToDateTime(hdnOldLandingDT.Value); voyage.LandingDate = string.IsNullOrEmpty(txtdtLand.Text.Trim()) ? (Nullable <DateTime>)null : Convert.ToDateTime(txtdtLand.Text); voyage.PCCDate = string.IsNullOrEmpty(txtdtPCC.Text.Trim()) ? (Nullable <DateTime>)null : Convert.ToDateTime(txtdtPCC.Text); voyage.locid = Convert.ToInt32(ddlLoc.SelectedValue); string port = ((TextBox)AutoCompletepPort1.FindControl("txtPort")).Text; port = port.Contains(',') && port.Split(',').Length >= 1 ? port.Split(',')[1].Trim() : ""; voyage.fk_LPortID = dbinteract.GetId("Port", port); if (port != "HALDIA,INHAL1") { voyage.AddLandingDate = null; } port = ((TextBox)AutoCompletepPort2.FindControl("txtPort")).Text; port = port.Contains(',') && port.Split(',').Length >= 1 ? port.Split(',')[1].Trim() : ""; voyage.fk_LPortID1 = dbinteract.GetId("Port", port); port = ((TextBox)AutoCompletepPort3.FindControl("txtPort")).Text; port = port.Contains(',') && port.Split(',').Length >= 1 ? port.Split(',')[1].Trim() : ""; voyage.fk_LPortID2 = dbinteract.GetId("Port", port); port = ((TextBox)AutoCompletepPort4.FindControl("txtPort")).Text; port = port.Contains(',') && port.Split(',').Length >= 1 ? port.Split(',')[1].Trim() : ""; voyage.fk_Pod = dbinteract.GetId("Port", port); return(voyage); }
private void LoadData(string VoyageId) { int intVoyageId = 0; if (VoyageId == "" || !Int32.TryParse(VoyageId, out intVoyageId)) { return; } BLL.DBInteraction dbinteract = new BLL.DBInteraction(); System.Data.DataSet ds = dbinteract.GetVoyage(Convert.ToInt32(VoyageId), "a", "", "", "", 0); if (!ReferenceEquals(ds, null) && ds.Tables[0].Rows.Count > 0) { ddlLoc.SelectedValue = ds.Tables[0].Rows[0]["pk_LocID"].ToString(); GeneralFunctions.PopulateDropDownList(ddlTerminalID, dbinteract.PopulateDDLDS("mstTerminal", "pk_TerminalID", "TerminalName] + '-' + [terminal", "Where fk_LocationID=" + ddlLoc.SelectedValue)); ddlTerminalID.SelectedValue = ds.Tables[0].Rows[0]["fl_TerminalID"].ToString(); txtAltLGNo.Text = ds.Tables[0].Rows[0]["AltLGNo"].ToString(); txtCargoDesc.Text = ds.Tables[0].Rows[0]["CargoDesc"].ToString(); txtExcRate.Text = ds.Tables[0].Rows[0]["ImpXChangeRate"].ToString(); txtIGMNo.Text = ds.Tables[0].Rows[0]["IGMNo"].ToString(); //txtCallSign.Text = ds.Tables[0].Rows[0]["CallSign"].ToString(); txtLGNo.Text = ds.Tables[0].Rows[0]["LGNo"].ToString(); txtLightHouse.Text = ds.Tables[0].Rows[0]["LightHouseDue"].ToString(); txtMotherDaughter.Text = ds.Tables[0].Rows[0]["MotherDaughterDtl"].ToString(); txtPCCNo.Text = ds.Tables[0].Rows[0]["PCCNo"].ToString(); txtTime.Text = ds.Tables[0].Rows[0]["ETATime"].ToString(); txtTotLine.Text = ds.Tables[0].Rows[0]["TotalLines"].ToString(); txtVCN.Text = ds.Tables[0].Rows[0]["VCN"].ToString(); ddlVessel.SelectedValue = ds.Tables[0].Rows[0]["fk_VesselID"].ToString(); txtVIA.Text = ds.Tables[0].Rows[0]["VIANo"].ToString(); txtVoyageNo.Text = ds.Tables[0].Rows[0]["VoyageNo"].ToString(); ddlCrewEffList.SelectedValue = ds.Tables[0].Rows[0]["CrewEffectList"].ToString(); ddlCrewList.SelectedValue = ds.Tables[0].Rows[0]["CrewList"].ToString(); ddlMaritime.SelectedValue = ds.Tables[0].Rows[0]["MaritimeList"].ToString(); ddlPessengerList.SelectedValue = ds.Tables[0].Rows[0]["PassengerList"].ToString(); ddlSameButton.SelectedValue = ds.Tables[0].Rows[0]["SameButtonCargo"].ToString(); ddlShipStoreSubmitted.SelectedValue = ds.Tables[0].Rows[0]["ShipStoreSubmitted"].ToString(); ddlTerminalID.SelectedValue = ds.Tables[0].Rows[0]["fl_TerminalID"].ToString(); txtdtETA.Text = ds.Tables[0].Rows[0]["ETADate"].ToString().Split(' ')[0]; txtdtLand.Text = ds.Tables[0].Rows[0]["AddLandingDate"].ToString().Split(' ')[0]; txtDtIGM.Text = ds.Tables[0].Rows[0]["IGMDate"].ToString().Split(' ')[0]; txtdtLand.Text = ds.Tables[0].Rows[0]["LandingDate"].ToString().Split(' ')[0]; hdnLandingDT.Value = ds.Tables[0].Rows[0]["LandingDate"].ToString().Split(' ')[0]; //Rajen hdnOldLandingDT.Value = ds.Tables[0].Rows[0]["LandingDate"].ToString().Split(' ')[0]; txtdtPCC.Text = ds.Tables[0].Rows[0]["PCCDate"].ToString().Split(' ')[0]; //txtdtAddLand.Text = ds.Tables[0].Rows[0]["__"].ToString(); ((TextBox)AutoCompletepPort1.FindControl("txtPort")).Text = ds.Tables[0].Rows[0]["lastport"].ToString(); ((TextBox)AutoCompletepPort2.FindControl("txtPort")).Text = ds.Tables[0].Rows[0]["lastport1"].ToString(); ((TextBox)AutoCompletepPort3.FindControl("txtPort")).Text = ds.Tables[0].Rows[0]["lastport2"].ToString(); ((TextBox)AutoCompletepPort4.FindControl("txtPort")).Text = ds.Tables[0].Rows[0]["portDischarge"].ToString(); } }
protected void ddlLoc_SelectedIndexChanged(object sender, EventArgs e) { //GenerateDDLVessel(); ddlLine.SelectedIndex = 0; ddlVessel.SelectedIndex = 0; if (ddlVoyage.Items.Count > 0) { ddlVoyage.SelectedIndex = 0; } ((TextBox)AutoCompletepPort1.FindControl("txtPort")).Text = ""; }
private void GenerateReport() { string pod = ((TextBox)AutoCompletepPort1.FindControl("txtPort")).Text; pod = pod.Contains(',') ? pod.Split(',')[1] : ""; if (pod.Trim() == "") { lblError.Attributes.Add("Style", "display:block"); return; } else { lblError.Attributes.Add("Style", "display:none"); } string FileName = COPRAR_TXT(); DownLoadFile(FileName); File.Delete(FileName); }
private void GenerateReport() { string pod = ((TextBox)AutoCompletepPort1.FindControl("txtPort")).Text; pod = pod.Contains(',') ? pod.Split(',')[1] : ""; if (pod.Trim() == "") { lblError.Attributes.Add("Style", "display:block"); return; } else { lblError.Attributes.Add("Style", "display:none"); } ReportBLL cls = new ReportBLL(); LocalReportManager reportManager = new LocalReportManager(rptViewer, "IGMCargoDesc", ConfigurationManager.AppSettings["ReportNamespace"].ToString(), ConfigurationManager.AppSettings["ReportPath"].ToString()); string rptName = "IGMCargoDesc.rdlc"; int vesselId = Convert.ToInt32(ddlVessel.SelectedValue); int voyageId = ddlVoyage.SelectedIndex > 0 ? Convert.ToInt32(ddlVoyage.SelectedValue) : 0; DBInteraction dbinteract = new DBInteraction(); DataSet ds = EMS.BLL.IGMReportBLL.GetRptCargoDesc(vesselId, voyageId, dbinteract.GetId("Port", pod)); try { rptViewer.Reset(); rptViewer.LocalReport.Dispose(); rptViewer.LocalReport.DataSources.Clear(); rptViewer.LocalReport.ReportPath = this.Server.MapPath(this.Request.ApplicationPath) + ConfigurationManager.AppSettings["ReportPath"].ToString() + "/" + rptName; rptViewer.LocalReport.SetParameters(new ReportParameter("ReportName", "C A R G O D E C L A R A T I O N")); rptViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", ds.Tables[0])); rptViewer.LocalReport.Refresh(); } catch { } }
public string COPRAR_TXT() { string rpd; int LocationId = Convert.ToInt32(ddlLoc.SelectedValue); int LineID = Convert.ToInt32(ddlLine.SelectedValue); int VesselID = Convert.ToInt32(ddlVessel.SelectedValue); int VoyageID = Convert.ToInt32(ddlVoyage.SelectedValue); //DateTime dt = DateTime.Now; string VCN; string CallSign; string IMONo; string VoyageNo; string Port; string Country; string Containers; string uniqueFileName = Guid.NewGuid().ToString(); //File.Create(Server.MapPath(@"~/Import/COPRARFILE/") + uniqueFileName + "_IMP_EDI.IGM"); string FileName = Server.MapPath(@"~/Import/EDIFile/") + uniqueFileName + "_COPRAR.TXT"; string PCSLogin = Convert.ToString(new DBInteraction().GetPCSLogin(LocationId).Tables[0].Rows[0]["PCSLoginID"]); string CurDate = DateTime.Now.ToString("ddMMyyyy") + "00000001"; string pod = ((TextBox)AutoCompletepPort1.FindControl("txtPort")).Text; pod = pod.Contains(',') ? pod.Split(',')[1] : ""; if (pod == "INCCU1") { rpd = "kopt001"; } else { rpd = "haldia001"; } int PortCode = dbinteract.GetId("Port", pod); StreamWriter writer = new StreamWriter(FileName); // ("myfile.txt") writer.WriteLine(("UNH" + ('' + ("COPRAR" + ('' + ("Advance Container List" + ('' + (CurDate + ('' + (CurDate + ('' + ("9" + ('' + (PCSLogin)))))))))))))); writer.WriteLine(("RPD" + ('' + (rpd)))); //System.Data.DataTable dt = EquipmentBLL.GetOMHinformation(LocationId, LineID, VesselID, VoyageID, PortCode); System.Data.DataSet ds = EquipmentBLL.GetOMHinformation(LocationId, LineID, VesselID, VoyageID, PortCode); //if (ds.Tables[0].Rows.Count > 0) //{ VCN = ds.Tables[0].Rows[0]["VCN"].ToString(); CallSign = ds.Tables[0].Rows[0]["CallSign"].ToString(); IMONo = ds.Tables[0].Rows[0]["IMONumber"].ToString(); VoyageNo = ds.Tables[0].Rows[0]["VoyageNo"].ToString(); Port = ds.Tables[0].Rows[0]["PortCode"].ToString(); Country = ds.Tables[0].Rows[0]["CountryAbbr"].ToString(); Containers = ds.Tables[0].Rows[0]["TotContainers"].ToString(); //} writer.WriteLine(("OMH" + ('' + (VCN + ('' + (CallSign + ('' + (IMONo + ('' + (VoyageNo + ('' + (Port + ('' + (Country + ('' + ("BLA" + ('' + ('' + ('' + ('' + ('' + (Containers)))))))))))))))))))))); DataSet DsContain = EquipmentBLL.GetCOPRARContainerInfo(VesselID, VoyageID, PortCode); //.GetCOPRARContainerInfo(Convert.ToInt32(ddlVessel.SelectedValue), Convert.ToInt32(ddlVoyage.SelectedValue)); // TextShippingCode.Text = Ds.Tables(0).Rows(0).Item("ShippingLineCode") DataTable DtContain = DsContain.Tables[0]; int Srl1 = 0; foreach (DataRow Dr in DtContain.Rows) { Srl1 = (Srl1 + 1); writer.WriteLine(("OMD" + ('' + ("3" + ('' + (Dr["ContainerNo"].ToString() + ('' + (Dr["cstatus"].ToString() + ('' + (Dr["ISOCode"].ToString() + ('' + (Dr["TareWeight"].ToString() + ('' + (Dr["CargoWtTon"].ToString() + ('' + ('' + (Dr["SealNo"].ToString() + ('' + (Dr["loadport"].ToString().Substring(0, 5) + "1" + ('' + (Dr["loadport"].ToString().Substring(0, 5) + "1" + ('' + ('' + (Dr["Commodity"].ToString() + ('' + (Dr["ImpLineBLNo"].ToString() + ('' + ('' + (Dr["ItemLineNo"].ToString() + ('' + ('' + ("12" + ('' + ("BLA" + ('' + ('' + ('' + ('' + (Dr["discport"].ToString() + ('' + (Dr["finalDestination"].ToString().Substring(0, 5) + "1" + ('' + (Dr["TMODE"].ToString() + ('' + (Dr["ICD"].ToString() + ('' + ("1" + ('' + ("" + ('' + ("" + ('' + ("" + ('' + ("" + ('' + ("" + ('' + ("" + ('' + ("" + ('' )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))); } string dt = DateTime.Now.ToString("ddMMyyyyhhmmss"); writer.WriteLine(("UNT" + ('' + (dt)))); writer.Close(); writer.Dispose(); return(FileName); }