protected void btnShow_Click(object sender, EventArgs e)
        {
            TranshipmentDetailsBLL objBLL = new TranshipmentDetailsBLL();
            DataSet ds = objBLL.GetContainerTranshipment(Convert.ToInt32(ddlPortName.SelectedValue.Trim()), Convert.ToInt32(hdnExpBL.Value.Trim()), Convert.ToInt32(hdnBookingId.Value.Trim()));

            if (ds.Tables[0].Rows.Count > 0)
            {
                lblMessage.Text        = "";
                gvContainer.DataSource = ds;
                gvContainer.DataBind();
            }
            else
            {
                lblMessage.Text = "Invalid Port code";
                return;
            }

            List <TranshipmentDetails> objTrans = new List <TranshipmentDetails>();
            TranshipmentDetails        objTran  = new TranshipmentDetails();

            objTran.PortId          = Convert.ToInt64(ddlPortName.SelectedValue.Trim());
            objTran.ExportBLId      = Convert.ToInt64(hdnExpBL.Value.Trim());
            objTran.ActualArrival   = Convert.ToDateTime(txtDateofArrival.Text.Trim());
            objTran.ActualDeparture = Convert.ToDateTime(txtDateofDeparture.Text.Trim());

            objTrans.Add(objTran);
            ViewState["Data"] = objTrans;

            ModalPopupExtender1.Show();
        }
        protected void txtExpBL_TextChanged(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(hdnExpBL.Value.Trim()))
            {
                DateTime?dt           = null;
                bool     VoyageStatus = false;
                int      CountID      = 0;

                dt = new TranshipmentDetailsBLL().TranshipmentStatus(Convert.ToInt32(hdnExpBL.Value.Trim()), ref VoyageStatus, ref CountID);
                if (VoyageStatus == false)
                {
                    //lblMessage.Text = "Voyage not Closed";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('Voyage Not Closed');</script>", false);
                    return;
                }
                //else
                //    lblMessage.Text = "";
                if (dt.HasValue && Convert.ToDateTime(dt).ToString("dd/MM/yyyy") != "01/01/0001")
                {
                    txtDateofDeparture.Text    = Convert.ToDateTime(dt).ToString("dd/MM/yyyy");
                    txtDateofDeparture.Enabled = false;
                    txtVessel.Enabled          = false;
                    ddlVoyage.Enabled          = false;
                }
                else
                {
                    txtDateofDeparture.Enabled = true;
                    txtVessel.Enabled          = true;
                    ddlVoyage.Enabled          = true;
                }


                DataSet ds = new TranshipmentDetailsBLL().GetTranshipmentHeader(Convert.ToInt32(hdnExpBL.Value.Trim()), CountID);

                lblBLDate.Text     = Convert.ToDateTime(ds.Tables[0].Rows[0]["ExpBLDate"]).ToString("dd/MM/yyyy");
                hdnBookingId.Value = ds.Tables[0].Rows[0]["fk_BookingID"].ToString();
                lblBookingNo.Text  = ds.Tables[0].Rows[0]["BookingNo"].ToString();
                hdnVessel.Value    = ds.Tables[0].Rows[0]["fk_VesselID"].ToString();
                txtVessel.Text     = ds.Tables[0].Rows[0]["VesselName"].ToString();
                //hdnVoyageId.Value = ds.Tables[0].Rows[0]["fk_VoyageID"].ToString();
                //txtVoyage.Text = ds.Tables[0].Rows[0]["VoyageNo"].ToString();
                if (CountID == 0)
                {
                    PopulateVoyage(Convert.ToInt32(hdnVessel.Value.Trim()));
                }
                else
                {
                    PopulateMainlineVoyage(Convert.ToInt32(hdnVessel.Value.Trim()));
                }
                ddlVoyage.SelectedValue = ds.Tables[0].Rows[0]["fk_VoyageID"].ToString();

                PopulatePort(Convert.ToInt32(hdnBookingId.Value.Trim()));
            }
        }
        private void PopulatePort(int bookingID)
        {
            TranshipmentDetailsBLL objBLL = new TranshipmentDetailsBLL();
            DataSet ds = objBLL.GetBookingTranshipment(bookingID);

            ddlPortName.DataValueField = "fk_PortID";
            ddlPortName.DataTextField  = "PortName";
            ddlPortName.DataSource     = ds;
            ddlPortName.DataBind();
            ddlPortName.Items.Insert(0, new ListItem("--Select--", "0"));
        }
        private void PopulateMainlineVoyage(int vesselID)
        {
            //BLL.DBInteraction dbinteract = new BLL.DBInteraction();
            DataSet ds = TranshipmentDetailsBLL.GetExportMainlineVoyages(vesselID);

            ddlVoyage.DataValueField = "VoyageID";
            ddlVoyage.DataTextField  = "VoyageNo";
            ddlVoyage.DataSource     = ds;
            ddlVoyage.DataBind();
            //ddlLoadingVoyage.Items.Insert(0, new ListItem(Constants.DROPDOWNLIST_DEFAULT_TEXT, Constants.DROPDOWNLIST_DEFAULT_VALUE));
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            List <TranshipmentDetails> obj = (List <TranshipmentDetails>)ViewState["Data"];

            foreach (TranshipmentDetails td in obj)
            {
                TranshipmentDetailsBLL objBL = new TranshipmentDetailsBLL();
                objBL.SaveContainerTranshipment(td);
            }
            ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');</script>", false);
            ResetControls();
        }
Exemple #6
0
 private void DeleteContainerTranshipment(int transhipmentId)
 {
     TranshipmentDetailsBLL.DeleteTranshipmentList(transhipmentId);
     LoadContainerTranshipment();
     ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('" + ResourceManager.GetStringWithoutName("ERR00010") + "');</script>", false);
 }