Exemple #1
0
        public static List <Plt.IComosDDevice> SearchObjectByDescription(string strValorBuscar, Plt.IComosDProject project)
        {
            Plt.IComosDSearchManager SearchManager = AppGlobal.Workset.GetSearchManager();
            dynamic resultset = null;

            List <Plt.IComosDDevice> listaRetorno = new List <Plt.IComosDDevice>();

            Log.WriteLog("SearchObjectByDescription: START::" + strValorBuscar + "::" + (project == null).ToString());

            System.Diagnostics.Debug.WriteLine(SearchManager == null);

            SearchManager.SystemType            = 8;
            SearchManager.IsSearchCaseSensitive = false;
            SearchManager.RootObjects.Add(project);
            SearchManager.AppendSearchCondition("", "PROPERTY", "DESCRIPTION", "LIKE", "*" + strValorBuscar + "*");
            SearchManager.AppendSearchCondition("OR", "PROPERTY", "NAME", "LIKE", "*" + strValorBuscar + "*");

            resultset = SearchManager.Start();
            SearchManager.RetrieveData(0);

            for (int i = 1; i <= resultset.count; i++)
            {
                Plt.IComosDDevice curDev = (Plt.IComosDDevice)resultset.item(i);

                if (curDev.Layers != "~" && curDev.CObject != null)
                {
                    listaRetorno.Add(resultset.item(i));
                }
            }

            SearchManager.Stop();
            Log.WriteLog("SearchManager.Stop: OK");

            return(listaRetorno);
        }
Exemple #2
0
        private static IBRServiceContracts.CQueryResult GetSearchData(List <Plt.IComosDDevice> listaCOMOSDevices, List <Plt.IComosDDocument> listaCOMOSDocuments)
        {
            IBRServiceContracts.CQueryResult result = new IBRServiceContracts.CQueryResult();
            IBRServiceContracts.CColumn      column = null;

            result.Date = DateTime.Now;

            result.Columns = new List <IBRServiceContracts.CColumn>();

            column             = new IBRServiceContracts.CColumn();
            column.Name        = "Name";
            column.Description = "Name";
            column.ColumnIndex = 0;
            result.Columns.Add(column);

            column             = new IBRServiceContracts.CColumn();
            column.Name        = "Description";
            column.Description = "Description";
            column.ColumnIndex = 1;
            result.Columns.Add(column);


            int columnsize = 2;

            result.Rows = new List <IBRServiceContracts.CRow>();

            int rowCount = listaCOMOSDevices.Count;

            for (int index = 0; index <= rowCount - 1; ++index)
            {
                IBRServiceContracts.CRow row = new IBRServiceContracts.CRow();
                row.Values = new IBRServiceContracts.CCell[columnsize];
                Plt.IComosDDevice rowobject = listaCOMOSDevices[index] as Plt.IComosDDevice;

                row.Values[0] = new IBRServiceContracts.CCell()
                {
                    Value      = rowobject.Name,
                    SystemUID  = rowobject.SystemUID(),
                    UID        = SystemUIDHandler.GetComosWebSystemUID(rowobject),
                    SystemType = 8
                };

                row.Values[1] = new IBRServiceContracts.CCell()
                {
                    Value      = rowobject.Description,
                    SystemUID  = rowobject.SystemUID(),
                    UID        = SystemUIDHandler.GetComosWebSystemUID(rowobject),
                    SystemType = 8
                };

                result.Rows.Add(row);
            }

            rowCount = listaCOMOSDocuments.Count;

            for (int index = 0; index <= rowCount - 1; ++index)
            {
                IBRServiceContracts.CRow row = new IBRServiceContracts.CRow();
                row.Values = new IBRServiceContracts.CCell[columnsize];
                Plt.IComosDDocument rowobject = listaCOMOSDocuments[index] as Plt.IComosDDocument;

                row.Values[0] = new IBRServiceContracts.CCell()
                {
                    Value      = rowobject.Name,
                    SystemUID  = rowobject.SystemUID(),
                    UID        = SystemUIDHandler.GetComosWebSystemUID(rowobject),
                    SystemType = 29
                };

                row.Values[1] = new IBRServiceContracts.CCell()
                {
                    Value      = rowobject.Description,
                    SystemUID  = rowobject.SystemUID(),
                    UID        = SystemUIDHandler.GetComosWebSystemUID(rowobject),
                    SystemType = 29
                };

                result.Rows.Add(row);
            }

            result.RowCount = result.Rows.Count;

            return(result);
        }
