Ejemplo n.º 1
0
/*		public bool Consultar()
 *              {
 *                      DsClientesEventuales ds = this.GetClientesEventualesDataSet();
 *                      if (ds == null)
 *                              return false;
 *
 *                      DsClientesEventuales.DatosRow dr = ds.Datos.FindByClienteEventualID(this.ClienteEventualID);
 *                      if (dr == null)
 *                              return false;
 *
 *                      this.NroDocumento = dr.NroDocumento;
 *                      this.Nombre =  dr.IsNombreNull() ? "" : dr.Nombre;
 *                      this.Apellido =dr.IsApellidoNull()?"": dr.Apellido;
 *                      this.TipoDocumento= dr.IsTipoDocumentoIDNull()? 0:(SisPack.TipoDocumento)dr.TipoDocumentoID;
 *                      this.Domicilio.DomicilioID= dr.IsDomicilioIDNull()? 0 : dr.DomicilioID;
 *                      this.NroCuit = dr.IsNroCUITNull() ? "" : dr.NroCUIT;
 *                      this.CondicionIva=dr.IsCondicionIvaIDNull() ? 0 :(SisPack.CondicionIva) dr.CondicionIvaID;
 *                      ((Domicilio)this.Domicilio).Consultar();
 *
 *
 *                      return true;
 *              }*/

        public bool ConsultarByDocumento()
        {
            DsClientesEventuales ds             = new DsClientesEventuales();
            SqlParameter         pTipoDocumento = new SqlParameter("@TipoDocumentoID", this.TipoDocumento);
            SqlParameter         pNroDocumento  = new SqlParameter("@NroDocumento", this.NroDocumento);

            Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "ClienteEventualONE", pTipoDocumento, pNroDocumento);
            if (ds.Datos.Rows.Count > 0)
            {
                DsClientesEventuales.DatosRow dr = (DsClientesEventuales.DatosRow)ds.Datos.Rows[0];
                //obtengo los datos
                this.Apellido              = dr.Apellido;
                this.Baja                  = dr.Baja;
                this.ClienteEventualID     = dr.ClienteEventualID;
                this.CondicionIva          = (SisPack.CondicionIva)dr.CondicionIvaID;
                this.Domicilio.DomicilioID = dr.DomicilioID;
                this.FechaAlta             = dr.FechaAlta;
                this.Nombre                = dr.Nombre;
                //this.NroCuit = dr.NroCUIT;
                this.NroDocumento  = dr.NroDocumento;
                this.TipoDocumento = (SisPack.TipoDocumento)dr.TipoDocumentoID;
                //this.TipoDocumentoCuit = dr.TipoDocumentoCUIT;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        public bool Consultar()
        {
            DsClientesEventuales ds = new DsClientesEventuales();

            SqlParameter pClienteEventualID = new SqlParameter("@ClienteEventualID", this.ClienteEventualID);

            Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "ClienteEventualByID", pClienteEventualID);
            // si el dataset tiene datos...
            if (ds.Datos.Rows.Count > 0)
            {
                DsClientesEventuales.DatosRow dr = (DsClientesEventuales.DatosRow)ds.Datos.Rows[0];

                this.NroDocumento          = dr.NroDocumento;
                this.Nombre                = dr.IsNombreNull() ? "" : dr.Nombre;
                this.Apellido              = dr.IsApellidoNull()?"": dr.Apellido;
                this.TipoDocumento         = dr.IsTipoDocumentoIDNull()? 0:(SisPack.TipoDocumento)dr.TipoDocumentoID;
                this.Domicilio.DomicilioID = dr.IsDomicilioIDNull()? 0 : dr.DomicilioID;
                this.NroCuit               = dr.IsNroCUITNull() ? "" : dr.NroCUIT;
                this.CondicionIva          = dr.IsCondicionIvaIDNull() ? 0 :(SisPack.CondicionIva)dr.CondicionIvaID;
                ((Domicilio)this.Domicilio).Consultar();
            }

            return(true);
        }