Example #1
0
        private void gridViewLog_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                if (e.Column.Name == "colDetalle")
                {
                    string mensaje = (string)gridViewLog.GetFocusedRowCellValue(colDetalle);

                    if (mensaje != "")
                    {
                        frmMensaje frmsg = new frmMensaje();
                        frmsg.richTextBoxMensaje.Text = mensaje;
                        frmsg.WindowState             = FormWindowState.Maximized;
                        frmsg.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Example #2
0
        private void gridViewFiles_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                tb_Comprobante_Info InfoCbteT = new tb_Comprobante_Info();
                string msg = "";


                switch (e.Column.Name)
                {
                case "colRide":

                    XtraReport Reporte = new XtraReport();



                    InfoCbteT = (tb_Comprobante_Info)gridViewFiles.GetFocusedRow();

                    Reporte = Rpt_Ride_Bus.Optener_reporte(InfoCbteT, ref msg);     //FAct Imporpoint
                    Reporte.ShowPreview();

                    break;

                case "colXml":


                    InfoCbteT = (tb_Comprobante_Info)gridViewFiles.GetFocusedRow();

                    XmlDocument xmlOrigen = new XmlDocument();
                    xmlOrigen.Load(new StringReader(InfoCbteT.s_XML));



                    Stream         myStream;
                    SaveFileDialog saveFileDialog1 = new SaveFileDialog();

                    saveFileDialog1.Filter           = "xml files (*.xml)|*.xml";
                    saveFileDialog1.FilterIndex      = 2;
                    saveFileDialog1.RestoreDirectory = true;
                    saveFileDialog1.FileName         = "SRI_" + InfoCbteT.Nombre_file;

                    if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                    {
                        if ((myStream = saveFileDialog1.OpenFile()) != null)
                        {
                            xmlOrigen.Save(myStream);
                            myStream.Close();
                        }
                    }


                    break;

                case "colIconoGuardar":


                    InfoCbteT = (tb_Comprobante_Info)gridViewFiles.GetFocusedRow();

                    if (BusCbte_exte.GrabarDB(InfoCbteT, ref msg))
                    {
                        MessageBox.Show("Proceso de exportacion OK...", "efirm", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        listComprobanteRecixSRI.Remove(InfoCbteT);
                    }
                    else
                    {
                        MessageBox.Show("No se pudo procesar el Proceso de exportacion..." + msg, "efirm", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }



                    break;

                default:
                    string mensaje = (string)gridViewFiles.GetFocusedRowCellValue(e.Column);


                    if (mensaje != "")
                    {
                        frmMensaje frmsg = new frmMensaje();
                        frmsg.richTextBoxMensaje.Text = mensaje;
                        frmsg.WindowState             = FormWindowState.Maximized;
                        frmsg.ShowDialog();
                    }

                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
                BusSisLog.Log_Error(ex.Message.ToString(), eTipoError.ERROR, this.ToString());
            }
        }
Example #3
0
        private void gridViewFiles_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            string xml = ""; frmMensaje frmsg = null;

            try
            {
                row = (vw_Comprobantes_recibidos_Info)gridViewFiles.GetFocusedRow();

                if (e.Column.Name == "colCheked")
                {
                    if ((bool)gridViewFiles.GetFocusedRowCellValue(colCheked))
                    {
                        gridViewFiles.SetFocusedRowCellValue(colCheked, false);
                    }
                    else
                    {
                        gridViewFiles.SetFocusedRowCellValue(colCheked, true);
                    }
                }


                if (e.Column.Name == "colextencion")
                {
                    if (row.extencion.ToUpper() == ".PDF")
                    {
                        string RutaFile = Path.GetTempPath();

                        RutaFile = RutaFile + "\\" + row.descripcion_archi;
                        System.IO.File.WriteAllBytes(RutaFile, row.Archivo_adjunto);

                        System.Diagnostics.Process proc = new System.Diagnostics.Process();

                        proc.StartInfo.FileName = RutaFile;
                        proc.Start();
                        proc.Close();
                    }

                    if (row.extencion.ToUpper() == ".XML")
                    {
                        try
                        {
                            string RutaFile = Path.GetTempPath();
                            string sxml     = "";
                            RutaFile = RutaFile + "\\" + row.descripcion_archi;
                            XmlDocument doc = new XmlDocument();
                            xml = Encoding.UTF8.GetString(row.Archivo_adjunto);


                            frmsg = new frmMensaje();
                            frmsg.richTextBoxMensaje.Text = xml;
                            frmsg.WindowState             = FormWindowState.Maximized;
                            frmsg.ShowDialog();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show("Error " + ex.Message);
                        }
                    }
                }


                if (e.Column.Name == "cols_Xml")
                {
                    if (row.s_Xml != "")
                    {
                        frmsg = new frmMensaje();
                        frmsg.richTextBoxMensaje.Text = row.s_Xml;
                        frmsg.WindowState             = FormWindowState.Maximized;
                        frmsg.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Example #4
0
        private void gridViewFiles_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                row = (vw_Comprobantes_recibidos_Info)gridViewFiles.GetFocusedRow();

                if (e.Column.Name == "colCheked")
                {
                    if ((bool)gridViewFiles.GetFocusedRowCellValue(colCheked))
                    {
                        gridViewFiles.SetFocusedRowCellValue(colCheked, false);
                    }
                    else
                    {
                        gridViewFiles.SetFocusedRowCellValue(colCheked, true);
                    }
                }


                if (e.Column.Name == "colextencion")
                {
                    if (row.extencion == ".pdf")
                    {
                        string RutaFile = Path.GetTempPath();

                        RutaFile = RutaFile + "\\" + row.descripcion_archi;
                        System.IO.File.WriteAllBytes(RutaFile, row.Archivo_adjunto);

                        System.Diagnostics.Process proc = new System.Diagnostics.Process();

                        proc.StartInfo.FileName = RutaFile;
                        proc.Start();
                        proc.Close();
                    }

                    if (row.extencion == ".Xml" || row.extencion == ".xml")
                    {
                        string RutaFile = Path.GetTempPath();

                        RutaFile = RutaFile + "\\" + row.descripcion_archi;

                        XmlDocument doc = new XmlDocument();
                        string      xml = Encoding.UTF8.GetString(row.Archivo_adjunto);
                        doc.LoadXml(xml);


                        doc.Save(RutaFile);


                        System.Xml.XmlTextReader reader = new System.Xml.XmlTextReader(RutaFile);
                        string contenido = "";
                        while (reader.Read())
                        {
                            reader.MoveToContent();
                            if (reader.NodeType == System.Xml.XmlNodeType.Element)
                            {
                                contenido += "<" + reader.Name + ">\n";
                            }
                            if (reader.NodeType == System.Xml.XmlNodeType.Text)
                            {
                                contenido += reader.Value + "\n";
                            }
                        }

                        if (contenido != "")
                        {
                            frmMensaje frmsg = new frmMensaje();
                            frmsg.richTextBoxMensaje.Text = contenido;
                            frmsg.WindowState             = FormWindowState.Maximized;
                            frmsg.ShowDialog();
                        }
                    }
                }


                if (e.Column.Name == "cols_Xml")
                {
                    if (row.s_Xml != "")
                    {
                        frmMensaje frmsg = new frmMensaje();
                        frmsg.richTextBoxMensaje.Text = row.s_Xml;
                        frmsg.WindowState             = FormWindowState.Maximized;
                        frmsg.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Example #5
0
        private void gridViewFiles_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                tb_Comprobante_Info InfoCbteT = new tb_Comprobante_Info();

                string MensajeError = "";


                switch (e.Column.Name)
                {
                case "colRide":

                    XtraReport Reporte = new XtraReport();
                    string     msg     = "";


                    InfoCbteT = (tb_Comprobante_Info)gridViewFiles.GetFocusedRow();

                    Reporte = Rpt_Ride_Bus.Optener_reporte(InfoCbteT, ref msg);         //FAct Imporpoint
                    Reporte.ShowPreview();

                    break;

                case "colXml":


                    InfoCbteT = (tb_Comprobante_Info)gridViewFiles.GetFocusedRow();

                    tb_Comprobante_Bus BusCbte = new tb_Comprobante_Bus();
                    string             sXML    = "";
                    sXML = BusCbte.Get_XML(InfoCbteT.IdEmpresa, InfoCbteT.IdComprobante, ref MensajeError);

                    XmlDocument xmlOrigen = new XmlDocument();
                    xmlOrigen.Load(new StringReader(sXML));



                    Stream         myStream;
                    SaveFileDialog saveFileDialog1 = new SaveFileDialog();

                    saveFileDialog1.Filter           = "xml files (*.xml)|*.xml";
                    saveFileDialog1.FilterIndex      = 2;
                    saveFileDialog1.RestoreDirectory = true;
                    saveFileDialog1.FileName         = "SRI_" + InfoCbteT.Nombre_file;

                    if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                    {
                        if ((myStream = saveFileDialog1.OpenFile()) != null)
                        {
                            xmlOrigen.Save(myStream);
                            myStream.Close();
                        }
                    }


                    break;

                case "colEliminar":



                    string msgError = "";

                    InfoCbteT = (tb_Comprobante_Info)gridViewFiles.GetFocusedRow();
                    if (InfoCbteT.EstadoDoc == "NO AUTORIZADO")
                    {
                        if (MessageBox.Show("Esta seguro que desear anular el comprobante #:" + InfoCbteT.IdComprobante, "Efirm confirmacion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            if (buscomp.Eliminar_Cbte(InfoCbteT.IdEmpresa, InfoCbteT.IdComprobante, "", "", ref msgError))
                            {
                                MessageBox.Show("Eliminacion de comprobante Ok", "Efirm", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                        }
                    }

                    if (InfoCbteT.EstadoDoc == "AUTORIZADO")
                    {
                        if (Efirm.Properties.Settings.Default.P_ESTADO_CARGA_EFIRM == "CLIENTE")
                        {
                            MessageBox.Show("Usted no tiene Permiso para Eliminar Comprobantes AUTORIZADOS .. solicite a sistemas o inicie como administrador", "Efirm", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }


                        if (MessageBox.Show("Esta seguro que desear anular el comprobante #:" + InfoCbteT.IdComprobante, "Efirm confirmacion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            if (MessageBox.Show("Esta REALMENTE seguro que desear anular el comprobante #:" + InfoCbteT.IdComprobante + " RECUERDE EL COMPROBANTE ESTA AUTORIZADO DEBERA REALIZAR TODO EL PROCESO NUEVAMENTE", "Efirm confirmacion", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
                            {
                                if (MessageBox.Show("***ATENCION....CUIDADO ESTA ELIMINANDO UN CBTE *AUTORIZADO* ESTE COMPROBANTE YA ESTA EN LA BASE DEL SRI y no sera elimado del mismo solo se eliminara de efirm... comprobante #:" + InfoCbteT.IdComprobante, "Efirm confirmacion", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                                {
                                    frmAuditoria_Anulacion frm = new frmAuditoria_Anulacion();
                                    frm.ShowDialog();

                                    if (buscomp.Eliminar_Cbte(InfoCbteT.IdEmpresa, InfoCbteT.IdComprobante, frm.txt_usuario_anulacion.Text, frm.txt_motivo_anulacion.Text, ref msgError))
                                    {
                                        MessageBox.Show("Eliminacion de comprobante Ok", "Efirm", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    }
                                }
                            }
                        }
                    }


                    break;



                default:
                    string mensaje = (string)gridViewFiles.GetFocusedRowCellValue(e.Column);


                    if (mensaje != "")
                    {
                        frmMensaje frmsg = new frmMensaje();
                        frmsg.richTextBoxMensaje.Text = mensaje;
                        frmsg.WindowState             = FormWindowState.Maximized;
                        frmsg.ShowDialog();
                    }

                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
                BusSisLog.Log_Error(ex.Message.ToString(), eTipoError.ERROR, this.ToString());
            }
        }