Exemplo n.º 1
0
 public void buscaegreso()
 {
     try
     {
         this.Egre           = new Egreso_manual();
         this.Egre.Opc       = 2;
         this.Egre.Id_egreso = GloID;
         this.EgreHelper     = new Egreso_Manual_Helper(Egre);
         this.datos          = new DataTable();
         this.datos          = this.EgreHelper.Consulta_Egreso();
         if (datos.Rows.Count >= 0)
         {
             DataRow fila = datos.Rows[0];
             this.Lbldigiomanu.Text   = fila["Digital"].ToString();
             this.Lblfecha.Text       = fila["Fecha_ingreso"].ToString();
             this.Lblnumfactura.Text  = fila["Numero_factura"].ToString();
             this.LblID_comercio.Text = fila["Cedula_Juridica"].ToString();
             this.Lblfisica.Text      = fila["Existe_fisica"].ToString();
             this.LblGTI.Text         = fila["GTI"].ToString();
             this.Lblcomercio.Text    = fila["Nombre_comercio"].ToString();
             id_detalle = int.Parse(fila["Id_detalle"].ToString());
             buscadetalle();
             this.Lbldetalle.Text     = nombre_detalle;
             this.Lblpartida.Text     = fila["Id_partida"].ToString();
             this.Lblmonto_total.Text = fila["Monto_factura"].ToString();
             this.Lblestadopago.Text  = fila["Estado_pago"].ToString();
             this.Lblplazo_pago.Text  = fila["Plazo_pago"].ToString();
             pdfbytes = Encoding.ASCII.GetBytes(fila["Pdf_factura"].ToString());
             this.LBLNombrepdf.Text = fila["Nombre_pdf"].ToString();
             this.LblCenCos.Text    = fila["Id_Centro_costos"].ToString();
             id_metodo = int.Parse(fila["Id_metodo_pago"].ToString());
             buscaMetodo();
             this.LblMetodoPago.Text = nombre_metodo;
             id_banco = int.Parse(fila["Id_banco"].ToString());
             buscaBanco();
             this.LblBanco.Text       = nombre_banco;
             this.LblMoneda.Text      = fila["Moneda"].ToString();
             this.Lbltipo_cambio.Text = fila["Tipo_cambio"].ToString();//
             this.Lblmes.Text         = fila["Mes"].ToString();
             this.Lbltotal_iva.Text   = fila["TotalIva"].ToString();
             estado = fila["Estado"].ToString();
         }
     }
     catch (Exception)
     {
         ScriptManager.RegisterStartupScript(this, typeof(Page), "mensajeError", "mensajeError('" + "" + "');", true);
     }
 }
Exemplo n.º 2
0
 public Egreso_Manual_Helper(Egreso_manual parObjEgresoM)
 {
     OBJEgresoM = parObjEgresoM;
 }
Exemplo n.º 3
0
        protected void btn_registrar_Click(object sender, EventArgs e)
        {
            try
            {
                this.EgresoM                = new Egreso_manual();
                this.EgresoM.Opc            = 1;
                this.EgresoM.Digital        = "No";
                this.EgresoM.Fecha_registro = fecha.Value;
                this.EgresoM.Numero_factura = this.txt_num_factura.Text;
                num_factu = this.txt_num_factura.Text;
                if (this.Radioaprobada1.Checked)
                {
                    this.EgresoM.Gti = "Si";
                }
                else if (this.Radioaprobada2.Checked)
                {
                    this.EgresoM.Gti = "No";
                }
                this.EgresoM.Nombre_comercio = this.txt_Nombre_comercio_egreso.Text;
                if (this.TxtCedula_juridica.Text == null)
                {
                    this.EgresoM.Cedula_juridica = "No existe";
                }
                else
                {
                    this.EgresoM.Cedula_juridica = this.TxtCedula_juridica.Text;
                }
                this.EgresoM.Id_detalle    = this.DptClasificacion.SelectedValue;
                this.EgresoM.Id_partida    = this.DptPartida.SelectedValue;
                this.EgresoM.Monto_factura = this.TxtMontoTotal.Text;
                if (this.Radiopagada_si.Checked)
                {
                    this.EgresoM.Estado_pago    = "Si";
                    this.EgresoM.Plazo_pago     = "0";
                    this.Dpt_plazo_pago.Enabled = true;
                    this.EgresoM.Id_banco       = this.DptBanco.SelectedValue;
                    this.EgresoM.Id_metodo_pago = this.DptMetodoPago.SelectedValue;
                }
                else if (this.Radiopagada_no.Checked)
                {
                    this.EgresoM.Estado_pago    = "No";
                    this.EgresoM.Plazo_pago     = this.Dpt_plazo_pago.SelectedValue;
                    this.EgresoM.Id_banco       = "Pendiente";
                    this.EgresoM.Id_metodo_pago = "Pendiente";
                    this.DptBanco.Enabled       = true;
                    this.DptMetodoPago.Enabled  = true;
                }
                validarpago();
                if (/*this.Dptexiste.SelectedValue == "Si"*/ this.file_pdf.FileName != "")
                {
                    this.EgresoM.Pdf_factura = this.file_pdf.FileBytes;
                    this.EgresoM.Nombre_pdf  = this.file_pdf.FileName;
                    this.EgresoM.Fisica      = "Sí";
                }
                else if (/*this.Dptexiste.SelectedValue == "No" */ this.file_pdf.FileName == "")
                {
                    this.EgresoM.Pdf_factura = null;
                    this.EgresoM.Nombre_pdf  = "No existe documento";
                    this.EgresoM.Fisica      = "No";
                }

                this.EgresoM.Id_centroCostos = this.DptCCostos_EXML.SelectedValue;
                this.EgresoM.Moneda          = this.DptMoneda.SelectedValue;
                if (this.DptMoneda.SelectedValue == "USD")
                {
                    this.EgresoM.Tipo_cambio = this.TxtTipocambio.Text;
                }
                else
                {
                    this.EgresoM.Tipo_cambio = "0";
                }
                //this.EgresoM.PorcenIva = PorcentajeIVA.Value;
                this.EgresoM.Mes      = fecha.Value;
                this.EgresoM.TotalIva = this.TxtTotalIva.Text;
                this.EgresoM.Estado   = "Activo";


                monto_total     = float.Parse(TxtMontoTotal.Text);
                id_partida      = this.DptPartida.SelectedValue;
                id_centroCostos = this.DptCCostos_EXML.SelectedValue;
                buscaperiodo();
                Ingresar_movi_consulta();
                this.EgrsoHelper = new Egreso_Manual_Helper(EgresoM);
                this.EgrsoHelper.Agrergar_Egreso_manual();


                this.txt_Nombre_comercio_egreso.Text = null;
                this.txt_num_factura.Text            = null;
                ScriptManager.RegisterStartupScript(this, typeof(Page), "mmensajeDeconfirmacion", "mensajeDeconfirmacion('" + "" + "');", true);
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "mensajeError", "mensajeError('" + "" + "');", true);
            }
        }