Ejemplo n.º 1
0
        private void btnGuardarHistorial_Click(object sender, EventArgs e)
        {
            try
            {
                string            aaa         = "";
                PericiaHistoriaWF periciaForm = new PericiaHistoriaWF(aaa);
                periciaForm.Enabled = false;

                Entidades.Pericias _pericia = CargarEntidad();
                bool Exito = PericiaNeg.GurdarHistorialPericia(_pericia);
                if (Exito == true)
                {
                    ProgressBar();
                    const string message2 = "Se registro el nuevo estadio exitosamente.";
                    const string caption2 = "Éxito";
                    var          result2  = MessageBox.Show(message2, caption2,
                                                            MessageBoxButtons.OK,
                                                            MessageBoxIcon.Asterisk);
                    LimpiarCampos();
                    ListaPericias            = PericiaNeg.BuscarHistorialPericia(idPericiaSeleccionada);
                    groupBox2.Visible        = false;
                    btnNuevaHistoria.Visible = true;
                    btnVolver.Visible        = true;
                    periciaForm.Enabled      = true;
                }
                else
                {
                }
            }
            catch (Exception ex)
            { }
        }
Ejemplo n.º 2
0
        private void btnEnviarEmail_Click(object sender, EventArgs e)
        {
            bool Exito = false;

            Entidades.Pericias _pericia = CargarEntidad();
            if (!String.IsNullOrEmpty(txtCuentaEmail.Text) & !String.IsNullOrEmpty(txtAsunto.Text))
            {
                Exito = PericiaNeg.EnviarEmailConEscrito(txtTexto.Text, txtCuentaEmail.Text, _pericia.UsuarioLogin, cmbRespuestas.Text);
            }
            else
            {
                const string message = "Los campos Asuntos y cuenta de email son obligatorios.";
                const string caption = "Atención";
                var          result  = MessageBox.Show(message, caption,
                                                       MessageBoxButtons.OK,
                                                       MessageBoxIcon.Warning);
            }
            if (Exito == true)
            {
                const string message2 = "Se envio el email correctamente.";
                const string caption2 = "Éxito";
                var          result2  = MessageBox.Show(message2, caption2,
                                                        MessageBoxButtons.OK,
                                                        MessageBoxIcon.Asterisk);
            }
        }
Ejemplo n.º 3
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                if (PesoTotalArchivos > 23.84186)
                {
                    const string message = "Atención el peso de los archivos supera el maximo permitido.";
                    const string caption = "Error";
                    var          result  = MessageBox.Show(message, caption,
                                                           MessageBoxButtons.OK,
                                                           MessageBoxIcon.Exclamation);
                    throw new Exception();
                }

                Entidades.Pericias _pericia = CargarEntidad();
                groupBox1.Enabled = false;
                groupBox2.Enabled = false;
                groupBox3.Enabled = false;
                //UploadFile();
                bool Exito = PericiaNeg.GurdarPericia(_pericia);
                if (Exito == true)
                {
                    ProgressBar();
                    const string message2 = "Se registro la pericia exitosamente.";
                    const string caption2 = "Éxito";
                    var          result2  = MessageBox.Show(message2, caption2,
                                                            MessageBoxButtons.OK,
                                                            MessageBoxIcon.Asterisk);
                    groupBox1.Enabled = true;
                    groupBox2.Enabled = true;
                    groupBox3.Enabled = true;
                    LimpiarCampos();
                }
                else
                {
                    groupBox1.Enabled = true;
                    groupBox2.Enabled = true;
                    groupBox3.Enabled = true;
                    LimpiarCampos();
                }
            }
            catch (Exception ex) { }
        }
