Пример #1
0
		///<summary></summary>
		public static void SendData(Program ProgramCur,Patient pat) {
			_path=Programs.GetProgramPath(Programs.GetCur(ProgramName.DemandForce));
			if(!File.Exists(_path)) {
				MessageBox.Show(_path+" could not be found.");
				return;
			}
			if(MessageBox.Show(Lan.g("DemandForce","This may take 20 minutes or longer")+".  "+Lan.g("DemandForce","Continue")+"?","",MessageBoxButtons.OKCancel)!=DialogResult.OK) {
				return;
			}
			_formProg=new FormProgress();
			_formProg.MaxVal=100;
			_formProg.NumberMultiplication=1;
			_formProg.DisplayText="";
			_formProg.NumberFormat="F";//Show whole percentages, not fractional percentages.
			Thread workerThread=new Thread(new ThreadStart(InstanceBridgeExport));
			workerThread.Start();
			if(_formProg.ShowDialog()==DialogResult.Cancel) {
				workerThread.Abort();
				MessageBox.Show(Lan.g("DemandForce","Export cancelled")+". "+Lan.g("DemandForce","Partially created file has been deleted")+".");
				CheckCreatedFile(CodeBase.ODFileUtils.CombinePaths(Path.GetDirectoryName(_path),"extract.xml"));
				_formProg.Dispose();
				return;
			}
			MessageBox.Show(Lan.g("DemandForce","Export complete")+". "+Lan.g("DemandForce","Press OK to launch DemandForce")+".");
			try {
				Process.Start(_path);//We might have to add extract.xml to launch command in the future.
			}
			catch {
				MessageBox.Show(_path+" is not available.");
			}
			_formProg.Dispose();
		}
Пример #2
0
        ///<summary></summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            _path = Programs.GetProgramPath(Programs.GetCur(ProgramName.DemandForce));
            if (!File.Exists(_path))
            {
                MessageBox.Show(_path + " could not be found.");
                return;
            }
            if (MessageBox.Show(Lan.g("DemandForce", "This may take 20 minutes or longer") + ".  " + Lan.g("DemandForce", "Continue") + "?", "", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            _formProg        = new FormProgress();
            _formProg.MaxVal = 100;
            _formProg.NumberMultiplication = 1;
            _formProg.DisplayText          = "";
            _formProg.NumberFormat         = "F";  //Show whole percentages, not fractional percentages.
            Thread workerThread = new Thread(new ThreadStart(InstanceBridgeExport));

            workerThread.Start();
            if (_formProg.ShowDialog() == DialogResult.Cancel)
            {
                workerThread.Abort();
                MessageBox.Show(Lan.g("DemandForce", "Export cancelled") + ". " + Lan.g("DemandForce", "Partially created file has been deleted") + ".");
                CheckCreatedFile(CodeBase.ODFileUtils.CombinePaths(Path.GetDirectoryName(_path), "extract.xml"));
                _formProg.Dispose();
                return;
            }
            MessageBox.Show(Lan.g("DemandForce", "Export complete") + ". " + Lan.g("DemandForce", "Press OK to launch DemandForce") + ".");
            try {
                ODFileUtils.ProcessStart(_path);                //We might have to add extract.xml to launch command in the future.
            }
            catch {
                MessageBox.Show(_path + " is not available.");
            }
            _formProg.Dispose();
        }
Пример #3
0
        private void btnRun_Click(object sender, EventArgs e)
        {
            try
            {
                var appConfig = AppConfigManager.Load();

                var directoryDestiny = string.IsNullOrEmpty(appConfig.DefaultDirectorySaveFiles)
                    ? GetDirectoryApp()
                    : appConfig.DefaultDirectorySaveFiles;

                foreach (var file in _listFiles)
                {
                    if (file.HeaderLength <= 0)
                    {
                        file.HeaderLength = appConfig.HeaderLength;
                    }

                    if (file.SeparatorCSV == null)
                    {
                        file.SeparatorCSV = appConfig.SeparadorCSV;
                    }
                }

                var frmProgress = new FormProgress(
                    _listFiles.ToArray(),
                    directoryDestiny,
                    appConfig.HeaderAction,
                    appConfig.EndProcessAction);

                frmProgress.ShowDialog();
                frmProgress.Dispose();
                SetLastFile();
            }
            catch (Exception ex)
            {
                MessageBox.Show(
                    this,
                    ex.Message,
                    "Erro inesperado durante o processamento",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
        }