public FrmE_AddQuestion(TurnE_R_ESetPro terew,Dictionary<string, E_QuestionBank> pd,Dictionary<string, E_QuestionBank> sd,Dictionary<string, E_QuestionBank> msd)
        {
            InitializeComponent();
            ucm_EaddQuestionPD.ChangeDic += new Ucm_EaddQuestion.ChangeObj(ucm_EaddQuestionPD_ChangeDic);
            ucm_EaddQuestionSelect.ChangeDic += new Ucm_EaddQuestion.ChangeObj(ucm_EaddQuestionSelect_ChangeDic);
            ucm_EaddQuestionMuSelect.ChangeDic += new Ucm_EaddQuestion.ChangeObj(ucm_EaddQuestionMuSelect_ChangeDic);
            currtenter = terew;
            PdDic = pd;
            SelectDic = sd;
            MuSelectDic = msd;

            ucm_EaddQuestionPD.DesNum = currtenter.JudgeNUM;
            ucm_EaddQuestionPD.PID = currtenter.PROID;
            ucm_EaddQuestionPD.Type = "判断题";
            ucm_EaddQuestionPD.eqdic = PdDic;

            ucm_EaddQuestionSelect.DesNum = currtenter.SelectNUM;
            ucm_EaddQuestionSelect.PID = currtenter.PROID;
            ucm_EaddQuestionSelect.Type = "单项选择题";
            ucm_EaddQuestionSelect.eqdic = SelectDic;

            ucm_EaddQuestionMuSelect.DesNum = currtenter.MuSelectNUM;
            ucm_EaddQuestionMuSelect.PID = currtenter.PROID;
            ucm_EaddQuestionMuSelect.Type = "多项选择题";
            ucm_EaddQuestionMuSelect.eqdic = MuSelectDic;
        }
 void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     if (gridView1.GetFocusedRow()!=null)
     {
         currtenter=gridView1.GetFocusedRow() as TurnE_R_ESetPro;
         CheckCanAdd();
     }
 }
        private void InitData()
        {
            PdDic.Clear();
            SelectDic.Clear();
            MuSelectDic.Clear();
            RealEREPDic.Clear();
            if (SetId != string.Empty)
            {
                //
                ESet = Client.ClientHelper.PlatformSqlMap.GetOneByKey<E_ExamSetting>(SetId);
                string sqlwhere = " where ESETID='" + SetId + "'";
                IList<E_R_ESetPro> eresblist = Client.ClientHelper.PlatformSqlMap.GetList<E_R_ESetPro>(sqlwhere);
                ereslist = eresblist;
                foreach (E_R_ESetPro item in eresblist)
                {
                    TurnE_R_ESetPro teres = new TurnE_R_ESetPro();
                    teres.ID = item.ID;
                    teres.PROID = item.PROID;
                    teres.JudgeNUM = item.JudgeNUM;
                    teres.SelectNUM = item.SelectNUM;
                    teres.MuSelectNUM = item.MuSelectNUM;
                    RealEREPDic.Add(teres.PROID, teres);
                }



                if (EPID != string.Empty)
                {
                    string sqlwhere2 = " where ExID='" + EPID + "'";
                    IList<E_ExaminationPaperQuestion> eepqlist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<E_ExaminationPaperQuestion>(sqlwhere2);
                    string str = string.Empty;
                    if (eepqlist.Count > 0)
                    {
                        foreach (E_ExaminationPaperQuestion item in eepqlist)
                        {
                            str += "'" + item.QuID + "' ,";
                        }
                        str = str.Substring(0, str.Length - 1);

                        string stsqlwhere = " where ID in (" + str + ")";
                        IList<E_QuestionBank> banklist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<E_QuestionBank>(stsqlwhere);
                        if (banklist.Count > 0)
                        {
                            foreach (E_QuestionBank item in banklist)
                            {
                                if (item.Type == "判断题")
                                {
                                    PdDic.Add(item.ID, item);
                                    RealEREPDic[item.Professional].RealJudgeNUM += 1;
                                }
                                if (item.Type == "单项选择题")
                                {
                                    SelectDic.Add(item.ID, item);
                                    RealEREPDic[item.Professional].RealSelectNUM += 1;
                                }
                                if (item.Type == "多项选择题")
                                {
                                    MuSelectDic.Add(item.ID, item);
                                    RealEREPDic[item.Professional].RealMuSelectNUM += 1;
                                }
                            }

                        }
                    }

                }
                ViewQuestionPaper();
            }


        }
        /// <summary>
        /// 显示设计题数和实际题数
        /// </summary>
        private void ShowSet()
        {
            //清空实际试题数量
            foreach (string item in RealEREPDic.Keys)
            {
                RealEREPDic[item].RealJudgeNUM = 0;
                RealEREPDic[item].RealSelectNUM = 0;
                RealEREPDic[item].RealMuSelectNUM = 0;
            }
            //计算实际判断题数量
            foreach (string key in PdDic.Keys)
            {
                RealEREPDic[PdDic[key].Professional].RealJudgeNUM += 1;
            }
            //计算实际选择题数量
            foreach (string key in SelectDic.Keys)
            {
                RealEREPDic[SelectDic[key].Professional].RealSelectNUM += 1;
            }
            //计算实际多项选择题数量
            foreach (string key in MuSelectDic.Keys)
            {
                RealEREPDic[MuSelectDic[key].Professional].RealMuSelectNUM += 1;
            }



            TurnE_R_ESetPro realere = new TurnE_R_ESetPro();
            realere.PROID = fixedid;

            List<TurnE_R_ESetPro> datalist = new List<TurnE_R_ESetPro>();
            foreach (string item in RealEREPDic.Keys)
            {
                TurnE_R_ESetPro temptere = RealEREPDic[item];
                datalist.Add(temptere);

                realere.JudgeNUM += temptere.JudgeNUM;
                realere.SelectNUM += temptere.SelectNUM;
                realere.MuSelectNUM += temptere.MuSelectNUM;

                realere.RealJudgeNUM += temptere.RealJudgeNUM;
                realere.RealSelectNUM += temptere.RealSelectNUM;
                realere.RealMuSelectNUM += temptere.RealMuSelectNUM;


            }
            realallere = realere;
            datalist.Add(realere);

            int i = 1;
            gridControl1.DataSource = null;
            gridControl1.DataSource = datalist;
            gridView1.Columns["PROID"].ColumnEdit = DicTypeHelper.E_proDicTB;
            gridView1.Columns["PROID"].VisibleIndex = i++;
            gridView1.Columns["JudgeNUM"].Width = 110;
            gridView1.Columns["JudgeNUM"].VisibleIndex = i++;
            gridView1.Columns["RealJudgeNUM"].Width = 110;
            gridView1.Columns["RealJudgeNUM"].VisibleIndex = i++;
            gridView1.Columns["SelectNUM"].Width = 110;
            gridView1.Columns["SelectNUM"].VisibleIndex = i++;
            gridView1.Columns["RealSelectNUM"].Width = 110;
            gridView1.Columns["RealSelectNUM"].VisibleIndex = i++;
            gridView1.Columns["MuSelectNUM"].Width = 110;
            gridView1.Columns["MuSelectNUM"].VisibleIndex = i++;
            gridView1.Columns["RealMuSelectNUM"].Width = 110;
            gridView1.Columns["RealMuSelectNUM"].VisibleIndex = i++;
            CheckCanAdd();
        }