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(); }
public static void SaveContainerTranshipment(TranshipmentDetails obj) { string strExecution = "[exp].[prcSaveContainerTranshipment]"; using (DbQuery oDq = new DbQuery(strExecution)) { oDq.AddIntegerParam("@PortId", Convert.ToInt32(obj.PortId)); oDq.AddIntegerParam("@ExpBLId", Convert.ToInt32(obj.ExportBLId)); if (obj.ImportBLFooterId != 0) { oDq.AddIntegerParam("@ImpBLFooterId", Convert.ToInt32(obj.ImportBLFooterId)); } if (obj.HireContainerId != 0) { oDq.AddIntegerParam("@HireContainerId", Convert.ToInt32(obj.HireContainerId)); } if (obj.TranshipmentId != 0) { oDq.AddIntegerParam("@TranshipmentId", Convert.ToInt32(obj.TranshipmentId)); } oDq.AddDateTimeParam("@ActualArrival", Convert.ToDateTime(obj.ActualArrival)); oDq.AddDateTimeParam("@ActualDeparture", Convert.ToDateTime(obj.ActualDeparture)); oDq.AddIntegerParam("@ExpBLContainerId", Convert.ToInt32(obj.ExpBLContainerID)); oDq.RunActionQuery(); } }
protected void btnProceed_Click(object sender, EventArgs e) { List <TranshipmentDetails> objTrans = new List <TranshipmentDetails>(); foreach (GridViewRow gvr in gvContainer.Rows) { HiddenField hdnImpFooterId = (HiddenField)gvr.FindControl("hdnImpFooterId"); HiddenField hdnContainerId = (HiddenField)gvr.FindControl("hdnContainerId"); HiddenField hdnTranshipmentId = (HiddenField)gvr.FindControl("hdnTranshipmentId"); HiddenField hdnExpBLContainerID = (HiddenField)gvr.FindControl("hdnExpBLContainerID"); Label lblContainerNo = (Label)gvr.FindControl("lblContainerNo"); Label lblContainerSize = (Label)gvr.FindControl("lblContainerSize"); Label lblContainerType = (Label)gvr.FindControl("lblContainerType"); CheckBox chkContainer = (CheckBox)gvr.FindControl("chkContainer"); if (chkContainer.Checked) { TranshipmentDetails objTran = new TranshipmentDetails(); objTran.PortId = Convert.ToInt64(ddlPortName.SelectedValue.Trim()); objTran.ExportBLId = Convert.ToInt64(hdnExpBL.Value.Trim()); objTran.ImportBLFooterId = Convert.ToInt64(hdnImpFooterId.Value.Trim()); objTran.HireContainerId = Convert.ToInt64(hdnContainerId.Value.Trim()); objTran.TranshipmentId = Convert.ToInt64(hdnTranshipmentId.Value.Trim()); objTran.ActualArrival = Convert.ToDateTime(txtDateofArrival.Text.Trim()); objTran.ActualDeparture = Convert.ToDateTime(txtDateofDeparture.Text.Trim()); objTran.ContainerNo = lblContainerNo.Text.Trim(); objTran.ContainerType = lblContainerType.Text.Trim(); objTran.Size = lblContainerSize.Text.Trim(); objTran.ExpBLContainerID = Convert.ToInt64(hdnExpBLContainerID.Value.Trim()); objTrans.Add(objTran); } } ViewState["Data"] = objTrans; gvSelectedContainer.DataSource = objTrans; gvSelectedContainer.DataBind(); }
public void SaveContainerTranshipment(TranshipmentDetails obj) { TranshipmentDetailsDAL.SaveContainerTranshipment(obj); }