Beispiel #1
0
        public CatTipoDocumentoModels DEL_DocumentoXID(CatTipoDocumentoModels Documento)
        {
            try
            {
                object[] parametros =
                {
                    Documento.IDTipoDocumento, Documento.Usuario
                };

                SqlDataReader dr = null;
                dr = SqlHelper.ExecuteReader(Documento.Conexion, "spCSLDB_CatDocumento_del_DocumentoXID", parametros);
                Documento.RespuestaAjax = new RespuestaAjax();

                while (dr.Read())
                {
                    Documento.RespuestaAjax.Success = !dr.IsDBNull(dr.GetOrdinal("Success")) ? dr.GetBoolean(dr.GetOrdinal("Success")) : false;
                    Documento.RespuestaAjax.Mensaje = !dr.IsDBNull(dr.GetOrdinal("Mensaje")) ? dr.GetString(dr.GetOrdinal("Mensaje")) : string.Empty;
                }

                dr.Close();
                return(Documento);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        public CatTipoDocumentoModels GET_DocumentoXID(CatTipoDocumentoModels Documento)
        {
            try
            {
                object[] parametros =
                {
                    Documento.IDTipoDocumento
                };

                SqlDataReader dr = null;
                dr = SqlHelper.ExecuteReader(Documento.Conexion, "spCSLDB_CatDocumento_get_DocumentoXID", parametros);
                Documento.RespuestaAjax = new RespuestaAjax();

                while (dr.Read())
                {
                    Documento.RespuestaAjax.Success = !dr.IsDBNull(dr.GetOrdinal("success")) ? dr.GetBoolean(dr.GetOrdinal("success")) : false;
                    if (Documento.RespuestaAjax.Success)
                    {
                        Documento.IDTipoDocumento = !dr.IsDBNull(dr.GetOrdinal("id_tipoDocumento")) ? dr.GetInt16(dr.GetOrdinal("id_tipoDocumento")) : 0;
                        Documento.Descripcion     = !dr.IsDBNull(dr.GetOrdinal("descripcion")) ? dr.GetString(dr.GetOrdinal("descripcion")) : string.Empty;
                    }
                    else
                    {
                        Documento.RespuestaAjax.Mensaje = !dr.IsDBNull(dr.GetOrdinal("mensaje")) ? dr.GetString(dr.GetOrdinal("mensaje")) : string.Empty;
                    }
                }

                dr.Close();
                return(Documento);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #3
0
 public string DatatableIndex(CatTipoDocumentoModels Documento)
 {
     try
     {
         SqlDataReader dr = null;
         dr = SqlHelper.ExecuteReader(Documento.Conexion, "spCSLDB_CatTipoDocumento_get_Index");
         string datatable = Auxiliar.SqlReaderToJson(dr);
         dr.Close();
         return(datatable);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #4
0
 public List <CatTipoDocumentoModels> ObtenerConceptosDocumento(string Conexion)
 {
     try
     {
         List <CatTipoDocumentoModels> Lista = new List <CatTipoDocumentoModels>();
         CatTipoDocumentoModels        Item;
         SqlDataReader Dr = SqlHelper.ExecuteReader(Conexion, "spCSLDB_Combo_get_ConceptosDocPagar");
         while (Dr.Read())
         {
             Item = new CatTipoDocumentoModels();
             Item.IDTipoDocumento = !Dr.IsDBNull(Dr.GetOrdinal("IdConcepto")) ? Dr.GetInt32(Dr.GetOrdinal("IdConcepto")) : 0;
             Item.Descripcion     = !Dr.IsDBNull(Dr.GetOrdinal("Descripcion")) ? Dr.GetString(Dr.GetOrdinal("Descripcion")) : string.Empty;
             Lista.Add(Item);
         }
         Dr.Close();
         return(Lista);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }