Exemplo n.º 1
0
        private void barLargeButtonItem6_ItemClick(object sender, ItemClickEventArgs e)
        {
            MapLocation location = new MapLocation();

            if (ServerSystemInfo.ModuleId == ServerSystemInfo.SoftModuleId)
            {
                foreach (DataRow row in ((DataTable)this.gridControl1.DataSource).Rows)
                {
                    if (row[0].ToString() == "True")
                    {
                        bool flag            = string.Compare(row["NormalIsBreak"].ToString(), "False", true) != 0;
                        int  moduleId        = ServerSystemInfo.ModuleId;
                        int  faultPointState = SysManager.GetFaultPointState(int.Parse(row[1].ToString().Trim()));
                        if (faultPointState == 90)
                        {
                            row["PointState"] = "读取状态失败";
                        }
                        else
                        {
                            int num = location.CoderToData(faultPointState);
                            row["PointState"] = this.table.Select(" orderid=" + num).First <DataRow>()["ordername"].ToString();
                            if (((row["PointState"].ToString() == "通路") && !flag) || ((row["PointState"].ToString() == "断路") && flag))
                            {
                                row["IsNormal"] = "正常";
                            }
                            else
                            {
                                row["IsNormal"] = "有故障";
                            }
                        }
                        this.gridControl1.RefreshDataSource();
                    }
                }
            }
            else
            {
                MessageBox.Show("对不起,您要操作的模块和接入的模块不一致。请接入该系统模块后再尝试");
            }
        }