示例#1
0
        void m_pRepComBox_CheckType_CloseUp(object sender, CloseUpEventArgs e)
        {
            if (e.CloseMode == PopupCloseMode.ButtonClick || e.CloseMode == PopupCloseMode.Normal)
            {
                try
                {
                    string strPreValue = e.Value as string;
                    if (strPreValue == Text_CheckMode_CreateOnly)  // 仅创建
                    {
                        gridViewCheckSetting.SetFocusedRowCellValue(gridViewCheckSetting.Columns["Hy.Check.Rules"], null);
                        return;
                    }
                    if (strPreValue == Text_CheckMode_CheckAll)  // 全检
                    {
                        //gridViewCheckSetting.SetFocusedRowCellValue(gridViewCheckSetting.Columns["Hy.Check.Rules"], (new Hy.Check.Engine.TemplateRules(((KeyValuePair<string, string>)cmbSchema.SelectedItem).Key)).CurrentSchemaRules);
                        gridViewCheckSetting.SetFocusedRowCellValue(gridViewCheckSetting.Columns["Hy.Check.Rules"], null);
                        return;
                    }
                    if (strPreValue == Text_CheckMode_CheckPartly)  // 抽检
                    {
                        if (m_FrmRules == null)
                        {
                            m_FrmRules = new FrmPreCheck();
                        }

                        m_FrmRules.CurrentTemplateRules = new TemplateRules(((KeyValuePair <string, string>)cmbSchema.SelectedItem).Key);

                        List <SchemaRuleEx> curValue = gridViewCheckSetting.GetFocusedRowCellValue("Hy.Check.Rules") as List <SchemaRuleEx>;
                        if (curValue != null)
                        {
                            m_FrmRules.SchemaRulesSelection = curValue;
                        }

                        if (m_FrmRules.ShowDialog() == DialogResult.Yes)
                        {
                            curValue = m_FrmRules.SchemaRulesSelection;
                            gridViewCheckSetting.SetFocusedRowCellValue(gridViewCheckSetting.Columns["Hy.Check.Rules"], curValue);
                        }
                        else
                        {
                            e.AcceptValue = false;
                        }
                    }
                }
                catch { }
            }
        }
示例#2
0
 public override void OnClick()
 {
     List<SchemaRuleEx> ruleSelection = null;
     FrmPreCheck frmPreCheck = new FrmPreCheck();
     frmPreCheck.CurrentTemplateRules = CheckApplication.InitCurrentTemplateRules();
     frmPreCheck.SchemaRulesSelection = ruleSelection;
     if (frmPreCheck.ShowDialog() == DialogResult.Yes)
     {
         Hy.Check.Task.Task task = Hy.Check.Command.CheckApplication.CurrentTask;
         task.ReadyForCheck(false);
         ruleSelection = frmPreCheck.SchemaRulesSelection;
         CheckApplication.TaskChanged(null);
         Hy.Check.UI.Forms.FrmTaskCheck frmCheck = new Hy.Check.UI.Forms.FrmTaskCheck(task, ruleSelection);
         frmCheck.CheckTask();
         CheckApplication.TaskChanged(task);
     }
 }
示例#3
0
        void m_pRepComBox_CheckType_CloseUp(object sender, CloseUpEventArgs e)
        {
            if (e.CloseMode == PopupCloseMode.ButtonClick || e.CloseMode == PopupCloseMode.Normal)
            {
                try
                {
                    string strPreValue = e.Value as string;
                    if (strPreValue == Text_CheckMode_CreateOnly)  // 仅创建
                    {
                        gridViewCheckSetting.SetFocusedRowCellValue(gridViewCheckSetting.Columns["Hy.Check.Rules"], null);
                        return;
                    }
                    if (strPreValue == Text_CheckMode_CheckAll)  // 全检
                    {
                        //gridViewCheckSetting.SetFocusedRowCellValue(gridViewCheckSetting.Columns["Hy.Check.Rules"], (new Hy.Check.Engine.TemplateRules(((KeyValuePair<string, string>)cmbSchema.SelectedItem).Key)).CurrentSchemaRules);
                        gridViewCheckSetting.SetFocusedRowCellValue(gridViewCheckSetting.Columns["Hy.Check.Rules"], null);
                        return;
                    }
                    if (strPreValue == Text_CheckMode_CheckPartly)  // 抽检
                    {
                        if (m_FrmRules == null)
                            m_FrmRules = new FrmPreCheck();

                        m_FrmRules.CurrentTemplateRules = new TemplateRules(((KeyValuePair<string, string>)cmbSchema.SelectedItem).Key);

                        List<SchemaRuleEx> curValue = gridViewCheckSetting.GetFocusedRowCellValue("Hy.Check.Rules") as List<SchemaRuleEx>;
                        if (curValue != null)
                            m_FrmRules.SchemaRulesSelection = curValue;

                        if (m_FrmRules.ShowDialog() == DialogResult.Yes)
                        {
                            curValue = m_FrmRules.SchemaRulesSelection;
                            gridViewCheckSetting.SetFocusedRowCellValue(gridViewCheckSetting.Columns["Hy.Check.Rules"], curValue);
                        }
                        else
                        {
                            e.AcceptValue = false;
                        }
                    }

                }
                catch { }
            }
        }