Пример #1
0
        /// <summary>
        /// Добавяне на ПОС устройства
        /// </summary>
        /// <returns></returns>
        public IActionResult AddPosDevice()
        {
            SetBreadcrumsPosDevice(0);
            SetViewBagPosDevice();
            var model = new CourtPosDevice()
            {
                CourtId  = userContext.CourtId,
                IsActive = true
            };

            return(View(nameof(EditPosDevice), model));
        }
Пример #2
0
        public IActionResult EditPosDevice(CourtPosDevice model)
        {
            SetViewBagPosDevice();
            if (!ModelState.IsValid)
            {
                SetBreadcrumsPosDevice(model.Id);
                return(View(nameof(EditPosDevice), model));
            }
            var currentId = model.Id;

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