Пример #1
0
        public IActionResult EditJudgeLoadActivityIndex(JudgeLoadActivityIndex model)
        {
            SetViewbagJudgeLoadActivityIndex(model.JudgeLoadActivityId);
            if (!ModelState.IsValid)
            {
                return(View(nameof(EditJudgeLoadActivityIndex), model));
            }

            string _isvalid = IsValidJudgeLoadActivityIndex(model);

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

            var currentId = model.Id;

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