public void BindGrid()
        {
            BrilliantWMS.WMSOutbound.iOutboundClient Outbound = new WMSOutbound.iOutboundClient();
            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                if (Session["SOID"] != null)
                {
                    hdnPickUpNo.Value      = Session["SOID"].ToString();
                    GridReceipt.DataSource = Outbound.GetPickUpList(Session["SOID"].ToString(), "", Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr);
                    GridReceipt.DataBind();
                }
                else if (Session["PKUPID"] != null)
                {
                    long pkupId = long.Parse(Session["PKUPID"].ToString());
                    long soID   = Outbound.GetSOIDfromPkUpID(pkupId, profile.DBConnection._constr); hdnPickUpNo.Value = soID.ToString();

                    GridReceipt.DataSource = Outbound.GetPickUpList(soID.ToString(), "", Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr);
                    GridReceipt.DataBind();
                }
                if (Session["SOstate"] != null)
                {
                    if (Session["SOstate"].ToString() == "View")
                    {
                        BtnSequence.Visible = false;
                    }
                }
                else if (Session["PKUPstate"] != null)
                {
                    if (Session["PKUPstate"].ToString() == "View")
                    {
                        BtnSequence.Visible = false;
                    }
                }
                else
                {
                    BtnSequence.Visible = true;
                }

                if (Session["TRID"] != null)
                {
                    GridReceipt.DataSource = Outbound.GetPickUpList("", Session["TRID"].ToString(), Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr);
                    GridReceipt.DataBind();
                    if (Session["TRstate"].ToString() == "View")
                    {
                        BtnSequence.Visible = false;
                    }
                }
            }
            catch { }
            finally { Outbound.Close(); }
        }