コード例 #1
0
ファイル: Voyage.aspx.cs プロジェクト: souvik0682/ems-nvocc
        private void DeleteVoyage(int voyageID)
        {
            int voyageid = new expVoyageBLL().DeleteVoyage(voyageID);

            LoadVoyage();
            ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('" + ResourceManager.GetStringWithoutName("ERR00006") + "');</script>", false);
        }
コード例 #2
0
        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");
            }
        }
コード例 #3
0
        private void LoadVesselDDL()
        {
            DataTable dt = new expVoyageBLL().GetVessels(); // Convert.ToInt64(ddlLocation.SelectedValue));

            if (dt != null && dt.Rows.Count > 0)
            {
                DataRow dr = dt.NewRow();
                dr["pk_VesselID"] = "0";
                dr["VesselName"]  = "--Select--";
                dt.Rows.InsertAt(dr, 0);
                ddlVessel.DataValueField = "pk_VesselID";
                ddlVessel.DataTextField  = "VesselName";
                ddlVessel.DataSource     = dt;
                ddlVessel.DataBind();
            }
        }
コード例 #4
0
        private void LoadForEdit(long voyageId)
        {
            IexpVoyage voyage = new expVoyageBLL().GetVoyageById(voyageId);

            ViewState["VoyageID"] = voyage.VoyageID;
            //txtGatewayPort.Text= voyage.GatewayPort.ToString();
            ddlVessel.SelectedValue   = voyage.VesselID.ToString();
            ddlLocation.SelectedValue = voyage.LocationID.ToString();
            hdnPOL.Value          = voyage.POL.ToString();
            hdnNextPortCall.Value = voyage.NextPortID.ToString();
            //txtPOD.Text= voyage.POD.ToString();
            txtVoyageNo.Text  = voyage.VoyageNo;
            txtAgentcode.Text = voyage.AgentCode.ToString();
            //txtAgentcode.Text = voyage.AgentCode.ToString();
            txtPOL.Text                  = voyage.LoadPort.ToString();
            txtLinecode.Text             = voyage.LineCode;
            txtETD.Text                  = voyage.ETD.ToString();
            txtPCCNo.Text                = voyage.PCCNo;
            ddlTerminalID.SelectedValue  = voyage.TerminalID.ToString();
            ddlLocation.SelectedValue    = voyage.LocationID.ToString();
            txtPCCDate.Text              = voyage.PCCDate.ToString();
            txtNextportcall.Text         = voyage.NextPort.ToString();
            txtETA.Text                  = voyage.ETA.ToString();
            txtETANextPort.Text          = voyage.ETANextPort.ToString();
            txtVIA.Text                  = voyage.VIA;
            txtVCNNo.Text                = voyage.VCNNo;
            txtRotationNo.Text           = voyage.RotationNo;
            txtSailingDateTime.Text      = voyage.SailDate.ToString();
            txtRotationDate.Text         = voyage.RotationDate.ToString();
            txtVesselcutoffDate.Text     = voyage.VesselCutOffDate.ToString();
            txtlstsiDockscutoffDate.Text = voyage.DocsCutOffDate.ToString();
            if (voyage.CloseVoyage == true)
            {
                btnVslClose.Text = "Open Voyage";
                btnSave.Visible  = false;
            }
            else
            {
                btnVslClose.Text = "Close Voyage";
            }
        }
コード例 #5
0
        private void LoadTerminalDDL()
        {
            try
            {
                DataTable dt = new expVoyageBLL().GetTerminals(0); // Convert.ToInt64(ddlLocation.SelectedValue));

                if (dt != null && dt.Rows.Count > 0)
                {
                    DataRow dr = dt.NewRow();
                    dr["pk_TerminalID"] = "0";
                    dr["TerminalName"]  = "--Select--";
                    dt.Rows.InsertAt(dr, 0);
                    ddlTerminalID.DataValueField = "pk_TerminalID";
                    ddlTerminalID.DataTextField  = "TerminalName";
                    ddlTerminalID.DataSource     = dt;
                    ddlTerminalID.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #6
0
        private void PopulateVessel()
        {
            DataTable dt = new expVoyageBLL().GetVessels(); // Convert.ToInt64(ddlLocation.SelectedValue));

            if (dt != null && dt.Rows.Count > 0)
            {
                DataRow dr = dt.NewRow();
                dr["pk_VesselID"] = "0";
                dr["VesselName"]  = "--Select--";
                dt.Rows.InsertAt(dr, 0);
                ddlVessel.DataValueField = "pk_VesselID";
                ddlVessel.DataTextField  = "VesselName";
                ddlVessel.DataSource     = dt;
                ddlVessel.DataBind();
            }

            //DataTable dt = new DataTable();
            //dt = new CommonBLL().GetVesselList();
            //ddlVessel.DataValueField = "VesselID";
            //ddlVessel.DataTextField = "VesselName";
            //ddlVessel.DataSource = dt;
            //ddlVessel.DataBind();
            //ddlVessel.Items.Insert(0, new ListItem(Constants.DROPDOWNLIST_DEFAULT_TEXT, Constants.DROPDOWNLIST_DEFAULT_VALUE));
        }
コード例 #7
0
        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);
            }
        }