public DataSet GetAll(tb_empresaperiodo BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.AdmConexion()))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbempresaperiodo_SEARCH", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@empresaid", SqlDbType.Char, 2).Value = BE.empresaid;
                 cmd.Parameters.Add("@periodo", SqlDbType.Char, 4).Value = BE.periodo;
                 cmd.Parameters.Add("@actual", SqlDbType.Bit).Value = BE.actual;
             }
             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(tb_empresaperiodo BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.AdmConexion()))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbempresaperiodo_DELETE", cnx))
         {
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@empresaid", SqlDbType.Char, 2).Value = BE.empresaid;
                 cmd.Parameters.Add("@periodo", SqlDbType.Char, 4).Value = BE.periodo;
             }
             try
             {
                 cnx.Open();
                 if (cmd.ExecuteNonQuery() > 0)
                 {
                     return true;
                 }
                 else
                 {
                     return false;
                 }
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }