Beispiel #1
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);
        }
Beispiel #2
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);
        }