Example #1
0
        public IActionResult Edit(CounterEditVM model)
        {
            SetViewbag();
            if (!ModelState.IsValid)
            {
                SetBreadcrums(model.Id);
                return(View(nameof(Edit), model));
            }
            var currentId = model.Id;

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