Exemple #1
0
        public ActionResult Create(int id = 0)
        {
            var model = new GetNoticeForEditOutput();

            if (id > 0)
            {
                model = noticeservice.GetNoticeForEdit(new NullableIdDto <long> {
                    Id = id
                });
            }
            return(View(model.Notice));
        }
Exemple #2
0
        public async Task <PartialViewResult> CreateOrEditModal(int?id)
        {
            var output = _noticeAppService.GetNoticeForEdit(new NullableIdDto {
                Id = id
            });

            if (!id.HasValue)
            {
                output.PublicDate = DateTime.Now;
                output.Prior      = 0;
                output.Author     = "管理员";
            }
            var viewModel = new NoticeEditViewModel(output);

            return(PartialView("_CreateOrEditModal", viewModel));
        }