public static DataTable decriptTable(DataTable t, EntEncript e) { string codigo = string.Empty; int i = 0; try { foreach (DataRow r in t.Rows) { i = 0; foreach (int c in e.Campos) { if (i == 0) { codigo = r[c].ToString(); } else { r[c] = decriptD(codigo, r[c].ToString()); } i++; } } } catch (Exception ex) { throw ex; } return(t); }
public static DataTable encriptTable(DataTable t, EntEncript e) { string codigo = string.Empty; int i = 0; int j = 0; try { foreach (DataRow r in t.Rows) { i = 0; j++; if (j == 296) { j = 296; } foreach (int c in e.Campos) { if (i == 0) { codigo = r[c].ToString(); } else { if (r[c].ToString() != string.Empty) { r[c] = encriptD(codigo, r[c].ToString()); } } i++; } } } catch (Exception ex) { throw ex; } return(t); }