Exemple #3
0
        private static IBRServiceContracts.CQueryResult GetSearchData(List <Plt.IComosDSpecification> lista, List <Plt.IComosDDevice> listaCOMOSDevices, List <Plt.IComosDDocument> listaCOMOSDocuments)
        {
            IBRServiceContracts.CQueryResult result      = new IBRServiceContracts.CQueryResult();
            IBRServiceContracts.CColumn      column      = null;
            Plt.IComosBaseObject             objetoCOMOS = null;

            result.Date = DateTime.Now;

            result.Columns = new List <IBRServiceContracts.CColumn>();

            column             = new IBRServiceContracts.CColumn();
            column.Name        = "Objeto";
            column.Description = "Objeto";
            column.ColumnIndex = 0;
            result.Columns.Add(column);

            column             = new IBRServiceContracts.CColumn();
            column.Name        = "Tipo";
            column.Description = "Tipo";
            column.ColumnIndex = 1;
            result.Columns.Add(column);

            column             = new IBRServiceContracts.CColumn();
            column.Name        = "Valor";
            column.Description = "Valor";
            column.ColumnIndex = 2;
            result.Columns.Add(column);


            int rowCount   = lista.Count;
            int columnsize = 3;

            result.Rows = new List <IBRServiceContracts.CRow>();

            for (int index = 0; index <= rowCount - 1; ++index)
            {
                IBRServiceContracts.CRow row = new IBRServiceContracts.CRow();
                row.Values = new IBRServiceContracts.CCell[columnsize];
                Plt.IComosDSpecification rowobject = lista[index] as Plt.IComosDSpecification;

                objetoCOMOS = (Plt.IComosBaseObject)rowobject.GetSpecOwner();

                row.Values[0] = new IBRServiceContracts.CCell()
                {
                    Value      = objetoCOMOS.Name,
                    SystemUID  = objetoCOMOS.SystemUID(),
                    SystemType = 10
                };

                row.Values[1] = new IBRServiceContracts.CCell()
                {
                    Value      = rowobject.Description,
                    SystemUID  = objetoCOMOS.SystemUID(),
                    SystemType = 10
                };

                row.Values[2] = new IBRServiceContracts.CCell()
                {
                    Value      = rowobject.DisplayValue(),
                    SystemUID  = objetoCOMOS.SystemUID(),
                    SystemType = 10
                };


                result.Rows.Add(row);
            }

            rowCount = listaCOMOSDevices.Count;

            for (int index = 0; index <= rowCount - 1; ++index)
            {
                IBRServiceContracts.CRow row = new IBRServiceContracts.CRow();
                row.Values = new IBRServiceContracts.CCell[columnsize];
                Plt.IComosDDevice rowobject = listaCOMOSDevices[index] as Plt.IComosDDevice;

                row.Values[0] = new IBRServiceContracts.CCell()
                {
                    Value      = rowobject.Name,
                    SystemUID  = rowobject.SystemUID(),
                    UID        = SystemUIDHandler.GetComosWebSystemUID(rowobject),
                    SystemType = 8
                };

                row.Values[1] = new IBRServiceContracts.CCell()
                {
                    Value      = "Device",
                    SystemUID  = rowobject.SystemUID(),
                    UID        = SystemUIDHandler.GetComosWebSystemUID(rowobject),
                    SystemType = 8
                };

                row.Values[2] = new IBRServiceContracts.CCell()
                {
                    Value      = rowobject.Description,
                    SystemUID  = rowobject.SystemUID(),
                    UID        = SystemUIDHandler.GetComosWebSystemUID(rowobject),
                    SystemType = 8
                };

                result.Rows.Add(row);
            }

            rowCount = listaCOMOSDocuments.Count;

            for (int index = 0; index <= rowCount - 1; ++index)
            {
                IBRServiceContracts.CRow row = new IBRServiceContracts.CRow();
                row.Values = new IBRServiceContracts.CCell[columnsize];
                Plt.IComosDDocument rowobject = listaCOMOSDocuments[index] as Plt.IComosDDocument;

                row.Values[0] = new IBRServiceContracts.CCell()
                {
                    Value      = rowobject.Name,
                    SystemUID  = rowobject.SystemUID(),
                    UID        = SystemUIDHandler.GetComosWebSystemUID(rowobject),
                    SystemType = 29
                };

                row.Values[1] = new IBRServiceContracts.CCell()
                {
                    Value      = "Document",
                    SystemUID  = rowobject.SystemUID(),
                    UID        = SystemUIDHandler.GetComosWebSystemUID(rowobject),
                    SystemType = 29
                };

                row.Values[2] = new IBRServiceContracts.CCell()
                {
                    Value      = rowobject.Description,
                    SystemUID  = rowobject.SystemUID(),
                    UID        = SystemUIDHandler.GetComosWebSystemUID(rowobject),
                    SystemType = 29
                };

                result.Rows.Add(row);
            }

            result.RowCount = result.Rows.Count;

            return(result);
        }