Пример #1
0
        private void showData()
        {
            dScript = DataScriptDAL.getInfo(FID);
            dRule   = DataScriptRuleDAL.getInfo(FID);

            ProjectCode.SelectedValue = dScript.ProjectCode;
            TaskName.Text             = dScript.TaskName;
            txtTableName.Text         = dScript.TableName;
            MidsScriptCode.Text       = dScript.MidsScriptCode;
            MidsScriptName.Text       = dScript.MidsScriptName;
            MidsScriptVesion.Text     = dScript.MidsScriptVesion;
            FileType.SelectedValue    = dScript.FileType;
            IndexKey.Text             = dScript.IndexKey;
            ValidFlag.Text            = dScript.ValidFlag;
            Remark.Text = dScript.Remark;
            ApplyTestProject.SelectedValue = dScript.ApplyTestProject;
            ScriptType.SelectedIndex       = dScript.ScriptType;

            SetColSperator(dRule.ColSperator);
            ColName_Lines.Text = dRule.ColnameLines.ToString();

            if (tables.SingleOrDefault(it => it.TableName == dRule.DesTable) == null)
            {
                tables.Add(new TableInfo()
                {
                    TableDesc = dRule.DesTable, TableName = dRule.DesTable
                });
            }
            ProjectCode.SelectedValue = dScript.ProjectCode;

            txtTemplageFile.Text = dRule.DesFile;
        }
Пример #2
0
        public Class1(string userID, string userName, string projectCode, string taskCode, string scriptCode, int times, string sourceFile)
        {
            this.userID = userID;
            var taskInfoList = WebHelper.listTdmTasks(userName);

            this.taskInfo = taskInfoList.FirstOrDefault(it => it.taskCode == taskCode);

            // "b1190f6a66a94b6eb110b3ffc0739887";
            string fid = scriptCode2Fid(scriptCode);

            this.dataScript     = DataScriptDAL.getInfo(fid);
            this.dataScriptRule = DataScriptRuleDAL.getInfo(fid);
            this.times          = times;
            this.sourceFile     = sourceFile;
            this.columnMap      = getColumnMap();
            this.calColumnMap();

            if (this.dataScriptRule != null)
            {
                this.structList = TableDAL.getTableStructure(this.dataScriptRule.DesTable);
            }
        }
Пример #3
0
        public bool init()
        {
            var taskInfoList = TaskinfoDAL.getList(userName);

            if (taskInfoList == null || taskInfoList.Count == 0)
            {
                SendMessageEvent(false, string.Format("用户[{0}],无任务数据", userName));
                CompleteEvent(this, new CompleteArgs()
                {
                    Message = "数据导入失败"
                });
                return(false);
            }

            this.taskInfo = taskInfoList.FirstOrDefault(it => it.taskCode == taskCode);

            if (taskInfo == null)
            {
                SendMessageEvent(false, string.Format("任务[{0}],不存在", taskCode));
                CompleteEvent(this, new CompleteArgs()
                {
                    Message = "数据导入失败"
                });
                return(false);
            }

            var dataSource = WebHelper.listTdmTaskTimesInfo(taskInfo.id);

            if (dataSource.Count(it => it.TestTime == this.times.ToString()) < 1)
            {
                SendMessageEvent(false, string.Format("任务 [ {0} ] ,试验次数 [ {1} ] 不存在,", taskCode, this.times));
                CompleteEvent(this, new CompleteArgs()
                {
                    Message = "数据导入失败"
                });
                return(false);
            }

            string fid = scriptCode2Fid(scriptCode);

            if (string.IsNullOrEmpty(fid))
            {
                SendMessageEvent(false, string.Format("任务[{0}],不存在", taskCode));
                CompleteEvent(this, new CompleteArgs()
                {
                    Message = "数据导入失败"
                });
                return(false);
            }

            this.dataScript = DataScriptDAL.getInfo(fid);

            if (dataScript == null)
            {
                SendMessageEvent(false, string.Format("任务[{0}],不存在", taskCode));
                CompleteEvent(this, new CompleteArgs()
                {
                    Message = "数据导入失败"
                });
                return(false);
            }

            this.dataScriptRule = DataScriptRuleDAL.getInfo(fid);

            if (dataScriptRule == null)
            {
                SendMessageEvent(false, string.Format("任务规则[{0}],不存在", fid));
                CompleteEvent(this, new CompleteArgs()
                {
                    Message = "数据导入失败"
                });
                return(false);
            }

            this.columnMap = getColumnMap();

            if (this.dataScriptRule != null)
            {
                this.structList = TableDAL.getTableStructure(this.dataScriptRule.DesTable);
            }

            return(true);
        }