Beispiel #1
0
        public IActionResult Edit(CaseSessionFastDocument model)
        {
            SetViewbag(model.CaseSessionId);
            if (!ModelState.IsValid)
            {
                return(View(nameof(Edit), model));
            }

            string _isvalid = IsValid(model);

            if (_isvalid != string.Empty)
            {
                SetErrorMessage(_isvalid);
                return(View(nameof(Edit), model));
            }

            var currentId = model.Id;

            if (service.CaseSessionFastDocument_SaveData(model))
            {
                SetAuditContext(service, SourceTypeSelectVM.CaseSessionFastDocument, model.Id, currentId == 0);
                this.SaveLogOperation(currentId == 0, model.Id);
                SetSuccessMessage(MessageConstant.Values.SaveOK);
                return(RedirectToAction(nameof(Edit), new { id = model.Id }));
            }
            else
            {
                SetErrorMessage(MessageConstant.Values.SaveFailed);
            }
            return(View(nameof(Edit), model));
        }