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);
            }
            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);
            }
Example #3
0
        /// <summary>
        /// Creazione di un array di stringhe contenente tutti i systemid
        /// estratti dalla ricerca fulltext
        /// </summary>
        /// <param name="objSearch"></param>
        /// <param name="requestedPage"></param>
        /// <param name="numDocs"></param>
        /// <returns></returns>
        private string[] GetSearchDocNumbers(PCDCLIENTLib.PCDSearch objSearch)
        {
            ArrayList arrayList = new ArrayList();

            int numDocs = objSearch.GetRowsFound();

            if (numDocs > 0)
            {
                for (int i = 0; i < numDocs; i++)
                {
                    if (objSearch.NextRow() > 0)
                    {
                        arrayList.Add(objSearch.GetPropertyValue("SYSTEM_ID").ToString());
                    }
                    else
                    {
                        break;
                    }
                }
            }

            return((string[])arrayList.ToArray(typeof(string)));
        }