﻿$(function(){
    (function($) {
        $.fn.actionForm = function(option)
        {
            this.find('input').bind('focus',function(){$(this).addClass('input_text_focus')}).bind('blur',function(){$(this).removeClass('input_text_focus');});
        }
    })(jQuery);
});

$(function(){
    (function($) {
        $.fn.actionMessage = function(xmlDoc)
        {
            if(xmlDoc)
            {
                var result = xmlDoc.documentElement.getAttribute('result');
                var text = xmlDoc.documentElement.getAttribute('text');
                var appText = '';
                if(result=='False'||!result||result=='0')
                {
                    this.find('.msg_error').show();
                    appText = '失败！';
                }
                else if(parseInt(result)>0)
                {
                    appText = '成功<br/>共<strong style="color:#c00">'+result+'</strong>条数据受影响！';
                    this.find('.msg_succeed').show();
                }
                else
                {
                    appText = '成功！';
                    this.find('.msg_succeed').show();
                }
                this.find('.text').html('执行<strong style="color:#c00">'+text+'</strong>操作'+appText);
                this.dialogOpen();
            }
            else
            {
                this.find('.msg_error').show();
                this.find('.text').html('执行程序没有返回XML数据！');
                this.dialogOpen();
            }
        }
    })(jQuery);
});