protected void btnSave_Click1(object sender, EventArgs e) { VoyageId = GeneralFunctions.DecryptQueryString(Request.QueryString["id"]); bool isedit = VoyageId != "-1" ? true : false; Entity.VoyageEntity voyage = AssignVoyageProp(VoyageId); if (ddlLoc.SelectedIndex == 0) { GeneralFunctions.RegisterAlertScript(this, "Please select any location"); return; } if (voyage.fk_LPortID == 0) { GeneralFunctions.RegisterAlertScript(this, "Please provide Last_Port_Called"); return; } if (voyage.fk_Pod == 0) { GeneralFunctions.RegisterAlertScript(this, "Please provide PoD"); return; } //if (isedit && OldLandingDate!=txtdtLand.Text && OldLandingDate != System.Convert.DBNull) //{ // //GeneralFunctions.RegisterAlertScript(this, "All Container transaction will be deleted"); // // "javascript:return confirm('All Containers of the voyage will be deleted. Confirm with Yes');"; // //if (retval!="yes") return; //} if (txtdtLand.Text != "") { string msg = EMS.BLL.VoyageBLL.CheckVoyageEntryAbilty(voyage.fk_VesselID, txtVoyageNo.Text.Trim(), voyage.fk_Pod, voyage.LandingDate, voyage.ImpXChangeRate, isedit); //int c = dbinteract.PopulateDDLDS("trnVoyage", "fk_VesselID", "VoyageNo", "where fk_VesselID=" + ddlVessel.SelectedValue + " and VoyageNo='" + txtVoyageNo.Text.Trim() + "'").Tables[0].Rows.Count; if (msg != "" && msg.ToLower() != "true") { GeneralFunctions.RegisterAlertScript(this, msg); return; } } int result = dbinteract.AddEditVoyage(_userId, isedit, voyage); int result1 = EMS.BLL.VoyageBLL.VoyageLandingDateEntry(voyage.fk_VesselID, Convert.ToInt32(VoyageId), voyage.fk_Pod, voyage.LandingDate, voyage.OLandingDate, _userId); if (result > 0) { //if (!isedit) Response.Redirect("~/MasterModule/MangeVoyage.aspx?p=" + Request.QueryString["p"]); //else if (result1 > 0) // Response.Redirect("~/MasterModule/MangeVoyage.aspx"); //else //{ // GeneralFunctions.RegisterAlertScript(this, "Error Occured"); //} } else { GeneralFunctions.RegisterAlertScript(this, "Error Occured"); } }