public static int WMCheckStatus(string SelectedSO)
        {
            int Result = 0;

            BrilliantWMS.WMSInbound.iInboundClient Inbound = new WMSInbound.iInboundClient();
            //iInboundClient Inbound = new iInboundClient();
            try
            {
                CustomProfile profile   = CustomProfile.GetProfile();
                bool          exeresult = Inbound.CheckJobCardofSelectedRecord(SelectedSO, "SalesOrder", profile.DBConnection._constr);
                if (exeresult == true)
                {
                    BrilliantWMS.WMSOutbound.iOutboundClient Outbound = new WMSOutbound.iOutboundClient();
                    Result = Outbound.CheckSelectedSOStatusIsSameOrNot(SelectedSO, profile.DBConnection._constr);
                    Page objp = new Page();
                    objp.Session["SelectedRec"] = SelectedSO; objp.Session["ObjectName"] = "SalesOrder";
                }
                else
                {
                    Result = 2;
                }
            }
            catch { }
            finally { Inbound.Close(); }
            return(Result);
        }