Exemplo n.º 1
0
        private void dataGridView1_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            var lengths = from element in this.lClientes where element.codigo.Equals(this.dataGridView1[1, e.RowIndex].Value) select element;

            if (lengths != null)
            {
                this.cAtual = lengths.First();
                if (this.cAtual != null)
                {
                    this.dataGridView2.DataSource = cAtual.lExames;
                }
            }
        }
Exemplo n.º 2
0
        public void carregarResultadoLaudo(Cliente.Cliente cCliente, string strExame)
        {
            if (strExame.Equals("//////"))
            {
                return;
            }

            string strExemeArquivo = strExame.Replace('/', '_');
            string path            = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\Labol_Resultados\\" + cCliente.ano + cCliente.mes + "\\";

            //string path = Directory.GetCurrentDirectory() + "\\" + cCliente.ano + cCliente.mes + "\\";
            if (!Directory.Exists(path))
            {
                DirectoryInfo di = Directory.CreateDirectory(path);
                //this.copiarArquivos(Directory.GetCurrentDirectory() + "\\img\\lab_3.gif", Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\Labol_Resultados\\lab_3.gif");
            }

            string strFileNameBase = cCliente.codigo + "_" + strExemeArquivo + "_";

            string[] filePaths = Directory.GetFiles(path, strFileNameBase + "*www");

            if (true)//filePaths.Length == 0)
            {
                //List<String> lCamposJaAdicionados = new List<string>();
                SortedDictionary <string, Exame.Exame> sdCamposExame;

                //List<Exame.Exame> lCampos = Exames.getExames(strExame, this.strCaminhoArqTemp + "\\XEXAS.LAB", this.strCaminhoArqTemp + "\\TEXAS.LAB");
                if (this.dExames.ContainsKey(strExame))
                {
                    sdCamposExame = this.dExames[strExame];
                }
                else
                {
                    sdCamposExame          = Exames.getExames(strExame, this.strCaminhoArqTemp + "\\XEXAS.LAB", this.strCaminhoArqTemp + "\\TEXAS.LAB", this.strCaminhoArqTemp + "\\TEXTAB.LAB");
                    this.dExames[strExame] = sdCamposExame;
                }

                //List<Exame.Exame> retornoPosRegistro = Exames.getCamposExameValNormais(cCliente, lCampos, strExame);

                string strArqLaudo = "\\LAUDOS" + cCliente.mes + "." + cCliente.ano.Substring(2, 2);

                this.copiarArquivos(Settings1.Default.caminho_labol + strArqLaudo, this.strCaminhoArqTemp + strArqLaudo);

                List <LaudoValor>[] lLaudoValor = LabolLeExames.Laudo.Laudos.getIndiceLaudo(cCliente.codigo, strExame, this.strCaminhoArqTemp + strArqLaudo);

                this.strResultado = Resultado.Apresentacao.montaApresentacaoResultado(cCliente, sdCamposExame, lLaudoValor);



                Random r = new Random();
                this.strArquivoGerado = path + cCliente.codigo + "_" + strExemeArquivo + "_" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss_") + r.Next(999999).ToString() + ".html";
                TextWriter tw = new StreamWriter(this.strArquivoGerado);
                tw.WriteLine(this.strResultado);
                tw.Close();
                System.Diagnostics.Process.Start("IEXPLORE.EXE", this.strArquivoGerado);
                //this.webBrowser1.Url = new Uri(this.strArquivoGerado);
            }
            //else
            //{
            //    this.webBrowser1.Url = new Uri(filePaths[0]);

            //}
        }