Esempio n. 1
0
        public PartialViewResult Edit(TagPrimaryKey tagPrimaryKey)
        {
            var tag       = tagPrimaryKey.EntityObject;
            var viewModel = new EditViewModel(tag);

            return(ViewEdit(viewModel));
        }
Esempio n. 2
0
        public ActionResult Edit(TagPrimaryKey tagPrimaryKey, EditViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(ViewEdit(viewModel));
            }
            var tag = tagPrimaryKey.EntityObject;

            viewModel.UpdateModel(tag, CurrentFirmaSession);
            return(new ModalDialogFormJsonResult(SitkaRoute <TagController> .BuildUrlFromExpression(x => x.Detail(tag.TagName))));
        }
Esempio n. 3
0
        public ActionResult New(EditViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(ViewEdit(viewModel));
            }
            var tag = new Tag(string.Empty);

            viewModel.UpdateModel(tag, CurrentFirmaSession);
            HttpRequestStorage.DatabaseEntities.AllTags.Add(tag);
            HttpRequestStorage.DatabaseEntities.SaveChanges();
            SetMessageForDisplay($"Tag {tag.GetDisplayNameAsUrl()} successfully created.");
            return(new ModalDialogFormJsonResult());
        }
Esempio n. 4
0
        public PartialViewResult New()
        {
            var viewModel = new EditViewModel();

            return(ViewEdit(viewModel));
        }
Esempio n. 5
0
        private PartialViewResult ViewEdit(EditViewModel viewModel)
        {
            var viewData = new EditViewData();

            return(RazorPartialView <Edit, EditViewData, EditViewModel>(viewData, viewModel));
        }