Ejemplo n.º 1
0
        public void NW_Device_GetByNodeCode()
        {
            int SelectedRow = gridItemDetailNode.FocusedRowHandle;
             if (SelectedRow >= 0)
             {
                 DataRow drow = gridItemDetailNode.GetDataRow(SelectedRow);
                 string _NodeCode = drow["NodeCode"].ToString();

                 Class.NW_Device cls = new Class.NW_Device();
                 cls.NodeCode = _NodeCode;
                 DataTable dt = cls.NW_Device_GetByNodeCode();
                 gridItem.DataSource = dt;
             }
        }
Ejemplo n.º 2
0
        public void NW_Device_GetByNodeCode()
        {
            int SelectedRow = gridItemDetailNode.FocusedRowHandle;

            if (SelectedRow >= 0)
            {
                DataRow drow      = gridItemDetailNode.GetDataRow(SelectedRow);
                string  _NodeCode = drow["NodeCode"].ToString();

                Class.NW_Device cls = new Class.NW_Device();
                cls.NodeCode = _NodeCode;
                DataTable dt = cls.NW_Device_GetByNodeCode();
                gridItem.DataSource = dt;
            }
        }
Ejemplo n.º 3
0
        void LoadBieuDoNode()
        {
            Class.NW_Node   clsN     = new Class.NW_Node();
            Class.NW_Device clsDe    = new Class.NW_Device();
            DataTable       dtDevice = new DataTable();
            DataTable       dtNode   = clsN.NW_Node_GetList();

            dtNode.Columns.Add("TotalOn");
            dtNode.Columns.Add("TotalOff");
            int on  = 0;
            int off = 0;

            for (int i = 0; i < dtNode.Rows.Count; i++)
            {
                on             = 0; off = 0;
                clsDe.NodeCode = dtNode.Rows[i]["NodeCode"].ToString();
                dtDevice       = clsDe.NW_Device_GetByNodeCode();

                for (int j = 0; j < dtDevice.Rows.Count; j++)
                {
                    if (dtDevice.Rows[j]["Status"].ToString() == "online")
                    {
                        on++;
                    }
                    else
                    {
                        off++;
                    }
                }
                dtNode.Rows[i]["TotalOn"]  = on;
                dtNode.Rows[i]["TotalOff"] = off;
            }
            // load bieu do
            frmSignalChartDetail frm = new frmSignalChartDetail(dtNode);

            frm.ShowDialog();
        }
Ejemplo n.º 4
0
        void LoadBieuDoNode()
        {
            Class.NW_Node clsN= new Class.NW_Node();
            Class.NW_Device clsDe= new Class.NW_Device();
            DataTable dtDevice = new DataTable();
            DataTable dtNode = clsN.NW_Node_GetList();
            dtNode.Columns.Add("TotalOn");
            dtNode.Columns.Add("TotalOff");
            int on = 0;
            int off = 0;
            for (int i = 0; i < dtNode.Rows.Count; i++)
            {
                on = 0; off = 0;
                clsDe.NodeCode=dtNode.Rows[i]["NodeCode"].ToString();
                dtDevice = clsDe.NW_Device_GetByNodeCode();

                for (int j = 0; j < dtDevice.Rows.Count; j++)
                {
                    if (dtDevice.Rows[j]["Status"].ToString() == "online")
                        on++;
                    else
                        off++;
                }
                dtNode.Rows[i]["TotalOn"] = on;
                dtNode.Rows[i]["TotalOff"] = off;
            }
            // load bieu do
            frmSignalChartDetail frm = new frmSignalChartDetail(dtNode);
            frm.ShowDialog();
        }