public string getDocName(string docNumber)
            {
                var obj = new PCDCLIENTLib.PCDSearch();

                obj.SetDST(dst);
                obj.AddSearchLib(library);
                obj.SetSearchObject("DEF_PROF");
                obj.AddSearchCriteria("DOCNUMBER", docNumber);
                obj.AddReturnProperty("PATH");
                obj.AddReturnProperty("DOCNAME");


                var rc = obj.Execute();

                if (rc != 0)
                {
                    Console.WriteLine(obj.ErrDescription);
                    throw new Exception("Failed to get Document Name : " + obj.ErrNumber + obj.ErrDescription);
                }

                obj.SetRow(1);
                var docname = obj.GetPropertyValue("DOCNAME");

                obj.GetPropertyValue("PATH");
                obj.ReleaseResults();

                return(docname);
            }
            public string getVersionId(string docNumber)
            {
                var obj = new PCDCLIENTLib.PCDSearch();

                obj.SetDST(dst);
                obj.AddSearchLib(library);
                obj.SetSearchObject("cyd_cmnversions");
                obj.AddSearchCriteria("DOCNUMBER", docNumber);
                obj.AddOrderByProperty("VERSION", 0);
                obj.AddReturnProperty("VERSION");
                obj.AddReturnProperty("VERSION_ID");

                var rc = obj.Execute();

                if (rc != 0)
                {
                    Console.WriteLine(obj.ErrDescription);
                    throw new SystemException();
                }

                obj.SetRow(1);
                var version   = obj.GetPropertyValue("VERSION");
                var versionId = obj.GetPropertyValue("VERSION_ID");

                Console.WriteLine("Version: $version Version ID: " + versionId);
                obj.ReleaseResults();

                //string ver = "" + versionId;
                return(versionId);
            }