public static List <IexpVoyage> GetVoyageList(SearchCriteria searchCriteria) { string strExecution = "[exp].[prcGetVoyageList]"; List <IexpVoyage> lstVoyage = new List <IexpVoyage>(); using (DbQuery oDq = new DbQuery(strExecution)) { oDq.AddBigIntegerParam("@pk_VoyageID", searchCriteria.VoyageID); oDq.AddVarcharParam("@vesselName", 70, searchCriteria.Vessel); oDq.AddVarcharParam("@VoyageNo", 10, searchCriteria.Voyage); oDq.AddVarcharParam("@Location", 100, searchCriteria.Location); oDq.AddIntegerParam("@locationid", searchCriteria.LocationID); oDq.AddVarcharParam("@Terminal", 100, searchCriteria.Terminal); oDq.AddIntegerParam("@Status", searchCriteria.IntegerOption1); DataTableReader reader = oDq.GetTableReader(); while (reader.Read()) { IexpVoyage ivoyage = new expVoyageEntity(reader); lstVoyage.Add(ivoyage); } reader.Close(); } return(lstVoyage); }
protected void btnClose_Click(object sender, EventArgs e) { IexpVoyage voyage = new expVoyageEntity(); BuildInvoiceEntity(voyage); long ErrVal = new expVoyageBLL().CloseVoyage(voyage); if (ErrVal == 1) { lblMessage.Text = "Booking Charges Missing. Voyage not closed"; } if (ErrVal == 2) { lblMessage.Text = "Container Mismatch Between Booking and BL. Voyage not closed"; } if (ErrVal == 3) { lblMessage.Text = "Freight Invoice Not Generated against BL. Voyage not closed"; } if (ErrVal == 4) { lblMessage.Text = "Equipment and Booking Mismatch. Voyage not closed"; } if (ErrVal == 5) { lblMessage.Text = "No Booking against Vessel & Voyage. Voyage not closed"; } if (ErrVal == 6) { lblMessage.Text = "No Export BL against Vessel & Voyage. Voyage not closed"; } if (ErrVal == -1) { lblMessage.Text = "Voyage Closed Successfully"; Response.Redirect("~/Export/Voyage.aspx"); } if (ErrVal == -2) { lblMessage.Text = "Voyage Opened Successfully"; Response.Redirect("~/Export/Voyage.aspx"); } }
public static IexpVoyage GetVogageById(long voyageId) { string strExecution = "[exp].[usp_Voyage_GetVoyageById]"; IexpVoyage voyage = null; using (DbQuery oDq = new DbQuery(strExecution)) { oDq.AddBigIntegerParam("@voyageID", voyageId); DataTableReader reader = oDq.GetTableReader(); while (reader.Read()) { voyage = new expVoyageEntity(reader); } reader.Close(); } return(voyage); }
protected void btnSave_Click(object sender, EventArgs e) { try { //string misc = string.Empty; IexpVoyage voyage = new expVoyageEntity(); BuildInvoiceEntity(voyage); if (voyage.POL == 0) { GeneralFunctions.RegisterAlertScript(this, "Please provide Port of Loading"); return; } if (voyage.NextPortID == 0) { GeneralFunctions.RegisterAlertScript(this, "Please provide Next Port Call"); return; } if (voyage.ETA > voyage.ETD) { GeneralFunctions.RegisterAlertScript(this, "ETA should be less than Equals ETD"); return; } if (voyage.ETD > voyage.ETANextPort) { GeneralFunctions.RegisterAlertScript(this, "ETD should be less than ETA next port"); return; } if (voyage.VesselCutOffDate.ToString() != "" && voyage.ETD < voyage.VesselCutOffDate) { GeneralFunctions.RegisterAlertScript(this, "ETD should be greater than Vessel Cut off Date"); return; } bool isedit = false; long qrystrvoyageid = long.Parse(GeneralFunctions.DecryptQueryString(Request.QueryString["VoyageID"].ToString()) != "" ? GeneralFunctions.DecryptQueryString(Request.QueryString["VoyageID"].ToString()) : "0"); //Add-Update //false for insert and true for update if (qrystrvoyageid.Equals(-1)) { isedit = false; } else { isedit = true; } long voyageid = new expVoyageBLL().SaveVoyage(voyage, isedit); ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('Record saved successfully!');</script>", false); if (isedit == true) { Response.Redirect("~/Export/Voyage.aspx"); } else { clearPage(); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('Record could not be saved due to ! " + ex.Message.ToString() + "');</script>", false); } }