Example #1
0
        public async Task <ActionResult> EditValue(GameFieldDropdownValueEditViewModel viewModel)
        {
            try
            {
                var field = await ProjectRepository.GetProjectField(viewModel.ProjectId, viewModel.ProjectFieldId);

                await FieldSetupService.UpdateFieldValueVariant(new UpdateFieldValueVariantRequest(
                                                                    viewModel.ProjectId,
                                                                    viewModel.ProjectFieldDropdownValueId,
                                                                    viewModel.Label,
                                                                    viewModel.Description,
                                                                    viewModel.ProjectFieldId,
                                                                    viewModel.MasterDescription,
                                                                    viewModel.ProgrammaticValue,
                                                                    viewModel.Price,
                                                                    viewModel.PlayerSelectable,
                                                                    viewModel.GetTimeSlotRequest(field, Request.Form["TimeSlotStartTime"][0])
                                                                    ));

                return(RedirectToAction("Edit", new { viewModel.ProjectId, projectFieldId = viewModel.ProjectFieldId }));
            }
            catch
            {
                return(View(viewModel));
            }
        }
        public async Task <ActionResult> EditValue(GameFieldDropdownValueEditViewModel viewModel)
        {
            try
            {
                await FieldSetupService.UpdateFieldValueVariant(new UpdateFieldValueVariantRequest(
                                                                    viewModel.ProjectId,
                                                                    viewModel.ProjectFieldDropdownValueId,
                                                                    viewModel.Label,
                                                                    viewModel.Description,
                                                                    viewModel.ProjectFieldId,
                                                                    viewModel.MasterDescription,
                                                                    viewModel.ProgrammaticValue,
                                                                    viewModel.Price,
                                                                    viewModel.PlayerSelectable));

                return(RedirectToAction("Edit", new { viewModel.ProjectId, projectFieldId = viewModel.ProjectFieldId }));
            }
            catch
            {
                return(View(viewModel));
            }
        }