Ejemplo n.º 1
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (NombreProveedor != null)
                {
                    hashCode = hashCode * 59 + NombreProveedor.GetHashCode();
                }
                if (Identificacion != null)
                {
                    hashCode = hashCode * 59 + Identificacion.GetHashCode();
                }
                if (TipoConvenio != null)
                {
                    hashCode = hashCode * 59 + TipoConvenio.GetHashCode();
                }
                if (FechaVigencia != null)
                {
                    hashCode = hashCode * 59 + FechaVigencia.GetHashCode();
                }
                if (Correo != null)
                {
                    hashCode = hashCode * 59 + Correo.GetHashCode();
                }

                /*if (Pais != null)
                 * hashCode = hashCode * 59 + Pais.GetHashCode();*/
                if (Ciudad != null)
                {
                    hashCode = hashCode * 59 + Ciudad.GetHashCode();
                }
                if (Endpoint != null)
                {
                    hashCode = hashCode * 59 + Endpoint.GetHashCode();
                }
                if (TemplateEntrada != null)
                {
                    hashCode = hashCode * 59 + TemplateEntrada.GetHashCode();
                }
                if (TemplateSalida != null)
                {
                    hashCode = hashCode * 59 + TemplateSalida.GetHashCode();
                }
                if (EstadoConvenio != null)
                {
                    hashCode = hashCode * 59 + EstadoConvenio.GetHashCode();
                }
                return(hashCode);
            }
        }
        private void FrmVisorReporteDocumentos_Load(object sender, EventArgs e)
        {
            SqlConnection ocon = new SqlConnection("Data Source=ana-alex-brian.database.windows.net;Initial Catalog=Cuentas_por_pagar;Persist Security Info=True;User ID=propietaria;Password=#Seguridad1");

            ocon.Open();
            string sSQL = "select * from Reporte_Documentos where 1 = 1";

            if (NombreProveedor.Trim().Length > 0)
            {
                sSQL += " and Nombre_Proveedor LIKE '%" + NombreProveedor + "%'";
            }

            if (ConceptoPago.Trim().Length > 0)
            {
                sSQL += " and  Concepto_Pago = '" + ConceptoPago + "'";
            }

            if (Estado.Trim().Length > 0)
            {
                sSQL += " and Estado = '" + Estado + "'";
            }

            if (NumFacturaDesde.Trim().Length > 0 && NumFacturaHasta.Trim().Length > 0)
            {
                sSQL += " and Numero_Factura between '" + NumFacturaDesde + "' and '" + NumFacturaHasta + "'";
            }
            else if (NumFacturaDesde.Trim().Length > 0)
            {
                sSQL += " and Numero_Factura > '" + NumFacturaDesde + "'";
            }
            else if (NumFacturaHasta.Trim().Length > 0)
            {
                sSQL += " and Numero_Factura < '" + NumFacturaHasta + "'";
            }

            if (FechaDocumentoDesde.Trim().Length > 0 && FechaDocumentoHasta.Trim().Length > 0)
            {
                sSQL += " and Fecha_Documento between '" + FechaDocumentoDesde + "' and '" + FechaDocumentoHasta + "'";
            }
            else if (FechaDocumentoDesde.Trim().Length > 0)
            {
                sSQL += " and Fecha_Documento > '" + FechaDocumentoDesde + "'";
            }
            else if (FechaDocumentoHasta.Trim().Length > 0)
            {
                sSQL += " and Fecha_Documento < '" + FechaDocumentoHasta + "'";
            }

            if (FechaRegistroDesde.Trim().Length > 0 && FechaRegistroHasta.Trim().Length > 0)
            {
                sSQL += " and Fecha_Registro between '" + FechaRegistroDesde + "' and '" + FechaRegistroHasta + "'";
            }
            else if (FechaRegistroDesde.Trim().Length > 0)
            {
                sSQL += " and Fecha_Registro > '" + FechaRegistroDesde + "'";
            }
            else if (FechaRegistroHasta.Trim().Length > 0)
            {
                sSQL += " and Fecha_Registro < '" + FechaRegistroHasta + "'";
            }

            if (MontoDesde > 0 && MontoHasta > 0)
            {
                sSQL += " and Monto between " + MontoDesde + " and " + MontoHasta;
            }
            else if (MontoDesde > 0)
            {
                sSQL += " and Monto > " + MontoDesde;
            }
            else if (MontoHasta > 0)
            {
                sSQL += " and Monto < " + MontoHasta;
            }

            DataTable      odt = new DataTable();
            SqlDataAdapter oda = new SqlDataAdapter(sSQL, ocon);

            oda.Fill(odt);

            ReportDataSource rds = new ReportDataSource();

            rds.Value = odt;
            rds.Name  = "DataSetDocumentos";
            rpvDocumentos.LocalReport.DataSources.Clear();
            rpvDocumentos.LocalReport.DataSources.Add(rds);
            rpvDocumentos.LocalReport.ReportEmbeddedResource = "ReporteDocumentos.rdlc";
            rpvDocumentos.LocalReport.ReportPath             = @"../../ReporteDocumentos.rdlc";
            rpvDocumentos.RefreshReport();
            // TODO: This line of code loads data into the 'DataSetDocumentos.Reporte_Documentos' table. You can move, or remove it, as needed.
            //this.Reporte_DocumentosTableAdapter.Fill(this.DataSetDocumentos.Reporte_Documentos);

            //this.rpvDocumentos.RefreshReport();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns true if Convenio instances are equal
        /// </summary>
        /// <param name="other">Instance of Convenio to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Convenio other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     NombreProveedor == other.NombreProveedor ||
                     NombreProveedor != null &&
                     NombreProveedor.Equals(other.NombreProveedor)
                     ) &&
                 (
                     Identificacion == other.Identificacion ||
                     Identificacion != null &&
                     Identificacion.Equals(other.Identificacion)
                 ) &&
                 (
                     TipoConvenio == other.TipoConvenio ||
                     TipoConvenio != null &&
                     TipoConvenio.Equals(other.TipoConvenio)
                 ) &&
                 (
                     FechaVigencia == other.FechaVigencia ||
                     FechaVigencia != null &&
                     FechaVigencia.Equals(other.FechaVigencia)
                 ) &&
                 (
                     Correo == other.Correo ||
                     Correo != null &&
                     Correo.Equals(other.Correo)
                 ) /*&&
                    * (
                    * Pais == other.Pais ||
                    * Pais != null &&
                    * Pais.Equals(other.Pais)
                    * ) */&&
                 (
                     Ciudad == other.Ciudad ||
                     Ciudad != null &&
                     Ciudad.Equals(other.Ciudad)
                 ) &&
                 (
                     Endpoint == other.Endpoint ||
                     Endpoint != null &&
                     Endpoint.Equals(other.Endpoint)
                 ) &&
                 (
                     TemplateEntrada == other.TemplateEntrada ||
                     TemplateEntrada != null &&
                     TemplateEntrada.Equals(other.TemplateEntrada)
                 ) &&
                 (
                     TemplateSalida == other.TemplateSalida ||
                     TemplateSalida != null &&
                     TemplateSalida.Equals(other.TemplateSalida)
                 ) &&
                 (
                     EstadoConvenio == other.EstadoConvenio ||
                     EstadoConvenio != null &&
                     EstadoConvenio.Equals(other.EstadoConvenio)
                 ));
        }