Example #1
0
        public List <clsGestionVM> GestionList()
        {
            clsGestion          oGestion   = new clsGestion(clsAppInfo.Connection);
            List <clsGestionVM> oGestionVM = new List <clsGestionVM>();



            try
            {
                oGestion.SelectFilter  = clsGestion.SelectFilters.Grid;
                oGestion.WhereFilter   = clsGestion.WhereFilters.Grid;
                oGestion.OrderByFilter = clsGestion.OrderByFilters.Grid;

                if (oGestion.Open())
                {
                    foreach (DataRow dr in oGestion.DataSet.Tables[oGestion.TableName].Rows)
                    {
                        oGestionVM.Add(new clsGestionVM()
                        {
                            GestionId     = SysData.ToLong(dr[clsGestionVM._GestionId]),
                            GestionNro    = SysData.ToInteger(dr[clsGestionVM._GestionNro]),
                            GestionFecIni = SysData.ToDate(dr[clsGestionVM._GestionFecIni]),
                            GestionFecFin = SysData.ToDate(dr[clsGestionVM._GestionFecFin]),
                            EstadoDes     = SysData.ToStr(dr[clsGestionVM._EstadoDes])
                        });
                    }
                }

                return(oGestionVM);
            }
            catch (Exception exp)
            {
                throw exp;
            }
            finally
            {
                oGestion.Dispose();
            }
            return(oGestionVM);
        }
Example #2
0
        public static List <clsGestionVM> GestionList()
        {
            clsGestion          oGestion   = new clsGestion(clsAppInfo.Connection);
            List <clsGestionVM> oGestionVM = new List <clsGestionVM>();



            try
            {
                DateTime date = DateTime.Today;
                oGestion.SelectFilter = clsGestion.SelectFilters.Grid;
                oGestion.WhereFilter  = clsGestion.WhereFilters.Grid;


                if (oGestion.Open())
                {
                    foreach (DataRow dr in oGestion.DataSet.Tables[oGestion.TableName].Rows)
                    {
                        oGestionVM.Add(new clsGestionVM()
                        {
                            GestionId     = SysData.ToLong(dr["GestionId"]),
                            GestionNro    = SysData.ToInteger(dr["GestionNro"]),
                            GestionFecIni = SysData.ToDate(dr["GestionFecIni"]),
                            GestionFecFin = SysData.ToDate(dr["GestionFecFin"])
                        });
                    }
                }

                return(oGestionVM);
            }
            catch (Exception exp)
            {
                throw exp;
            }
            finally
            {
                oGestion.Dispose();
            }
            return(oGestionVM);
        }