function jsDataResolution()
{

}
/*通过数据对象设置控件值*/
jsDataResolution.SetControlDataByDataObj = function(Container, DataObj) {
    try {
        var dateArray = [];
        var ItemGroup = Container.getElementsByTagName("INPUT");
        for (var i = 0; i < ItemGroup.length; i++) {
            if (ItemGroup[i].type == "hidden") {
                if (ItemGroup[i].Field != null) {
                    ItemGroup[i].value = unescape(DataObj.Fields(ItemGroup[i].Field).value);
                }
                else {
                    ItemGroup[i].value = "";
                }
            }
            else if (ItemGroup[i].parentElement.parentElement.parentElement.parentElement.className == "tbTime") {
                var fieldValue = DataObj.Fields(ItemGroup[i].Field).value;
                if (fieldValue != null && fieldValue != "") {
                    var j = 0;
                    var parentTb = ItemGroup[i].parentElement.parentElement.parentElement.parentElement;
                    do {
                        if (dateArray[j] == parentTb.id) {
                            break;
                        }
                        if (j == dateArray.length) {
                            dateArray.push(parentTb.id);
                            var dateContorl = parentTb.getElementsByTagName("INPUT");
                            var dataStr = fieldValue.split("|");
                            for (var k = 0; k < dateContorl.length; k++) {
                                if (dataStr[k] != null) {
                                    dateContorl[k].value = dataStr[k];
                                } else {
                                    dateContorl[k].value = "";
                                }
                            }
                        }
                        j++;
                    } while (j < dateArray.length);
                }
                dateArray = null;
                dateArray = [];
            }
            else if (ItemGroup[i].type == "text") {
                if (ItemGroup[i].Field != null) {
                    if (ItemGroup[i]._type != undefined && ItemGroup[i]._type == 'dropdown') {
                        $(ItemGroup[i]).DataValue(unescape(DataObj.Fields(ItemGroup[i].Field).value));
                    }
                    else {
                        ItemGroup[i].value = unescape(DataObj.Fields(ItemGroup[i].Field).value);
                    }
                }
                else {
                    ItemGroup[i].value = "";
                }
            }
            else if (ItemGroup[i].parentElement.className == "Wdate") {
                alert(1);
            }
            else if (ItemGroup[i].Field != null && ItemGroup[i].type == "checkbox") {
                if (ItemGroup[i].Field != null && ItemGroup[i].Field == 'true') {
                    ItemGroup[i].checked = true;
                }
                else {
                    ItemGroup[i].checked = false;
                }
            }
        }
        ItemGroup = Container.getElementsByTagName("TEXTAREA");
        for (var i = 0; i < ItemGroup.length; i++) {
            if (ItemGroup[i].Field != null) {
                $("'#" + ItemGroup[i].id + "'").value(DataObj.Fields(ItemGroup[i].Field).value != null ? unescape(DataObj.Fields(ItemGroup[i].Field).value) : "");
            }
            else {
                $("'#" + ItemGroup[i].id + "'").value = "";
            }
        }
        ItemGroup = Container.getElementsByTagName("SELECT");
        for (var i = 0; i < ItemGroup.length; i++) {
            var fieldValue = DataObj.Fields(ItemGroup[i].Field).value;
            if (ItemGroup[i].Field != undefined) {
                if (ItemGroup[i].parentNode.format == undefined) {
                    ItemGroup[i].value = DataObj.Fields(ItemGroup[i].Field).value;
                } else {
                    //                    for (var j = 0; j < dateArray.length; j++) {
                    var j = 0;
                    do {
                        if (dateArray[j] == ItemGroup[i].parentNode.id) {
                            break;
                        }
                        if (j == dateArray.length) {
                            dateArray.push(ItemGroup[i].parentNode.id);
                            var dateType = ItemGroup[i].parentNode.datetype;
                            var dateDiv = ItemGroup[i].parentNode;
                            switch (dateType) {
                                case "yyyy-MM":
                                case "MM-dd":
                                    {
                                        if (fieldValue != null) {
                                            var strArray = fieldValue.split("-");
                                            for (var j = 0; j < dateDiv.children.length; j++) {
                                                dateDiv.children[j].value = strArray[j];
                                            }
                                        }
                                    } break;
                                case "hh:mm":
                                case "hh:mm:ss":
                                    {
                                        if (fieldValue != null) {
                                            var strArray = fieldValue.split(":");
                                            for (var j = 0; j < dateDiv.children.length; j++) {
                                                dateDiv.children[j].value = strArray[j];
                                            }
                                        }
                                    } break;
                                case "dd hh:mm:ss":
                                    {
                                        fieldValue = fieldValue.replace(/' '/g, ":");
                                        var strArray = fieldValue.split(":");
                                        for (var j = 0; j < dateDiv.children.length; j++) {
                                            dateDiv.children[j].value = strArray[j];
                                        }
                                    } break;
                            }
                        }
                        j++;
                    } while (j < dateArray.length);
                }
            }
        }
        ItemGroup = Container.getElementsByTagName("SPAN");
        for (var i = 0; i < ItemGroup.length; i++) {
            if (ItemGroup[i].Field != null) {
                ItemGroup[i].innerText = unescape(DataObj.Fields(ItemGroup[i].Field).value);
            }
            else {
                ItemGroup[i].innerText = "";
            }
        }
//        ItemGroup = $(".div-form-editor");
//        for (var i = 0; i < ItemGroup.length; i++) {
//            var texteareDom = ItemGroup[0].children[1].children[0];
//            if (texteareDom.Field != null) {
//                $(texteareDom).value(unescape(DataObj.Fields(texteareDom.Field).value));
//            } else {
//                $(texteareDom).value("");
//            }
//        }
        ItemGroup = null;
    }
    catch (e) {
        alert(e.message);
    }
    CollectGarbage();
};
/*通过数据对象设置控件值*/
jsDataResolution.SetControlDataByEntity = function(Container, _entity) {
    try {
        var dateArray = [];
        var ItemGroup = Container.getElementsByTagName("INPUT");
        for (var i = 0; i < ItemGroup.length; i++) {
            if (ItemGroup[i].Field != null && ItemGroup[i].type == "hidden") {
                eval("if(_entity.Fields." + ItemGroup[i].Field + "!=null){ItemGroup[i].value=unescape(_entity.Fields." + ItemGroup[i].Field + ")}else{ItemGroup[i].value='';};");
            }
            else if (ItemGroup[i].parentElement.parentElement.parentElement.parentElement.className == "tbTime") {
                var fieldValue = _entity.Fields[ItemGroup[i].Field];
                if (fieldValue != null && fieldValue != "") {
                    var j = 0;
                    var parentTb = ItemGroup[i].parentElement.parentElement.parentElement.parentElement;
                    do {
                        if (dateArray[j] == parentTb.id) {
                            break;
                        }
                        if (j == dateArray.length) {
                            dateArray.push(parentTb.id);
                            var dateContorl = parentTb.getElementsByTagName("INPUT");
                            var dataStr = fieldValue.split("|");
                            for (var k = 0; k < dateContorl.length; k++) {
                                if (dataStr[k] != null) {
                                    dateContorl[k].value = dataStr[k];
                                } else {
                                    dateContorl[k].value = "";
                                }
                            }
                        }
                        j++;
                    } while (j < dateArray.length);
                }
                dateArray = null;
                dateArray = [];
            }
            else if (ItemGroup[i].Field != null && ItemGroup[i].type == "text") {
                if (ItemGroup[i]._type != undefined && ItemGroup[i]._type == 'dropdown') {
                    eval("if(_entity.Fields." + ItemGroup[i].Field + "!=null){$(" + ItemGroup[i].id + ").DataValue(unescape(_entity.Fields." + ItemGroup[i].Field + "))}else{$(" + ItemGroup[i].id + ").DataValue('');};");
                }
                else {
                    eval("if(_entity.Fields." + ItemGroup[i].Field + "!=null){ItemGroup[i].value=unescape(_entity.Fields." + ItemGroup[i].Field + ")}else{ItemGroup[i].value='';};");
                }
            }
            else if (ItemGroup[i].Field != null && ItemGroup[i].type == "checkbox") {
                eval("if(_entity.Fields." + ItemGroup[i].Field + "!=null && _entity.Fields." + ItemGroup[i].Field + "=='true'){ItemGroup[i].checked=true;}else{ItemGroup[i].checked=false;};");
            }
            else if (ItemGroup[i].Field != null && ItemGroup[i].type == "radio") {
                eval("if(_entity.Fields." + ItemGroup[i].Field + "!=null && _entity.Fields." + ItemGroup[i].Field + "==ItemGroup[i].value){ItemGroup[i].checked=true;}else{ItemGroup[i].checked=false;};");
            }
            else if (ItemGroup[i].parentElement.className == "Wdate") {
                alert(1);
            }
        }
        ItemGroup = Container.getElementsByTagName("TEXTAREA");
        for (var i = 0; i < ItemGroup.length; i++) {
            if (ItemGroup[i].Field != null) {
                if (ItemGroup[i].parentElement.parentElement != null && ItemGroup[i].parentElement.parentElement.className == "div-form-editor") {
                    eval("if(_entity.Fields." + ItemGroup[i].Field + "!=null){$('#" + ItemGroup[i].id + "').value(unescape(_entity.Fields." + ItemGroup[i].Field + "));}else{$('#" + ItemGroup[i].id + "').value('');};");
                    var strEvalCommand = "if(ItemGroup[i].Field!=null){_entity.Fields." + ColumnName + "='" + escape($(ItemGroup[i]).value()) + "';}else{}";
                } else {
                    eval("if(_entity.Fields." + ItemGroup[i].Field + "!=null){ItemGroup[i].value=unescape(_entity.Fields." + ItemGroup[i].Field + ");}else{ItemGroup[i].value='';};");
                }
            }
        }
        ItemGroup = Container.getElementsByTagName("SELECT");
        for (var i = 0; i < ItemGroup.length; i++) {
            if (_entity.Fields[ItemGroup[i].Field] != null) {
                var fieldValue = _entity.Fields[ItemGroup[i].Field];
                if (ItemGroup[i].parentNode.format == undefined) {
                    eval("ItemGroup[i].value=_entity.Fields." + ItemGroup[i].Field + ";}else{ItemGroup[i].value='';");
                    fieldValue = null;
                } else {
                    var j = 0;
                    do {
                        if (dateArray[j] == ItemGroup[i].parentNode.id) {
                            break;
                        }
                        if (j == dateArray.length) {
                            dateArray.push(ItemGroup[i].parentNode.id);
                            var dateType = ItemGroup[i].parentNode.childNodes[0].datetype;
                            var dateDiv = ItemGroup[i].parentNode.childNodes[0];
                            switch (dateType) {
                                case "yyyy-MM":
                                case "MM-dd":
                                    {
                                        if (fieldValue != null) {
                                            var strArray = fieldValue.split("-");
                                            for (var j = 0; j < dateDiv.children.length; j++) {
                                                dateDiv.children[j].value = strArray[j];
                                            }
                                        }
                                    } break;
                                case "hh:mm":
                                case "hh:mm:ss":
                                    {
                                        if (fieldValue != null) {
                                            var strArray = fieldValue.split(":");
                                            for (var j = 0; j < dateDiv.children.length; j++) {
                                                dateDiv.children[j].value = strArray[j];
                                            }
                                        }
                                    } break;
                                case "dd hh:mm:ss":
                                    {
                                        fieldValue = fieldValue.replace(/' '/g, ":");
                                        var strArray = fieldValue.split(":");
                                        for (var j = 0; j < dateDiv.children.length; j++) {
                                            dateDiv.children[j].value = strArray[j];
                                        }
                                    } break;
                            }
                        }
                        j++;
                    } while (j < dateArray.length);
                }
            }
        }
        dateArray = null;
        ItemGroup = Container.getElementsByTagName("SPAN");
        for (var i = 0; i < ItemGroup.length; i++) {
            if (ItemGroup[i].Field != null) {
                eval("if(_entity.Fields." + ItemGroup[i].Field + "!=null){ItemGroup[i].innerText=unescape(_entity.Fields." + ItemGroup[i].Field + ")}else{ItemGroup[i].innerText='';};");
            }
        }
        //        ItemGroup = $(".div-form-editor");
        //        for (var i = 0; i < ItemGroup.length; i++) {
        //            var texteareDom = ItemGroup[i].children[1].children[0];
        //            eval("if(_entity.Fields." + texteareDom.Field + "!=null){$(texteareDom).value(_entity.Fields." + texteareDom.Field + ");}else{$(texteareDom)..value('');};");
        //        }
        ItemGroup = null;
    }
    catch (e) {
        alert(e.message);
    }
    CollectGarbage();
};
/*通过json对象设置控件值*/
jsDataResolution.SetControlDataByJsonData = function(Container, JsonData, curID) {
    //    try
    //    {
    var dateArray = [];
    var ItemGroup = Container.getElementsByTagName("INPUT");
    for (var i = 0; i < ItemGroup.length; i++) {
        if (ItemGroup[i].Field != null && ItemGroup[i].type == "hidden") {
            var fieldValue = DBReader.getFieldValueFromJsonData(JsonData, ItemGroup[i].Field, curID);
            eval("if(fieldValue!=null){ItemGroup[i].value=unescape(fieldValue)}else{ItemGroup[i].value='';};");
            fieldValue = null;
        }
        else if (ItemGroup[i].parentElement.parentElement.parentElement.parentElement.className == "tbTime") {
            var fieldValue = DBReader.getFieldValueFromJsonData(JsonData, ItemGroup[i].Field, curID);
            if (fieldValue != null && fieldValue != "") {
                var j = 0;
                var parentTb = ItemGroup[i].parentElement.parentElement.parentElement.parentElement;
                do {
                    if (dateArray[j] == parentTb.id) {
                        break;
                    }
                    if (j == dateArray.length) {
                        dateArray.push(parentTb.id);
                        var dateContorl = parentTb.getElementsByTagName("INPUT");
                        var dataStr = fieldValue.split("|");
                        for (var k = 0; k < dateContorl.length; k++) {
                            if (dataStr[k] != null) {
                                dateContorl[k].value = dataStr[k];
                            } else {
                                dateContorl[k].value = "";
                            }
                        }
                    }
                    j++;
                } while (j < dateArray.length);
            }
        }
        else if (ItemGroup[i].Field != null && ItemGroup[i].type == "text") {
            var fieldValue = DBReader.getFieldValueFromJsonData(JsonData, ItemGroup[i].Field, curID);
            if (ItemGroup[i]._type != undefined && ItemGroup[i]._type == 'dropdown') {
                eval("if(fieldValue!=null){$(" + ItemGroup[i].id + ").DataValue(unescape(fieldValue))}else{$(" + ItemGroup[i].id + ").DataValue('');};");
            }
            else {
                eval("if(fieldValue!=null){ItemGroup[i].value=unescape(fieldValue)}else{ItemGroup[i].value='';};");
            }
            fieldValue = null;
        }
        else if (ItemGroup[i].Field != null && ItemGroup[i].type == "checkbox") {
            var fieldValue = DBReader.getFieldValueFromJsonData(JsonData, ItemGroup[i].Field, curID);
            eval("if(fieldValue!=null && fieldValue=='true'){ItemGroup[i].checked=true;}else{ItemGroup[i].checked=false;};");
            fieldValue = null;
        }
        else if (ItemGroup[i].Field != null && ItemGroup[i].type == "radio") {
            var fieldValue = DBReader.getFieldValueFromJsonData(JsonData, ItemGroup[i].Field, curID);
            eval("if(fieldValue!=null && fieldValue==ItemGroup[i].value){ItemGroup[i].checked=true;}else{ItemGroup[i].checked=false;};");
            fieldValue = null;
        }
    }
    dateArray = null;
    dateArray = [];
    ItemGroup = Container.getElementsByTagName("TEXTAREA");
    for (var i = 0; i < ItemGroup.length; i++) {
        if (ItemGroup[i].Field != null) {
            var fieldValue = DBReader.getFieldValueFromJsonData(JsonData, ItemGroup[i].Field, curID);
            if (ItemGroup[i].parentElement.parentElement != null && ItemGroup[i].parentElement.parentElement.className == "div-form-editor") {
                eval("if(fieldValue!=null){$('#" + ItemGroup[i].id + "').value(unescape(fieldValue));}else{$('#" + ItemGroup[i].id + "').value('');};");
            } else {
                //            eval("if(fieldValue!=null){$('#" + ItemGroup[i].id + "').val(unescape(fieldValue));}else{$('#" + ItemGroup[i].id + "').val('');};");
                if (fieldValue != null) {
                    ItemGroup[i].value = unescape(fieldValue);
                }
                else { ItemGroup[i].value = ""; };
            }
            fieldValue = null;
        }
    }
    ItemGroup = Container.getElementsByTagName("SELECT");
    for (var i = 0; i < ItemGroup.length; i++) {
        var fieldValue = DBReader.getFieldValueFromJsonData(JsonData, ItemGroup[i].Field, curID);
        if (ItemGroup[i].parentNode.format == undefined) {
            eval("if(fieldValue!=null){ItemGroup[i].value=fieldValue;}else{ItemGroup[i].value='';};");
            fieldValue = null;
        } else {
            var j = 0;
            do {
                if (dateArray[j] == ItemGroup[i].parentNode.id) {
                    break;
                }
                if (j == dateArray.length) {
                    dateArray.push(ItemGroup[i].parentNode.id);
                    var dateType = ItemGroup[i].parentNode.datetype;
                    var dateDiv = ItemGroup[i].parentNode;
                    switch (dateType) {
                        case "yyyy-MM":
                        case "MM-dd":
                            {
                                if (fieldValue != null) {
                                    var strArray = fieldValue.split("-");
                                    for (var j = 0; j < dateDiv.children.length; j++) {
                                        dateDiv.children[j].value = strArray[j];
                                    }
                                }
                            } break;
                        case "hh:mm":
                        case "hh:mm:ss":
                            {
                                if (fieldValue != null) {
                                    var strArray = fieldValue.split(":");
                                    for (var j = 0; j < dateDiv.children.length; j++) {
                                        dateDiv.children[j].value = strArray[j];
                                    }
                                }
                            } break;
                        case "dd hh:mm:ss":
                            {
                                fieldValue = fieldValue.replace(/' '/g, ":");
                                var strArray = fieldValue.split(":");
                                for (var j = 0; j < dateDiv.children.length; j++) {
                                    dateDiv.children[j].value = strArray[j];
                                }
                            } break;
                    }
                }
                j++;
            } while (j < dateArray.length);
        }
    }
    dateArray = null;
    ItemGroup = Container.getElementsByTagName("SPAN");
    for (var i = 0; i < ItemGroup.length; i++) {
        if (ItemGroup[i].Field != null) {
            var fieldValue = DBReader.getFieldValueFromJsonData(JsonData, ItemGroup[i].Field, curID);
            eval("if(fieldValue!=null){ItemGroup[i].innerText=unescape(fieldValue);}else{ItemGroup[i].innerText='';};");
            fieldValue = null;
        }
    }
    //    ItemGroup = $(".div-form-editor");
    //    for (var i = 0; i < ItemGroup.length; i++) {
    //        var texteareDom = ItemGroup[i].children[1].children[0];
    //        var fieldValue = DBReader.getFieldValueFromJsonData(JsonData, texteareDom.Field, curID);
    //        eval("if(fieldValue!=null){$(texteareDom).value(unescape(fieldValue));}else{$(texteareDom).value('');};");
    //        fieldValue = null;
    //    }
    ItemGroup = null;
    //    }
    //    catch(e)
    //    {
    //        alert(e.message);
    //    }
    CollectGarbage();
};
/*通过控件填充实体*/
jsDataResolution.GetControlData = function(Container, _entity) {
    //    try
    //    {
    var dateArray = [];
    var ItemGroup = Container.getElementsByTagName("INPUT");
    for (var i = 0; i < ItemGroup.length; i++) {
        var ColumnName = ItemGroup[i].Field;
        var strEvalCommand = "";
        if (ColumnName != null) {
            if (ItemGroup[i].type == "hidden") {
                strEvalCommand = "_entity.Fields." + ColumnName + "='" + ItemGroup[i].value + "';";
            }
            else if (ItemGroup[i].parentElement.parentElement.parentElement.parentElement.className == "tbTime") {
                var j = 0;
                var parentTb = ItemGroup[i].parentElement.parentElement.parentElement.parentElement;
                do {
                    if (dateArray[j] == parentTb.id) {
                        break;
                    }
                    if (j == dateArray.length) {
                        dateArray.push(parentTb.id);
                        var dateContorl = parentTb.getElementsByTagName("INPUT");
                        var dataStr = "";
                        for (var k = 0; k < dateContorl.length; k++) {
                            if (dataStr.length > 0) {
                                dataStr += "|";
                            }
                            dataStr += dateContorl[k].value;
                        }
                        eval("_entity.Fields." + ColumnName + "='" + dataStr + "';");
                    }
                    j++;
                } while (j < dateArray.length);
            }
            else if (ItemGroup[i].type == "text") {
                if (ItemGroup[i]._type != undefined && ItemGroup[i]._type == 'dropdown') {
                    strEvalCommand = "_entity.Fields." + ColumnName + "='" + escape($(ItemGroup[i].id).DataValue()) + "';";
                }
                else {
                    if (ItemGroup[i].IsEncrypt == 'true') {
                        strEvalCommand = "_entity.Fields." + ColumnName + "='" + escape(ItemGroup[i].value) + "';";
                    }
                    else {
                        strEvalCommand = "_entity.Fields." + ColumnName + "='" + ItemGroup[i].value + "';";
                    }
                }
            }
            else if (ItemGroup[i].type == "checkbox") {
                var saveString = "";
                var parentObj = ItemGroup[i].parentElement;
                var inputGroup = parentObj.getElementsByTagName("INPUT"); /*获得父级容器中所有checkbox*/
                for (var j = 0; j < inputGroup.length; j++) {
                    if (inputGroup[j].type == "checkbox") {
                        if (inputGroup[j].Field == ColumnName) {
                            if (inputGroup[j].SelValueMode == "State") {
                                var state = 0;
                                if (inputGroup[j].checked == true) {
                                    state = 1;
                                }
                                if (saveString != "") {
                                    saveString += ",";
                                }
                                saveString += state;
                            }
                            else if (inputGroup[j].SelValueMode == "Text") {
                                if (inputGroup[j].checked == true) {
                                    if (saveString != "") {
                                        saveString += ",";
                                    }
                                    saveString += inputGroup[j].nextSibling.innerHTML;
                                }
                            }
                            else {
                                if (inputGroup[j].checked == true) {
                                    if (saveString != "") {
                                        saveString += ",";
                                    }
                                    saveString += inputGroup[j].value;
                                }
                            }
                        }
                    }
                } /*end-for(j)*/
                strEvalCommand = "_entity.Fields." + ColumnName + "='" + saveString + "';";
            }
            else if (ItemGroup[i].type == "radio") {
                if (ItemGroup[i].SelValueMode == "Text") {
                    if (ItemGroup[i].checked == true) {
                        strEvalCommand = "if(ItemGroup[i].Field!=null){_entity.Fields." + ColumnName + "='" + ItemGroup[i].nextSibling.innerHTML + "';}else{}";
                    }
                }
                else {
                    if (ItemGroup[i].checked == true) {
                        strEvalCommand = "if(ItemGroup[i].Field!=null){_entity.Fields." + ColumnName + "='" + ItemGroup[i].value + "';}else{}";
                    }
                }
            }
            eval(strEvalCommand);
            strEvalCommand = null;
        }
    }
    dateArray = null;
    dateArray = [];
    ItemGroup = Container.getElementsByTagName("SELECT");
    for (var i = 0; i < ItemGroup.length; i++) {
        // strEvalCommand="if(_entity.Fields."+ItemGroup[i].Field+"!=null){_entity.Fields."+ItemGroup[i].Field+"=ItemGroup[i].value;}else{ItemGroup[i].value='';};"
        if (ItemGroup[i].SelValueMode == "Text") {
            strEvalCommand = "if(ItemGroup[i].Field!=null){var _index = (ItemGroup[i].selectedIndex == -1?0:ItemGroup[i].selectedIndex); _entity.Fields." + ItemGroup[i].Field + "=ItemGroup[i][_index].text;_index=null;}";
        }
        else if (ItemGroup[i].parentNode.format == "datetime") {
            //            strEvalCommand = "if(ItemGroup[i].Field!=null){_entity.Fields." + ItemGroup[i].Field + "=ItemGroup[i].value;}else{ItemGroup[i].value='';}";

            var j = 0;
            do {
                if (dateArray[j] == ItemGroup[i].parentNode.id) {
                    break;
                }
                if (j == dateArray.length) {
                    dateArray.push(ItemGroup[i].parentNode.id);
                    var dateType = ItemGroup[i].parentNode.datetype;
                    var dateDiv = ItemGroup[i].parentNode;
                    switch (dateType) {
                        case "yyyy-MM":
                        case "MM-dd":
                            {
                                var strDate = "";
                                for (var j = 0; j < dateDiv.children.length; j++) {
                                    if (strDate.length > 1) {
                                        strDate += "-";
                                    }
                                    strDate += dateDiv.children[j].value;
                                }
                                _entity.Fields[ItemGroup[i].Field] = strDate;
                            } break;
                        case "hh:mm":
                        case "hh:mm:ss":
                            {
                                var strDate = "";
                                for (var j = 0; j < dateDiv.children.length; j++) {
                                    if (strDate.length > 1) {
                                        strDate += ":";
                                    }
                                    strDate += dateDiv.children[j].value;
                                }
                                _entity.Fields[ItemGroup[i].Field] = strDate;
                            } break;
                        case "dd hh:mm:ss":
                            {
                                var strDate = "";
                                for (var j = 0; j < dateDiv.children.length; j++) {
                                    if (j == 0) {
                                        strDate += "";
                                    } else if (j == 1) {
                                        strDate += " ";
                                    } else {
                                        strDate += ":";
                                    }
                                    strDate += dateDiv.children[j].value;
                                }
                                _entity.Fields[ItemGroup[i].Field] = strDate;
                            } break;
                    }
                }
                j++;
            } while (j < dateArray.length);
        }
        else {
            strEvalCommand = "if(ItemGroup[i].Field!=null){_entity.Fields." + ItemGroup[i].Field + "=ItemGroup[i].value;}else{ItemGroup[i].value='';}";
        }
        eval(strEvalCommand);
        strEvalCommand = null;
    }

    //    ItemGroup = $(".div-form-editor");
    //    for (var i = 0; i < ItemGroup.length; i++) {
    //        var texteareDom = ItemGroup[i].children[1].children[0];
    //        if (texteareDom.Field != null) {
    //            var strEvalCommand = "if(texteareDom.Field!=null){_entity.Fields." + texteareDom.Field + "=escape('" + $(texteareDom).value() + "');}else{}";
    //            eval(strEvalCommand);
    //            strEvalCommand = null;
    //        }
    //    }    
    ItemGroup = Container.getElementsByTagName("TEXTAREA");
    for (var i = 0; i < ItemGroup.length; i++) {
        var ColumnName = ItemGroup[i].Field;
        if (ColumnName != null) {
            if (ItemGroup[i].parentElement.parentElement != null && ItemGroup[i].parentElement.parentElement.className == "div-form-editor") {
                var strEvalCommand = "if(ItemGroup[i].Field!=null){_entity.Fields." + ColumnName + "='" + escape($(ItemGroup[i]).value()) + "';}else{}";
            } else {
                var strEvalCommand = "if(ItemGroup[i].Field!=null){_entity.Fields." + ColumnName + "='" + escape(ItemGroup[i].value) + "';}else{}";
            }
            eval(strEvalCommand);
            strEvalCommand = null;
        }
        ColumnName = null;
    }
    ItemGroup = null;
    //    }
    //    catch(e)
    //    {
    //        alert(e.message);
    //    }
    CollectGarbage();
};
/*填充实体内容*/
jsDataResolution.SetEntityData = function(Container, _entity) {
    try {
        var ItemGroup = Container.getElementsByTagName("INPUT");
        for (var i = 0; i < ItemGroup.length; i++) {
            var strEvalCommand = "";
            var strdataTable = ItemGroup[i].dataTable;
            var ColumnName = ItemGroup[i].Fields;
            if (strdataTable != null && strdataTable != undefined && strdataTable != ""
            && ColumnName != null && ColumnName != undefined && ColumnName != ""
            && strdataTable == _entity.TableName) {
                if (ItemGroup[i].type == "hidden") {
                    strEvalCommand = "_entity.Fields." + ColumnName + "='" + ItemGroup[i].value + "';";
                }
                else if (ItemGroup[i].type == "text") {
                    if (ItemGroup[i]._type != undefined && ItemGroup[i]._type == 'dropdown') {
                        strEvalCommand = "_entity.Fields." + ColumnName + "='" + escape($(ItemGroup[i].id).DataValue()) + "';";
                    }
                    else {
                        if (ItemGroup[i].IsEncrypt == 'true') {
                            strEvalCommand = "_entity.Fields." + ColumnName + "='" + escape(ItemGroup[i].value) + "';";
                        }
                        else {
                            strEvalCommand = "_entity.Fields." + ColumnName + "='" + ItemGroup[i].value + "';";
                        }
                    }
                }
                else if (ItemGroup[i].type == "checkbox") {
                    if (ItemGroup[i].checked == true) {
                        strEvalCommand = "_entity.Fields." + ColumnName + "=1;";
                    }
                    else if (ItemGroup[i].checked == false) {
                        strEvalCommand = "_entity.Fields." + ColumnName + "=0;";
                    }
                }
                else if (ItemGroup[i].type == "radio") {
                    if (ItemGroup[i].checked == true) {
                        strEvalCommand = "_entity.Fields." + ColumnName + "='" + ItemGroup[i].value + "';";
                    }
                }
                eval(strEvalCommand);
                strEvalCommand = null;
            }
            ColumnName = null;
            strdataTable = null;
        }
        ItemGroup = Container.getElementsByTagName("SELECT");
        for (var i = 0; i < ItemGroup.length; i++) {
            var strdataTable = ItemGroup[i].dataTable;
            var ColumnName = ItemGroup[i].Fields;
            if (strdataTable != null && strdataTable != undefined && strdataTable != ""
            && ColumnName != null && ColumnName != undefined && ColumnName != ""
            && strdataTable == _entity.TableName) {
                strEvalCommand = "if(_entity.Fields." + ColumnName + "!=null){ItemGroup[i].value=_entity.Fields." + ColumnName + ";}else{ItemGroup[i].value='';};";
                eval(strEvalCommand);
                strEvalCommand = null;
            }
            ColumnName = null;
            strdataTable = null;
        }
        ItemGroup = Container.getElementsByTagName("TEXTAREA");
        for (var i = 0; i < ItemGroup.length; i++) {
            var strdataTable = ItemGroup[i].dataTable;
            var ColumnName = ItemGroup[i].Fields;
            if (strdataTable != null && strdataTable != undefined && strdataTable != ""
            && ColumnName != null && ColumnName != undefined && ColumnName != ""
            && strdataTable == _entity.TableName) {
                if (ItemGroup[i].parentElement.parentElement != null && ItemGroup[i].parentElement.parentElement.className == "div-form-editor") {
                    var strEvalCommand = "_entity.Fields." + ColumnName + "=escape('" + $(ItemGroup[i]).value() + "');";
                } else {
                    var strEvalCommand = "_entity.Fields." + ColumnName + "=escape('" + ItemGroup[i].value + "');"; //$('#"+ItemGroup[i].id+"').value());";
                }
                eval(strEvalCommand);
                strEvalCommand = null;
            }
            ColumnName = null;
            strdataTable = null;
        }
        //        ItemGroup = $(".div-form-editor");
        //        for (var i = 0; i < ItemGroup.length; i++) {
        //            var texteareDom = ItemGroup[i][0].children[1].children[0];
        //            if (texteareDom.Field != null) {
        //                var strEvalCommand = "_entity.Fields." + texteareDom.Field + "=escape('" + $(texteareDom).value() + "');";
        //                eval(strEvalCommand);
        //                strEvalCommand = null;
        //            }
        //        } 
        ItemGroup = null;
    }
    catch (e) {
        alert(e.message);
    }
};