コード例 #1
0
        private void Guardar()
        {
            try
            {
                if (this.TxtId_Cte.Text == string.Empty)
                {
                    Alerta("Debe seleccionar una factura");
                    return;
                }

                Sesion sesion = (Sesion)Session["Sesion" + Session.SessionID];
                CapaEntidad.CapFacturaLegal fac    = new CapaEntidad.CapFacturaLegal();
                CN_CapFacturaLegal          cn_fac = new CN_CapFacturaLegal();
                int Verificador = 0;

                LlenarObjeto(ref fac);


                cn_fac.CapFacturaLegal_Guardar(ref fac, ref Verificador, sesion.Emp_Cnx);

                if (Verificador == -1)
                {
                    LimpiarCampos();
                    Alerta("Los datos se guardaron correctamente");
                }
                else
                {
                    Alerta("Error al intentar guardar la infromación");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
        private void ConsultarFactura()
        {
            try
            {
                if (this.TxtId_Cd.Text == string.Empty)
                {
                    Alerta("Seleccione un centro de distribución");
                    return;
                }

                if (this.TxtId_Fac.Text == string.Empty)
                {
                    Alerta("Ingrese el número de factura");
                    return;
                }

                Sesion                      sesion = (Sesion)Session["Sesion" + Session.SessionID];
                CN_CapFacturaLegal          cn_fac = new CN_CapFacturaLegal();
                CapaEntidad.CapFacturaLegal fac    = new CapaEntidad.CapFacturaLegal();
                int Verificador = 0;

                cn_fac.CapFacturaLegal_Consulta(ref fac, ref Verificador, int.Parse(this.TxtId_Cd.Text), int.Parse(this.TxtId_Fac.Text), int.Parse(this.RblTipo.SelectedValue), sesion.Emp_Cnx);

                if (Verificador == 1)
                {
                    this.TxtId_Cte.Text  = fac.Id_Cte.ToString();
                    this.Txt_Nombre.Text = fac.Cte_Nombre;
                    this.TxtTotal.Text   = fac.Total.ToString("C2");
                    this.TxtPagado.Text  = fac.Pagado.ToString("C2");
                    this.TxtSaldo.Text   = fac.Saldo.ToString("C2");
                    if (fac.FacL_Legal == 1)
                    {
                        this.ChkLegal.Checked = true;
                    }
                    else
                    {
                        this.ChkLegal.Checked = false;
                    }
                    this.TxtFacL_Comentarios.Text = fac.FacL_Comentarios;
                }
                else
                {
                    Alerta("No se enconto la factura, por favor verifique la información");
                    this.TxtId_Cd.Enabled  = true;
                    this.TxtId_Fac.Enabled = true;
                    this.CmbId_Cd.Enabled  = true;
                    this.RblTipo.Enabled   = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }