Esempio n. 1
0
        public static List<PrestadorModelView> ListPrestadores(int idPais, int idProvincia, string ciudad, string nombre)
        {
            List<PrestadorModelView> resultList = new List<PrestadorModelView>();

            FiltroPrestador filtro = new FiltroPrestador();
            filtro.IdPais = idPais;
            filtro.IdProvincia = idProvincia;
            filtro.Localidad = ciudad.Trim();
            filtro.Nombre = nombre.Trim();

            List<Entities.InterAsisst.Prestador> lPrestadores = Entities.InterAsisst.Prestador.List(filtro);
            foreach (Entities.InterAsisst.Prestador p in lPrestadores)
            {
                PrestadorModelView pw = new PrestadorModelView();
                pw.Id = p.ID;
                pw.Localidad = p.LocalidadNombre;
                pw.Nombre = p.Nombre;
                pw.Pais = p.NombrePais;
                pw.Provincia = p.ProvinciaNombre;
                pw.Telefono1 = p.Telefono1;
                resultList.Add(pw);

            }

            return resultList;
        }
Esempio n. 2
0
        public void CargarListado(FiltroPrestador filtro, int pageNumber)
        {
            int totalRegistros;

            filtro.PageSize = PAGE_SIZE;
            filtro.IsPaged = true;
            filtro.StartRow = ((pageNumber - 1) * PAGE_SIZE) + 1;

            List<Entities.InterAsisst.Prestador> listaAfiliados = Entities.InterAsisst.Prestador.List((FiltroPrestador)filtro, out totalRegistros);

            this.Filtro.FiltredRowsQtty = totalRegistros;

            this.ShowList(totalRegistros > 0);
            this.lbltxtCantidadRegistros.Text = totalRegistros.ToString();

            this.dtgPrestador.CurrentPageIndex = pageNumber - 1;
            this.dtgPrestador.VirtualItemCount = totalRegistros;
            this.dtgPrestador.DataSource = listaAfiliados;
            this.dtgPrestador.DataBind();
        }
Esempio n. 3
0
        protected void IniciarBusqueda_DirectClick(object sender, EN.DirectEventArgs e)
        {
            string value = string.Empty;

            var valPais = this.cmbPaisFiltroPrestador.Value;
            var valProvincia = this.cmbProvinciaFiltroPrestador.Value;
            var valLocalidad = this.cmbUbicacionFiltroPrestador.Value;
            var varNombre = this.txtNombreFiltroPrestador.Text;

            Utils.InterAssist.FiltroPrestador f = new Utils.InterAssist.FiltroPrestador();

            if (valPais != null)
                f.IdPais = Int32.Parse(valPais.ToString());

            if (valProvincia != null)
                f.IdProvincia = Int32.Parse(valProvincia.ToString());

            if (valLocalidad != null)
                f.IdCiudad = Int32.Parse(valLocalidad.ToString());

            if (varNombre.Trim() != string.Empty)
                f.Nombre = varNombre.ToString();

            BuscarPrestador(f);
        }
Esempio n. 4
0
        protected void BusquedaSimplificada_DirectClick(object sender, EN.DirectEventArgs e)
        {
            string value = txtBusquedaSimple.Text.Trim();

            Utils.InterAssist.FiltroPrestador f = new Utils.InterAssist.FiltroPrestador();
            f.Search = value;

            BuscarPrestador(f);
        }
Esempio n. 5
0
        public static List<Prestador> List(FiltroPrestador filtro, out int RecordCount)
        {
            List<Prestador> prestadorList = new List<Prestador>();

            try
            {

                PrestadorDS dataService = new PrestadorDS();
                DataSet ds = dataService.List(filtro, out  RecordCount);

                if (ds.Tables.Count>0)
                {
                    foreach (DataRow r in ds.Tables[0].Rows)
                    {
                        Prestador p = new Prestador();

                        ORM(p, r);
                        prestadorList.Add(p);
                    }
                }

            }catch(Exception ex)
            {
                throw ex;
            }

            return prestadorList;
        }
Esempio n. 6
0
 public static List<Prestador> List(FiltroPrestador filtro)
 {
     int RecordCount;
     return List(filtro, out RecordCount);
 }
Esempio n. 7
0
        public static Prestador GetById_ReadOnly(int id)
        {
            Prestador result = null;

            FiltroPrestador f = new FiltroPrestador();
            f.ID = id;

            List<Prestador> listado = List(f);

            if(listado.Count>0)
            {
                result = listado[0];
            }

            return result;
        }
Esempio n. 8
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";

            int start = 0;
            int limit = 10;
            string sort = string.Empty;
            string dir = string.Empty;
            string query = string.Empty;

            if (!string.IsNullOrEmpty(context.Request["start"]))
            {
                start = int.Parse(context.Request["start"]);
            }

            if (!string.IsNullOrEmpty(context.Request["limit"]))
            {
                limit = int.Parse(context.Request["limit"]);
            }

            if (!string.IsNullOrEmpty(context.Request["sort"]))
            {
                sort = context.Request["sort"];
            }

            if (!string.IsNullOrEmpty(context.Request["dir"]))
            {
                dir = context.Request["dir"];
            }

            if (!string.IsNullOrEmpty(context.Request["query"]))
            {
                query = context.Request["query"];
            }

            List<Modelviews.PrestadorModelView> listPrestadores = new List<Modelviews.PrestadorModelView>();

            /*
            listPrestadores.Add(new Modelviews.PrestadorModelView() { Id=111, Nombre = "Andes Remolque", Localidad = "Mendoza", Pais ="Argentina" });
            listPrestadores.Add(new Modelviews.PrestadorModelView() { Id=112, Nombre = "Belen Remolque", Localidad = "Rosario", Pais = "Argentina" });
            listPrestadores.Add(new Modelviews.PrestadorModelView() { Id=113, Nombre = "Caja Remolque", Localidad = "Buenos Aires", Pais = "Argentina" });
            listPrestadores.Add(new Modelviews.PrestadorModelView() { Id=115, Nombre = "Mecánica Remolque", Localidad = "Nequen", Pais = "Argentina" });
             */

            FiltroPrestador f = new FiltroPrestador();
            f.Nombre = query;
            f.OrderBY = " order by Nombre ";
            List<Prestador> prestadores = Prestador.List(f);

            foreach(Prestador p in prestadores)
            {
                Modelviews.PrestadorModelView pmv = new Modelviews.PrestadorModelView();
                pmv.Id = p.ID;
                pmv.Nombre = p.Nombre;
                pmv.Pais = p.NombrePais;
                pmv.Provincia = p.ProvinciaNombre;
                pmv.Ciudad = p.NombreCiudad;
                pmv.Localidad = p.LocalidadNombre;
                listPrestadores.Add(pmv);
            }

            context.Response.Write(string.Format("{{total:{1},'Prestadores':{0}}}", JSON.Serialize(listPrestadores), listPrestadores.Count));
        }