Ejemplo n.º 4
0
        private void btnGenerarEscrito_Click(object sender, EventArgs e)
        {
            Entidades.Pericias _pericia = CargarEntidad();
            if (cmbRespuestas.Text == "Perito contador solicita domicilio de compulsa")
            {
                Microsoft.Office.Interop.Word._Application oWord = new Microsoft.Office.Interop.Word.Application();
                oWord.Visible = true;
                var oDoc       = oWord.Documents.Add();
                var paragraph1 = oDoc.Content.Paragraphs.Add();
                paragraph1.Range.Text = txtTexto.Text;
                //paragraph1.Range.Font.Bold = 1;
                paragraph1.Format.SpaceAfter = 24;
                string NombreArchivo = "Domicilio de compulsa" + " " + "Causa N°" + _pericia.NroCausa; /*_pericia.Causa; +;*/
                oDoc.SaveAs2(@"C:\Sico-Setup\Dropbox\Escritos\" + NombreArchivo + "'");
                oWord.Quit();

                const string message2 = "Se genero y se guardo el escrito exitosamente.";
                const string caption2 = "Éxito";
                var          result2  = MessageBox.Show(message2, caption2,
                                                        MessageBoxButtons.OK,
                                                        MessageBoxIcon.Asterisk);
            }

            if (cmbRespuestas.Text == "Escrito Perito Contado Acepta Cargo")
            {
                Microsoft.Office.Interop.Word._Application oWord = new Microsoft.Office.Interop.Word.Application();
                oWord.Visible = true;
                var oDoc       = oWord.Documents.Add();
                var paragraph1 = oDoc.Content.Paragraphs.Add();
                paragraph1.Range.Text = txtTexto.Text;
                //paragraph1.Range.Font.Bold = 1;
                paragraph1.Format.SpaceAfter = 24;
                string NombreArchivo = "Acepta Cargo" + " " + " " + "Causa N°" + _pericia.NroCausa; /*_pericia.Causa + "Causa N°" + _pericia.NroCausa;*/
                oDoc.SaveAs2(@"C:\Sico-Setup\Dropbox\Escritos\" + NombreArchivo + "'");
                oWord.Quit();

                const string message2 = "Se genero y se guardo el escrito exitosamente.";
                const string caption2 = "Éxito";
                var          result2  = MessageBox.Show(message2, caption2,
                                                        MessageBoxButtons.OK,
                                                        MessageBoxIcon.Asterisk);
            }
        }
Ejemplo n.º 5
0
 private void CargarTextoEnPantalla(List <string> texto)
 {
     Entidades.Pericias _pericia = CargarEntidad();
     if (cmbRespuestas.Text == "Perito contador solicita domicilio de compulsa")
     {
         var    textoNuevo   = texto.First();
         string Plantilla    = textoNuevo;
         string Causa        = _pericia.Causa;
         string NroCausa     = "N°" + _pericia.NroCausa;
         string Tribunal     = _pericia.Tribunal;
         string source       = Plantilla;
         var    replacement  = source.Replace("@Causa", '"' + Causa + '"');
         var    replacement2 = replacement.Replace("@NroCausa", '"' + NroCausa + '"');
         var    replacement3 = replacement2.Replace("@Tribunal", '"' + Tribunal + '"');
         var    replacement4 = replacement3.Replace("<Salto>", "\r\n");
         var    replacement5 = replacement4.Replace('"', ' ');
         var    replacement6 = replacement5.Replace('+', ' ');
         txtTexto.Text = replacement6;
     }
     if (cmbRespuestas.Text == "Escrito Perito Contado Acepta Cargo")
     {
         var    textoNuevo   = texto.First();
         string Plantilla    = textoNuevo;
         string Causa        = _pericia.Causa;
         string NroCausa     = "N°" + _pericia.NroCausa;
         string Tribunal     = _pericia.Tribunal;
         string source       = Plantilla;
         var    replacement  = source.Replace("+ @Causa +", '"' + Causa + '"');
         var    replacement2 = replacement.Replace("+ @NroCausa +", '"' + NroCausa + '"');
         var    replacement3 = replacement2.Replace("+ @Tribunal +", '"' + Tribunal + '"');
         var    replacement4 = replacement3.Replace("<Salto>", "\r\n");
         var    replacement5 = replacement4.Replace('"', ' ');
         var    replacement6 = replacement5.Replace('+', ' ');
         txtTexto.Text = replacement6;
     }
 }