示例#1
0
 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;
     }
 }
示例#2
0
 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;
     }
 }
示例#3
0
 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;
     }
 }
示例#4
0
 public VigilanteMng()
 {
     this._oVigilante = new Vigilante();
     this._lst        = new List <Vigilante>();
 }