public void DisplaySOData()
        {
            BrilliantWMS.WMSInbound.iInboundClient   Inbound  = new WMSInbound.iInboundClient();
            BrilliantWMS.WMSOutbound.iOutboundClient Outbound = new WMSOutbound.iOutboundClient();
            List <BrilliantWMS.WMSOutbound.WMS_SP_GetPartDetail_ForDispatch_Result> QCDetail = new List <WMSOutbound.WMS_SP_GetPartDetail_ForDispatch_Result>();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                if (Session["QCID"] != null)
                {
                    long QCID       = long.Parse(Session["QCID"].ToString());
                    int  chkJObCart = Inbound.CheckJobCard(Convert.ToInt64(HttpContext.Current.Session["QCID"].ToString()), "Dispatch", profile.DBConnection._constr);
                    if (chkJObCart >= 1)
                    {
                        DataSet dsJCN = new DataSet();
                        dsJCN = Outbound.CheckSelectedSOJobCardNo(Convert.ToInt64(HttpContext.Current.Session["QCID"].ToString()), "Dispatch", profile.DBConnection._constr);
                        if (dsJCN != null && dsJCN.Tables[0].Rows.Count > 0)
                        {
                            string grpQCID = dsJCN.Tables[0].Rows[0]["OrderNo"].ToString();
                            QCDetail = Outbound.GetDispatchPartByQCID(grpQCID, "0", Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr).ToList();
                        }
                    }
                    else
                    {
                        QCDetail = Outbound.GetDispatchPartByQCID(QCID.ToString(), "0", Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr).ToList();
                    }
                }
                else if (Session["TRID"] != null)
                {
                    long TRID       = long.Parse(Session["TRID"].ToString());
                    int  chkJObCart = Inbound.CheckJobCard(Convert.ToInt64(HttpContext.Current.Session["TRID"].ToString()), "Transfer", profile.DBConnection._constr);
                    if (chkJObCart >= 1)
                    {
                        DataSet dsJCN = new DataSet();
                        dsJCN = Outbound.CheckSelectedSOJobCardNo(Convert.ToInt64(HttpContext.Current.Session["TRID"].ToString()), "Transfer", profile.DBConnection._constr);
                        if (dsJCN != null && dsJCN.Tables[0].Rows.Count > 0)
                        {
                            string grpQCID = dsJCN.Tables[0].Rows[0]["OrderNo"].ToString();
                            QCDetail = Outbound.GetDispatchPartByQCID("0", grpQCID, Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr).ToList();
                        }
                    }
                    else
                    {
                        QCDetail = Outbound.GetDispatchPartByQCID("0", TRID.ToString(), Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr).ToList();
                    }
                }
                Grid1.DataSource = null;
                Grid1.DataBind();
                Grid1.DataSource = QCDetail;
                Grid1.DataBind();
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, "DispatchDetail.aspx", "DisplayPOData");
            }
            finally { Outbound.Close(); Inbound.Close(); }
        }