protected void BindByDataRow(DataRow dr, Vigilante o) { try { int.TryParse(dr["id"].ToString(), out entero); o.Id = entero; entero = 0; if (dr["id_bodega"] != DBNull.Value) { int.TryParse(dr["id_bodega"].ToString(), out entero); o.Id_bodega = entero; entero = 0; } o.Nombre = dr["nombre"].ToString(); if (dr["IsActive"] != DBNull.Value) { bool.TryParse(dr["IsActive"].ToString(), out logica); o.IsActive = logica; logica = false; } } catch { throw; } }
public override void fillLst() { try { this.comm = GenericDataAccess.CreateCommandSP("sp_Vigilante"); addParameters(0); this.dt = GenericDataAccess.ExecuteSelectCommand(comm); this._lst = new List <Vigilante>(); foreach (DataRow dr in dt.Rows) { Vigilante o = new Vigilante(); BindByDataRow(dr, o); this._lst.Add(o); } } catch { throw; } }
public void fillLstByBodega(bool evenInactive = false) { try { this.comm = GenericDataAccess.CreateCommandSP("sp_Vigilante"); addParameters(evenInactive ? 6 : 5); this.dt = GenericDataAccess.ExecuteSelectCommand(comm); this._lst = new List <Vigilante>(); foreach (DataRow dr in dt.Rows) { Vigilante o = new Vigilante(); BindByDataRow(dr, o); this._lst.Add(o); } } catch { throw; } }
public VigilanteMng() { this._oVigilante = new Vigilante(); this._lst = new List <Vigilante>(); }