1

我想在 jtabele 标准事件中显示错误(例如 alert()),但我不知道我必须做什么。代码工作正常。最重要的地方是 if(UpdateOrNot==1){}

public void OnUpdated(DictionaryListModel dictionaryListModel)
        {
            var listModel = (DictionarySkillListModel)dictionaryListModel;
            if (dictionaryListModel == null)
                throw new Exception("Niepoprawny model");

            int UpdateOrNot=0;
            try
            {
            if (listModel.IsActiveYN == false)
            {
                var list =
                    _skillService.CheckSkillProcedur(listModel.Id, listModel.Description).ToList();
                foreach (var procSkillValue in list)
                {
                    UpdateOrNot = procSkillValue.ExistOrNotExist;
                }
                if(UpdateOrNot==1)
                {
                  //here I would like to past my alert
                }
                else
                {
                    var skill = _skillService.Get(listModel.Id);
                    skill.Name = listModel.Description;
                    skill.IsActive = listModel.IsActiveYN;
                    _skillService.Update(skill);
                }   
            }
            }
            catch (Exception ex)
            {}

        }
4

1 回答 1

1

try and catch 有问题。固定的

于 2012-11-05T12:07:56.930 回答