Esempio n. 1
0
        public ActionResult ListarBandeja(string codigo, string nombre)
        {
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            try
            {
                if (!string.IsNullOrEmpty(codigo))
                {
                    parameters.Add("codigo", codigo);
                }

                if (!string.IsNullOrEmpty(nombre))
                {
                    parameters.Add("nombre", nombre);
                }

                List <TipoProveedorDTO> tipoProveedorDTOList = tipoProveedorService.SearchFor(parameters, string.Empty);
                int index    = 1;
                var jsonData = new
                {
                    total   = 1,
                    page    = 1,
                    records = tipoProveedorDTOList.Count,
                    rows    = from f in tipoProveedorDTOList.AsEnumerable()
                              select new
                    {
                        id   = index++,
                        cell = new
                        {
                            TipoProveedorId = f.TipoProveedorId,
                            Codigo          = f.Codigo,
                            Nombre          = f.Nombre
                        }
                    }
                };

                return(Json(jsonData));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        private void PopulateDropList()
        {
            Dictionary <string, object> parameters        = new Dictionary <string, object>();
            List <TipoProveedorDTO>     tipoProveedorList = _tipoProveedorService.SearchFor(parameters, string.Empty);

            ViewBag.TipoProvList = WebHelper.ToSelectListItem <TipoProveedorDTO>(
                tipoProveedorList, x => x.TipoProveedorId.ToString(), x => x.Nombre, SelectListFirstElementType.Select, string.Empty);


            List <DocumentoIdentidadDTO> docIdentidadDTOList = _docIdentidadService.SearchFor(parameters, string.Empty)
                                                               .Cast <DocumentoIdentidadDTO>().ToList();

            ViewBag.ListaDocIdenti = WebHelper.ToSelectListItem <DocumentoIdentidadDTO>(docIdentidadDTOList,
                                                                                        x => x.DocumentoIdentidadId.ToString(), x => x.Nombre, SelectListFirstElementType.Select, string.Empty);

            List <PaisDTO> paisDTOList = _paisService.SearchFor(parameters, string.Empty);

            ViewBag.PaisList = WebHelper.ToSelectListItem <PaisDTO>(
                paisDTOList, x => x.PaisId.ToString(), x => x.Nombre, SelectListFirstElementType.Select, string.Empty);

            List <FormaVentaDTO> formaVentaDTOList = _formaVentaService.SearchFor(parameters, string.Empty);

            ViewBag.FormaVentaList = WebHelper.ToSelectListItem <FormaVentaDTO>(
                formaVentaDTOList, x => x.FormaVentaId.ToString(), x => x.Nombre, SelectListFirstElementType.Select, string.Empty);


            List <PersonalDTO> personalDTOList = _personalService.SearchFor(parameters, string.Empty);

            ViewBag.ListarPersonal = WebHelper.ToSelectListItem <PersonalDTO>(
                personalDTOList, x => x.PersonalId.ToString(), x => string.Concat(x.Nombres, " ", x.Apellidos), SelectListFirstElementType.Select, string.Empty);

            List <MonedaDTO> monedaDTOList = _monedaService.SearchFor(parameters, string.Empty);

            ViewBag.MonedaList = WebHelper.ToSelectListItem <MonedaDTO>(
                monedaDTOList, x => x.MonedaId.ToString(), x => x.Nombre, SelectListFirstElementType.Select, string.Empty);


            List <TipoPrecioDTO> tipoPrecioDTOList = _tipoPrecioService.SearchFor(parameters, string.Empty);

            ViewBag.TipoPrecioList = WebHelper.ToSelectListItem <TipoPrecioDTO>(
                tipoPrecioDTOList, x => x.TipoPrecioId.ToString(), x => x.Nombre, SelectListFirstElementType.Select, string.Empty);
        }