public DataSet GetAll(string empresaid, tb_co_tributoafectocompras BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbCoTributoafectocompras_SEARCH", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@destinoid", SqlDbType.Char, 1).Value = BE.destinoid;
                 cmd.Parameters.Add("@destinoname", SqlDbType.VarChar, 100).Value = BE.destinoname;
                 cmd.Parameters.Add("@destinoafecto", SqlDbType.Bit).Value = BE.destinoafecto;
                 cmd.Parameters.Add("@destinoafecto1", SqlDbType.Bit).Value = BE.destinoafecto1;
                 cmd.Parameters.Add("@destinodaot", SqlDbType.Bit).Value = BE.destinodaot;
             }
             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_co_tributoafectocompras BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbCoTributoafectocompras_DELETE", cnx))
         {
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@destinoid", SqlDbType.Char, 1).Value = BE.destinoid;
             }
             try
             {
                 cnx.Open();
                 if (cmd.ExecuteNonQuery() > 0)
                 {
                     return true;
                 }
                 else
                 {
                     return false;
                 }
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
        private void POnerDatos()
        {
            SortOrder sorted = default(SortOrder);
            string xnomcolumna = "";

            //DataTable Tipoigv = new DataTable();

            tb_co_tributoafectocomprasBL BL = new tb_co_tributoafectocomprasBL();
            tb_co_tributoafectocompras BE = new tb_co_tributoafectocompras();

            DataTable Tipoigv = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
            DataRowCollection rows = Tipoigv.Rows;
            //PCGCURSOR = oCapa.CaeSoft_GetAllTipoDestino(GlobalVars.GetInstance.CompanyGeneral, "");
            dgAyuda.AutoGenerateColumns = false;
            dgAyuda.DataSource = Tipoigv;
            if (xnomcolumna.Trim().Length > 0)
            {
                if (sorted == SortOrder.Ascending)
                {
                    dgAyuda.Sort(dgAyuda.Columns[xnomcolumna], System.ComponentModel.ListSortDirection.Ascending);
                }
                else
                {
                    dgAyuda.Sort(dgAyuda.Columns[xnomcolumna], System.ComponentModel.ListSortDirection.Descending);
                }
            }
            else
            {
                dgAyuda.Sort(dgAyuda.Columns["destinoid"], System.ComponentModel.ListSortDirection.Ascending);
            }
        }
 public bool Update(string empresaid, tb_co_tributoafectocompras BE)
 {
     return tablaDA.Update(empresaid, BE);
 }
 public bool Insert(string empresaid, tb_co_tributoafectocompras BE)
 {
     return tablaDA.Insert(empresaid, BE);
 }
 public DataSet GetAll(string empresaid, tb_co_tributoafectocompras BE)
 {
     return tablaDA.GetAll(empresaid, BE);
 }