예제 #1
0
        public async Task <IActionResult> SaveOrganizer(LookupItemDto dto)
        {
            ResponseDto response = new ResponseDto();

            try
            {
                if (ModelState.IsValid)
                {
                    response = await lookupItemService.SaveAsync(dto);

                    if (response.StatusCode == Core.Enums.StatusCode.OK)
                    {
                        TempData["Success"] = Resource_Core.SaveOrganizerSucceeded;
                        return(RedirectToAction("OrganizersList", "Lookup"));
                    }
                    else
                    {
                        TempData["Error"] = Resource_Core.InternalErrorWhileLoading;
                    }
                }
            }
            catch (Exception ex)
            {
                commonFunctions.LogError(ex, dto);
                response.StatusCode = Core.Enums.StatusCode.InternalError;
                TempData["Error"]   = Resource_Core.InternalErrorWhileLoading;
            }

            ViewBag.Platforms = await lookupItemService.GetAllAsync((int)LookupItemCategories.Platforms);

            return(View("Organizer", dto));
        }
예제 #2
0
        public async Task <IActionResult> Organizer(int?id)
        {
            LookupItemDto dto = new LookupItemDto();

            if (id.HasValue && id > 0)
            {
                dto = await lookupItemService.GetAsync(id.GetValueOrDefault());
            }

            ViewBag.Platforms = await lookupItemService.GetAllAsync((int)LookupItemCategories.Platforms);

            return(View(dto));
        }