Beispiel #1
0
        public async Task <PartialViewResult> CreateOrEditModal(int id)
        {
            if (id != 0)
            {
                var output = await _mpKeyWordReplyAppService.Get(new EntityDto <int>(id));

                var viewModel = new CreateOrEditMpKeyWordReplyViewModel(output);
                return(PartialView("_CreateOrEditModal", viewModel));
            }
            else
            {
                var mpID = await _userMpAppService.GetDefaultMpId();

                var model = new CreateOrEditMpKeyWordReplyViewModel()
                {
                    MpID = mpID
                };
                return(PartialView("_CreateOrEditModal", model));
            }
        }
Beispiel #2
0
        // GET: /<controller>/
        public async Task <IActionResult> Index(int?ParentId)
        {
            var viewModel = new MpSecondKeyWordReplyViewModel();

            if (ParentId.HasValue)
            {
                var keyword = await _mpKeyWordReplyAppService.Get(new EntityDto <int>() { Id = ParentId.Value });

                if (keyword != null)
                {
                    viewModel.ParentId = ParentId;
                    viewModel.KeyWord  = keyword.KeyWord;
                }
            }
            viewModel.MpID = await _userMpAppService.GetDefaultMpId();

            return(View(viewModel));
        }