public override void fillLst(IDbTransaction trans = null) { try { this.comm = GenericDataAccess.CreateCommandSP("sp_Folio"); addParameters(0); if (trans == null) { this.dt = GenericDataAccess.ExecuteSelectCommand(comm); } else { this.dt = GenericDataAccess.ExecuteSelectCommand(comm, trans); } this._lst = new List <Folio>(); foreach (DataRow dr in dt.Rows) { Folio o = new Folio(); BindByDataRow(dr, o); this._lst.Add(o); } } catch { throw; } }
protected void BindByDataRow(DataRow dr, Folio o) { try { int.TryParse(dr["id"].ToString(), out entero); o.Id = entero; entero = 0; o.Tipo = dr["tipo"].ToString(); if (dr["anio_actual"] != DBNull.Value) { int.TryParse(dr["anio_actual"].ToString(), out entero); o.Anio_actual = entero; entero = 0; } if (dr["actual"] != DBNull.Value) { int.TryParse(dr["actual"].ToString(), out entero); o.Actual = entero; entero = 0; } if (dr["digitos"] != DBNull.Value) { int.TryParse(dr["digitos"].ToString(), out entero); o.Digitos = entero; entero = 0; } if (dr["folio_inicial"] != DBNull.Value) { int.TryParse(dr["folio_inicial"].ToString(), out entero); o.Folio_inicial = entero; entero = 0; } //if (dr["IsActive"] != DBNull.Value) //{ // bool.TryParse(dr["IsActive"].ToString(), out logica); // o.IsActive = logica; // logica = false; //} } catch { throw; } }
public FolioMng() { this._oFolio = new Folio(); this._lst = new List <Folio>(); }