private void DeleteTransaction(int TranId) { LBCntrBLL oBll = new LBCntrBLL(); oBll.DeleteTransaction(TranId); LoadContainer(0, _userLocation); ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('" + ResourceManager.GetStringWithoutName("ERR00006") + "');</script>", false); }
void fillContainer(int BookingId) { LBCntrBLL oContainerTranBLL = new LBCntrBLL(); dtFilteredContainer = oContainerTranBLL.GetContainerTransactionListFiltered(BookingId, hdnLineID.Value.ToInt()); ViewState["Container"] = dtFilteredContainer; gvContainer.DataSource = dtFilteredContainer; gvContainer.DataBind(); }
private void ActionOnBookingChange() { DataSet ds = new DataSet(); LBCntrBLL oBookingDetailBLL = new LBCntrBLL(); ds = oBookingDetailBLL.GetBookingDetail(Convert.ToInt32(hdnBookingNo.Value)); hdnLineID.Value = ds.Tables[0].Rows[0]["fk_NVOCCID"].ToString(); txtBookingDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["BookingDate"].ToString()).ToShortDateString(); lblLoadPort.Text = ds.Tables[0].Rows[0]["BookingNo"].ToString(); //txtBookingDate.Text = ds.Tables[0].Rows[0]["BookingDate"].ToString(); lblParty.Text = ds.Tables[0].Rows[0]["CustName"].ToString(); lblLoadPort.Text = ds.Tables[0].Rows[0]["PortCode"].ToString(); lblVessel.Text = ds.Tables[0].Rows[0]["VesselName"].ToString(); lblVoyage.Text = ds.Tables[0].Rows[0]["VoyageNo"].ToString(); ddlVessel.SelectedIndex = -1; ddlVoyage.Items.Clear(); }
protected void Page_Load(object sender, EventArgs e) { _userId = UserBLL.GetLoggedInUserId(); _userLocation = UserBLL.GetUserLocation(); //Get user permission. UserBLL.GetUserPermission(out _canAdd, out _canEdit, out _canDelete, out _canView); //_userId = EMS.BLL.UserBLL.GetLoggedInUserId(); if (!Page.IsPostBack) { fillAllDropdown(); CheckUserAccess(hdnLBCntrTransactionId.Value); //if (lblTranCode.Text == string.Empty && hdnLBCntrTransactionId.Value == "0") if (hdnTranCode.Value == string.Empty && hdnLBCntrTransactionId.Value == "0") { DataTable Dt = CreateDataTable(); DataRow dr = Dt.NewRow(); Dt.Rows.Add(dr); gvSelectedContainer.DataSource = Dt; gvSelectedContainer.DataBind(); txtDate.Text = DateTime.Now.ToShortDateString(); } else { btnShow.Visible = false; txtDate.Attributes.Add("onchange", "ChangeActivityDate(this);"); LBCntrBLL oContainerTranBLL = new LBCntrBLL(); SearchCriteria searchCriteria = new SearchCriteria(); DataSet ds = new DataSet(); ds = oContainerTranBLL.GetLBCntrList(searchCriteria, Convert.ToInt32(hdnLBCntrTransactionId.Value), 0); FillHeaderDetail(ds.Tables[0]); DisableHeaderSection(); FillContainers(ds.Tables[1]); } } //CheckUserAccess(hdnLBCntrTransactionId.Value); }
private void LoadContainer(int MovementId, int Locationid) { if (!ReferenceEquals(Session[Constants.SESSION_SEARCH_CRITERIA], null)) { SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA]; if (!ReferenceEquals(searchCriteria, null)) { BuildSearchCriteria(searchCriteria); //CommonBLL commonBll = new CommonBLL(); LBCntrBLL oContainerTranBLL = new LBCntrBLL(); gvwContainerTran.PageIndex = searchCriteria.PageIndex; if (searchCriteria.PageSize > 0) { gvwContainerTran.PageSize = searchCriteria.PageSize; } gvwContainerTran.DataSource = oContainerTranBLL.GetLBCntrList(searchCriteria, 0, _userLocation).Tables[0]; gvwContainerTran.DataBind(); } } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { //foreach (GridViewRow gvRow in gvSelectedContainer.Rows) //{ // //HiddenField hdnLMDT = (HiddenField)gvRow.FindControl("hdnLMDT"); // HiddenField hdnCDT = (HiddenField)gvRow.Cells[0].FindControl("hdnCDT"); // DateTime dt = Convert.ToDateTime(hdnCDT.Value); // if (dt > Convert.ToDateTime(txtDate.Text)) // { // lblMessage.Text = "Activity date can not be greater than last movement date"; // return; // } //} LBCntrBLL oContainerTranBLL = new LBCntrBLL(); string TranCode = string.Empty; if (ViewState["Container"] != null) { dtFilteredContainer = (DataTable)ViewState["Container"]; } if (dtFilteredContainer.Rows.Count <= 0) { lblMessage.Text = ResourceManager.GetStringWithoutName("ERR00078"); hdnTranCode.Value = string.Empty; return; } int BookingID = Convert.ToInt32(hdnBookingNo.Value); int VesselID = Convert.ToInt32(ddlVessel.SelectedValue); int VoyageID = Convert.ToInt32(ddlVoyage.SelectedValue); int Result = oContainerTranBLL.AddEditLBCntr(out TranCode, hdnTranCode.Value, GenerateContainerXMLString(), Convert.ToDateTime(txtDate.Text), BookingID, VesselID, VoyageID, _userId, DateTime.Now.Date, _userId, DateTime.Now.Date); switch (Result) { case -1: lblMessage.Text = ResourceManager.GetStringWithoutName("ERR000078"); break; case 1: lblMessage.Text = ResourceManager.GetStringWithoutName("ERR00009"); if (string.IsNullOrEmpty(hdnTranCode.Value)) { lblTranCode.Text = TranCode; ClearAll(); } else { Response.Redirect("container-movement.aspx"); } break; case 0: lblMessage.Text = ResourceManager.GetStringWithoutName("ERR00011"); break; } } }