private void ListDropList()
        {
            Dictionary <string, object> parameters      = new Dictionary <string, object>();
            List <SucursalDTO>          sucursalDTOList = _sucursalService.SearchFor(parameters, string.Empty).Cast <SucursalDTO>().ToList();

            ViewBag.SucursalList = WebHelper.ToSelectListItem <SucursalDTO>(sucursalDTOList,
                                                                            x => x.SucursalId.ToString(), x => x.Nombre, SelectListFirstElementType.Select, string.Empty);
        }
Exemple #2
0
        public ActionResult ListarBandeja(string codigo, string nombre, string empresa)
        {
            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);
                }

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

                List <SucursalDTO> empresaDTOList = sucursalService.SearchFor(parameters, string.Empty).Cast <SucursalDTO>().ToList();
                int index    = 1;
                var jsonData = new
                {
                    total   = 1,
                    page    = 1,
                    records = empresaDTOList.Count,
                    rows    = from f in empresaDTOList.AsEnumerable()
                              select new
                    {
                        id   = index++,
                        cell = new
                        {
                            SucursalId = f.SucursalId,
                            Empresa    = f.EmpresaDTO.Nombre,
                            Nombre     = f.Nombre,
                            Telefono   = f.Telefono,
                            Direccion  = f.Direccion,
                            Capacidad  = f.Capacidad,
                        }
                    }
                };

                return(Json(jsonData));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void periodoEmpresa()
        {
            Dictionary <string, object> parameters     = new Dictionary <string, object>();
            List <PeriodoDTO>           periodoDTOList = periodoService.SearchFor(parameters, string.Empty);

            ViewBag.ListarPeriodo = WebHelper
                                    .ToSelectListItem <PeriodoDTO>(periodoDTOList, x => x.PeriodoId.ToString(), x => x.PeriodoEjucion.ToString(),
                                                                   SelectListFirstElementType.Select, string.Empty);


            List <SucursalDTO> sucursalDTOList = sucursalService.SearchFor(parameters, string.Empty);

            ViewBag.SucursalList = WebHelper.ToSelectListItem <SucursalDTO>(sucursalDTOList, x => x.SucursalId.ToString(), x => x.Nombre.ToString(),
                                                                            SelectListFirstElementType.Select, string.Empty);
        }
Exemple #4
0
        public JsonResult ListarSucursal(string empresaId)
        {
            Dictionary <string, object> parameters        = new Dictionary <string, object>();
            JsonResultMessage           jsonResultMessage = new JsonResultMessage();

            try
            {
                parameters.Add("empresaId", empresaId);
                List <SucursalDTO> sucursalDTOList = sucursalService.SearchFor(parameters, string.Empty);
                jsonResultMessage.data = WebHelper.ToSelectListItem <SucursalDTO>(
                    sucursalDTOList, x => x.SucursalId.ToString(), x => x.Nombre, SelectListFirstElementType.Select, string.Empty);

                return(Json(jsonResultMessage, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }