// GET: Almacen/Create public ActionResult Create(string editAction, string sucursalId) { SucursalDTO sucursalDTO = new SucursalDTO(); try { ViewBag.IsNew = true; switch (editAction) { case EditActionConstant.NEW: ListarUbigeo(); ViewBag.Title = "Nuevo Sucursal"; sucursalDTO.EditAction = editAction; break; case EditActionConstant.EDIT: ViewBag.IsNew = false; ViewBag.Title = "Editar Sucursal"; sucursalDTO = sucursalService.GetById(Convert.ToInt32(sucursalId)); sucursalDTO.EditAction = editAction; ListarUbigeo(sucursalDTO.DistritoDTO.ProvinciaDTO.DepartamentoDTO.PaisId); break; } Dictionary <string, object> parameters = new Dictionary <string, object>(); List <EmpresaDTO> empresaDTOList = empresaService.SearchFor(parameters, string.Empty).Cast <EmpresaDTO>().ToList(); ViewBag.ListEmpresa = WebHelper.ToSelectListItem <EmpresaDTO>(empresaDTOList, x => x.EmpresaId.ToString(), x => x.Nombre, SelectListFirstElementType.Select, string.Empty); } catch (Exception ex) { throw ex; } return(PartialView(sucursalDTO)); }