示例#1
0
        public string openFile()
        {
            OpenFileDialog fileDialog = new OpenFileDialog();

            fileDialog.Filter = "txt files (*.xls;*.xlsx)|*.xls;*.xlsx|All files (*.*)|*.*";

            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                //  this.progressBar1.Visible = true;
                string extension = Path.GetExtension(fileDialog.FileName);

                string[] str       = new string[] { ".xls", ".xlsx" };
                bool     isContain = false;
                foreach (string tem in str)
                {
                    if (tem.Equals(extension))
                    {
                        isContain = true;
                    }
                }

                if (!isContain)
                {
                    MessageDxUnit.ShowTips("the excel file must be in .xls or .xlsx format!");
                }
                else if (fileDialog.FileName != null)
                {
                    return(fileDialog.FileName);
                }
            }
            return(null);
        }
 //present the data in data grid
 public void presentDataInPriorityGrid()
 {
     if (!this.initPriorityGridData())
     {
         MessageDxUnit.ShowWarning("initialize the priority grid failed");
     }
 }
示例#3
0
 private void presentDataInCoverageGrid()
 {
     if (!this.initCoverageGridData())
     {
         MessageDxUnit.ShowWarning("initialize the coverage grid failed");
     }
 }
 public void presentDataInTestSetGrid(List <Dictionary <string, Dictionary <string, string> > > testSet)
 {
     if (!this.initTestSetGridData(testSet))
     {
         MessageDxUnit.ShowWarning("initialize the test set grid failed");
     }
     presentDataInCoverageGrid();
 }
示例#5
0
 private void saveDataThreadRun()
 {
     if (this.controller.saveData(this.loadFilePath))
     {
         iSave.Enabled = false;
         // MessageDxUnit.ShowTips("Save succeed");
     }
     else
     {
         MessageDxUnit.ShowError("Save Failed");
     }
     isSave = true;
 }
示例#6
0
 // import the data from excel  to the memory object
 public void getDataFromExcel(string path)
 {
     // load data from excel
     if (controller.loadData(path, "Priority"))
     {
         // MessageDxUnit.ShowTips("load data form excel success");
         isDataLoad = true;
         this.variableRelationRibbonPageGroup.Enabled = true;
         this.analysisStrategyRibbonGroup.Enabled     = true;
         this.clearDataItem.Enabled = true;
         this.controller.setProjectDefaultVaraibleRelation();
         this.controller.setProjectDefaultAnalysisStrategy();
     }
     else
     {
         MessageDxUnit.ShowWarning("load data form excel failed");
     }
 }
示例#7
0
 // custom the show message dialog
 public bool showErrorMessage(string errorMessage)
 {
     MessageDxUnit.ShowError(errorMessage);
     return(false);
 }