2 using System.Collections.Generic;
14 internal class GestorCarpetas
18 internal List<CarpetaItem> _Carpetas
20 get {
return _lisCarpetas; }
21 set { _lisCarpetas = value; }
23 List<CarpetaItem> _lisCarpetas =
new List<CarpetaItem>();
25 private GestorCarpetas() { }
44 string lcSql =
"SELECT ID, IDGESTDOC, NOMBRE, PARENT, VISIBLE FROM " +
45 DB.SQLDatabase(
"RGPD",
"CARPETAS") +
46 " WHERE VISIBLE = 1 " +
49 DataTable ldtCarpetas =
new DataTable();
50 if (DB.SQLExec(lcSql, ref ldtCarpetas) && ldtCarpetas.Rows.Count > 0)
52 ldtCarpetas.AsEnumerable().Cast<DataRow>().ToList()
53 .ForEach(loRow => _lisCarpetas.Add(
new CarpetaItem(loRow)));
61 public bool _GarantizarCarpetasRgpd()
64 CarpetaItem loRaiz = _lisCarpetas.Where(loCarpeta => loCarpeta._IsRoot() ==
true).FirstOrDefault();
67 loRaiz._CreateOrUpdateIdGestDoc(_oModulo);
68 var restoCarpetas = _lisCarpetas.Where(loCarpeta => loCarpeta._IsRoot() ==
false).ToList();
71 restoCarpetas.ForEach(loCarpeta => loCarpeta._ParentGestDoc = loRaiz._IdGestdoc);
74 var carpetasOrdenadas = restoCarpetas.OrderByDescending(loEle => loEle._IdRgpd).ToList();
77 carpetasOrdenadas.ForEach(loCarpeta => loCarpeta._CreateOrUpdateIdGestDoc(_oModulo));
88 public Dictionary<int, int> _ToDictionary()
90 Dictionary<int, int> dicCarpetas =
new Dictionary<int, int>();
91 _Carpetas.ForEach(loCarpeta => dicCarpetas.Add(loCarpeta._IdRgpd, loCarpeta._IdGestdoc));
99 internal class CarpetaItem
108 get {
return _nIdRgpd; }
109 set { _nIdRgpd = value; }
111 private int _nIdRgpd = -1;
116 public int _IdGestdoc
118 get {
return _nIdGestdoc; }
119 set { _nIdGestdoc = value; }
121 private int _nIdGestdoc = -1;
126 public string _Nombre
128 get {
return _cNombre; }
129 set { _cNombre = value; }
131 private string _cNombre =
"";
138 get {
return _nParent; }
139 set { _nParent = value; }
141 private int _nParent = -1;
146 public int _ParentGestDoc
148 get {
return _nParentGestDoc; }
149 set { _nParentGestDoc = value; }
151 private int _nParentGestDoc = -1;
158 get {
return _lVisible; }
159 set { _lVisible = value; }
161 private bool _lVisible =
false;
163 #endregion Propiedades 165 #region Constructores 170 public CarpetaItem() { }
176 public CarpetaItem(DataRow tdRow)
178 _nIdRgpd = Convert.ToInt32(tdRow[
"ID"]);
179 _cNombre = Convert.ToString(tdRow[
"NOMBRE"]).TrimEnd();
180 _nIdGestdoc = Convert.ToInt32(tdRow[
"IDGESTDOC"]);
181 _nParent = Convert.ToInt32(tdRow[
"PARENT"]);
182 _lVisible = Convert.ToBoolean(tdRow[
"VISIBLE"]);
188 #endregion Constructores 194 public bool _IsRoot()
196 return _nParent == 0;
205 string lcNombreOriginal = _cNombre;
206 int lnIdGestDocOriginal = _nIdGestdoc;
208 if (lnIdGestDocOriginal != _nIdGestdoc || lcNombreOriginal != _cNombre)
216 private bool _Update()
218 return DB.SQLExec(
"UPDATE " + DB.SQLDatabase(
"RGPD",
"CARPETAS") +
219 " SET NOMBRE = " + DB.SQLString(_cNombre) +
", IDGESTDOC = " + _nIdGestdoc +
" " +
220 " WHERE ID = " + _nIdRgpd);
Es como el tipo de entrada asientos pero por negocio, sin formulario, pq quiero que me haga las propu...
void RgpdGarantizarDirectorio(ref string tnNombre, ref int tnIdCarperta, int tnParentId=0)
RgpdGarantizarDirectorio
Interficie de operaciones requeridas por el Addon de RGPD al Addon de GESTDOC