Exemplo n.º 1
0
 private void barLargeButtonItem10_ItemClick(object sender, ItemClickEventArgs e)
 {
     if ((ServerSystemInfo.ModuleId != ServerSystemInfo.SoftModuleId) || (ServerSystemInfo.SysPattern != 1))
     {
         CMessageInfo.ShowMessage("请先连接当前要操作的系统模块并且将软件运行模式设置为实训考核模式", "考核发题", 2);
     }
     else if (CheckInfo.PcCheckState)
     {
         MessageBox.Show("学生机考核进行中,不能操作");
     }
     else
     {
         ServerSystemInfo.dic = new Dictionary <int, string>();
         foreach (DataRow row in ((DataTable)this.gridControl1.DataSource).Rows)
         {
             if (row[0].ToString() == "True")
             {
                 string str = row["PointState"].ToString();
                 string.Compare(row["NormalIsBreak"].ToString(), "False", true);
                 if ((string.IsNullOrEmpty(str) || (str == "清除故障失败")) || ((str == "读取状态失败") || (str == "设置故障失败")))
                 {
                     CMessageInfo.ShowMessage("请先设置故障,再发题", "考核发题", 1);
                     return;
                 }
                 ServerSystemInfo.dic.Add(int.Parse(row[1].ToString()), str);
             }
         }
         int           num = (ServerSystemInfo.Counts == 0) ? this.dt.Rows.Count : ServerSystemInfo.Counts;
         SendCheckItem msg = new SendCheckItem {
             ItemList   = ServerSystemInfo.dic,
             ScorePoint = ServerSystemInfo.ScorePoint,
             Counts     = num,
             Time       = ServerSystemInfo.PcTimeCount,
             Memo       = ServerSystemInfo.Memo
         };
         SysManager.SentToClient(TcpService.clientPool, LoginInfo.StudyNO, SocketInfoType.CheckItem, msg);
         CheckInfo.PcCheckState = true;
         CheckInfo.PcCheckTime  = DateTime.Now;
         CMessageInfo.ShowMessage("发题成功", "考核发题", 1);
     }
 }