protected void BindByDataRow(DataRow dr, Entrada_compartida o) { try { int.TryParse(dr["id"].ToString(), out entero); o.Id = entero; entero = 0; if (dr["id_entrada"] != DBNull.Value) { int.TryParse(dr["id_entrada"].ToString(), out entero); o.Id_entrada = entero; entero = 0; } else { o.Id_entrada = null; } if (dr["id_usuario"] != DBNull.Value) { int.TryParse(dr["id_usuario"].ToString(), out entero); o.Id_usuario = entero; entero = 0; } o.Folio = dr["folio"].ToString(); o.Referencia = dr["referencia"].ToString(); if (dr["capturada"] != DBNull.Value) { bool.TryParse(dr["capturada"].ToString(), out logica); o.Capturada = logica; logica = false; } 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_Entrada_compartida"); addParameters(0); this.dt = GenericDataAccess.ExecuteSelectCommand(comm); this._lst = new List <Entrada_compartida>(); foreach (DataRow dr in dt.Rows) { Entrada_compartida o = new Entrada_compartida(); BindByDataRow(dr, o); this._lst.Add(o); } } catch { throw; } }
public Entrada_compartidaMng() { this._oEntrada_compartida = new Entrada_compartida(); this._lst = new List <Entrada_compartida>(); }