//private int _reqfield = 0;

        protected void Page_Load(object sender, EventArgs e)
        {
            RetriveParameters();
            _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)
            {
                string strProcessScript = "this.value='Processing...';this.disabled=true;";
                btnSave.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnSave, "").ToString());

                fillAllDropdown();
                CheckUserAccess(hdnContainerTransactionId.Value);
                //if (lblTranCode.Text == string.Empty && hdnContainerTransactionId.Value == "0")
                if (hdnTranCode.Value == string.Empty && hdnContainerTransactionId.Value == "0")
                {
                    DataTable Dt = CreateDataTable();
                    DataRow   dr = Dt.NewRow();
                    dr["Editable"] = true;
                    Dt.Rows.Add(dr);
                    gvSelectedContainer.DataSource = Dt;
                    gvSelectedContainer.DataBind();
                    txtDate.Text = DateTime.Now.ToShortDateString();
                }
                else
                {
                    btnShow.Visible = false;
                    txtDate.Attributes.Add("onchange", "ChangeActivityDate(this);");

                    ContainerTranBLL oContainerTranBLL = new ContainerTranBLL();
                    SearchCriteria   searchCriteria    = new SearchCriteria();
                    DataSet          ds = new DataSet();

                    if (!string.IsNullOrEmpty(hdnContainerTransactionId.Value))
                    {
                        ds = oContainerTranBLL.GetContainerTransactionList(searchCriteria, Convert.ToInt32(hdnContainerTransactionId.Value), _userLocation);
                    }
                    //else if(!string.IsNullOrEmpty(lblTranCode.Text))
                    else if (!string.IsNullOrEmpty(hdnTranCode.Value))
                    {
                        searchCriteria.StringOption4 = hdnTranCode.Value;
                        ds = oContainerTranBLL.GetContainerTransactionList(searchCriteria, 0, _userLocation);
                    }
                    FillHeaderDetail(ds.Tables[0]);
                    DisableHeaderSection();
                    FillContainers(ds.Tables[1]);
                }
            }
            //CheckUserAccess(hdnContainerTransactionId.Value);
        }
Ejemplo n.º 2
0
        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();
                    ContainerTranBLL oContainerTranBLL = new ContainerTranBLL();

                    gvwContainerTran.PageIndex = searchCriteria.PageIndex;
                    if (searchCriteria.PageSize > 0)
                    {
                        gvwContainerTran.PageSize = searchCriteria.PageSize;
                    }

                    gvwContainerTran.DataSource = oContainerTranBLL.GetContainerTransactionList(searchCriteria, MovementId, Locationid).Tables[0];
                    gvwContainerTran.DataBind();
                }
            }
        }