Esempio n. 1
0
        private void btnExport_Click(object sender, EventArgs e)
        {
            if (File.Exists(taskFile))
            {
                FormAccess.KillPhantProcess();
                listAllTask      = new List <string>();
                listFinishedTask = new List <string>();
                if (radioButton1.Checked)
                {
                    KolReportBase.sourceUrl = "192.168.0.96:8091";
                    KolReportBase.domain    = "192.168.0.96";
                }
                else
                {
                    KolReportBase.sourceUrl = "metrix.gbihealth.com";
                    KolReportBase.domain    = "metrix.gbihealth.com";
                }

                var users = File.ReadAllLines(taskFile).Where(t => !string.IsNullOrWhiteSpace(t));
                if (!users.Any())
                {
                    MessageBox.Show("任务完成");
                }

                var savePath = txtOutPath.Text;
                if (string.IsNullOrWhiteSpace(txtOutPath.Text) || !Directory.Exists(txtOutPath.Text))
                {
                    MessageBox.Show("请设置导出路径");
                    return;
                }
                string language = rbCN.Checked ? "cn" : "en";
                string type     = rbPdf.Checked ? "pdf" : "word";


                FrmTask frmTask = new FrmTask();
                foreach (var user in users)
                {
                    UCTaskPanel taskPanel = new UCTaskPanel();

                    taskPanel.KolFile = new KolFile()
                    {
                        fileType = type,
                        hcpId    = user,
                        language = language,
                        savePath = savePath,
                    };
                    frmTask.listTaskPanel.Add(taskPanel);
                    listAllTask.Add(user);
                }
                frmTask.ShowDialog(this);
            }
            else
            {
                MessageBox.Show("未找到txt文档");
                Application.Exit();
            }
        }
Esempio n. 2
0
        private void btnExport_Click(object sender, EventArgs e)
        {
            FormAccess.KillPhantProcess();
            listAllTask      = new List <string>();
            listFinishedTask = new List <string>();
            if (radioButton1.Checked)
            {
                KolReportBase.sourceUrl = "192.168.0.96:8091";
                KolReportBase.domain    = "192.168.0.96";
            }
            else
            {
                KolReportBase.sourceUrl = "metrix.gbihealth.com";
                KolReportBase.domain    = "metrix.gbihealth.com";
            }

            var users    = txtUsers.Text.Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            var savePath = txtOutPath.Text;

            if (string.IsNullOrWhiteSpace(txtOutPath.Text) || !Directory.Exists(txtOutPath.Text))
            {
                MessageBox.Show("请设置导出路径");
                return;
            }
            string language = rbCN.Checked ? "cn" : "en";
            string type     = rbPdf.Checked ? "pdf" : "word";


            FrmTask frmTask = new FrmTask();

            foreach (var user in users)
            {
                UCTaskPanel taskPanel = new UCTaskPanel();

                taskPanel.KolFile = new KolFile()
                {
                    fileType = type,
                    hcpId    = user,
                    language = language,
                    savePath = savePath,
                };
                frmTask.listTaskPanel.Add(taskPanel);
                listAllTask.Add(user);
            }
            frmTask.ShowDialog(this);
        }