public DataSet GetAll(string empresaid, tb_comprobante BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbComprobante_SEARCH", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@comprobanteid", SqlDbType.Char, 2).Value = BE.comprobanteid;
                 cmd.Parameters.Add("@comprobantename", SqlDbType.VarChar, 50).Value = BE.comprobantename;
                 cmd.Parameters.Add("@comprobanteabrev", SqlDbType.Char, 3).Value = BE.comprobanteabrev;
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
 public bool Delete(string empresaid, tb_comprobante BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbComprobante_DELETE", cnx))
         {
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@comprobanteid", SqlDbType.Char, 2).Value = BE.comprobanteid;
             }
             try
             {
                 cnx.Open();
                 if (cmd.ExecuteNonQuery() > 0)
                 {
                     return true;
                 }
                 else
                 {
                     return false;
                 }
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
 public bool Update(string empresaid, tb_comprobante BE)
 {
     return tablaDA.Update(empresaid, BE);
 }
 public bool Insert(string empresaid, tb_comprobante BE)
 {
     return tablaDA.Insert(empresaid, BE);
 }
 public DataSet GetAll(string empresaid, tb_comprobante BE)
 {
     return tablaDA.GetAll(empresaid, BE);
 }
 public bool Delete(string empresaid, tb_comprobante BE)
 {
     return tablaDA.Delete(empresaid, BE);
 }
        public bool Insert(string empresaid, tb_comprobante BE)
        {
            using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
            {
                using (SqlCommand cmd = new SqlCommand("gspTbComprobante_INSERT", cnx))
                {

                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add("@comprobanteid", SqlDbType.Char, 2).Value = BE.comprobanteid;
                    cmd.Parameters.Add("@comprobantename", SqlDbType.VarChar, 50).Value = BE.comprobantename;
                    cmd.Parameters.Add("@comprobanteabrev", SqlDbType.Char, 3).Value = BE.comprobanteabrev;
                    cmd.Parameters.Add("@usuar", SqlDbType.Char, 15).Value = BE.usuar;

                    try
                    {
                        cnx.Open();
                        if (cmd.ExecuteNonQuery() > 0)
                        {
                            return true;
                        }
                        else
                        {
                            return false;
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                }
            }
        }