Пример #1
0
        public static List<Afiliado> List(FiltroAfiliado f, out int RecordCount)
        {
            List<Afiliado> resultList = new List<Afiliado>();

            try
            {
                AfiliadoDS dataservice = new AfiliadoDS();
                DataSet ds = dataservice.List(f, out RecordCount);

                if(ds.Tables.Count>0)
                {
                    foreach (DataRow r in ds.Tables[0].Rows)
                    {
                        Afiliado a = new Afiliado();
                        ORM(a, r);
                        resultList.Add(a);
                    }
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }

            return resultList;
        }
Пример #2
0
        public static Afiliado GetAfiliadoByPoliza(string poliza)
        {
            Afiliado result = null;
            int RecordCount;
            try
            {
                FiltroAfiliado f = new FiltroAfiliado();
                f.Poliza = poliza;

                AfiliadoDS dataservice = new AfiliadoDS();
                DataSet ds = dataservice.List(f, out RecordCount);

                if(ds.Tables.Count>0 && ds.Tables[0].Rows.Count>0)
                {
                    result = new Afiliado();
                    ORM(result, ds.Tables[0].Rows[0]);

                }

            }
            catch (Exception ex)
            {
                throw ex;
            }

            return result;
        }