dojo.provide("parus.designerReportIndexDialog");dojo.require("dijit.Dialog");dojo.require("dijit.form.Button");dojo.require("dijit.form.ValidationTextBox");dojo.require("dijit.form.SimpleTextarea");dojo.require("parus.parus8");dojo.require("parus.dialog");dojo.require("parus.dictEdit");dojo.require("parus.controlActions");dojo.require("parus.editableDictionaryDialog");dojo.require("parus.editDictionaryDialog");dojo.require("parus.designerIndexDialog");dojo.require("parus.designerIndexFormulaDialog");dojo.declare("parus.designerReportIndexDialog",[parus.editDictionaryDialog],{onLoadParams:function(e,d,c){this.inherited(arguments);if(!this.prn){this.prn=this.getParentDialogCondition("PRN")}if(e&&d){this.indexEdit.attr("value",e.getValue(d,"BALANCEINDEX"));this.dictionaryEdit.attr("value",e.getValue(d,"DICTIONARY"));this.priorityEdit.attr("value",e.getValue(d,"PRIORITY"));this.agrFuncSelect.attr("value",e.getValue(d,"AGR_FUNC"));this.nullableCheckBox.attr("checked",e.getValue(d,"NULLABLE")=="1");this.dictCheckCheckBox.attr("checked",e.getValue(d,"DICT_CHECK")=="1");this.dictValNoteCheckBox.attr("checked",e.getValue(d,"DICT_VAL_NOTE")=="1");if(this.editMode){var b=e.getValue(d,"BITYPE")=="1";parus.controlActions.setDisabled(this.agrFuncSelect,!b);if(e.getValue(d,"DICTIONARY")){this.dictCheckCheckBox.attr("disabled",false);var a=e.getValue(d,"FORMAT")=="0";parus.controlActions.setDisabled(this.dictValNoteCheckBox,!a)}}}this.indexEdit.onApplyDictionary=dojo.hitch(this,this.indexChanged);this.dictionaryEdit.onApplyDictionary=dojo.hitch(this,this.dictionaryChanged)},indexChanged:function(b){if(b){var a=b.getFieldValue("BITYPE")=="1";parus.controlActions.setDisabled(this.agrFuncSelect,!a)}else{if(!this.indexEdit.showingDictionary&&!this.indexEdit.attr("value")){parus.controlActions.setDisabled(this.agrFuncSelect,true)}}},dictionaryChanged:function(b){if(b){this.dictCheckCheckBox.attr("disabled",false);this.dictCheckCheckBox.attr("checked",true);var a=b.getFieldValue("FORMAT")=="0";parus.controlActions.setDisabled(this.dictValNoteCheckBox,!a)}else{if(!this.dictionaryEdit.showingDictionary&&!this.dictionaryEdit.attr("value")){parus.controlActions.setDisabled(this.dictCheckCheckBox,true);parus.controlActions.setDisabled(this.dictValNoteCheckBox,true)}}},executeInsert:function(b){var a=parus.database.execute("designer.BalanceReportForm.Indexes.Insert",{RN:b?this.rn:null,PRN:this.prn,BALANCEINDEX:this.indexEdit.attr("value"),DICTIONARY:this.dictionaryEdit.attr("value"),PRIORITY:this.priorityEdit.attr("value"),AGR_FUNC:this.agrFuncSelect.attr("value"),NULLABLE:this.nullableCheckBox.attr("checked")?"1":"0",DICT_CHECK:this.dictCheckCheckBox.attr("checked")?"1":"0",DICT_VAL_NOTE:this.dictValNoteCheckBox.attr("checked")?"1":"0"});if(a){return parus.parus8.nodeField(parus.parus8.rowNodes(a)[0],"NRN")}},executeUpdate:function(){var a=parus.database.execute("designer.BalanceReportForm.Indexes.Update",{RN:this.rn,BALANCEINDEX:this.indexEdit.attr("value"),DICTIONARY:this.dictionaryEdit.attr("value"),PRIORITY:this.priorityEdit.attr("value"),AGR_FUNC:this.agrFuncSelect.attr("value"),NULLABLE:this.nullableCheckBox.attr("checked")?"1":"0",DICT_CHECK:this.dictCheckCheckBox.attr("checked")?"1":"0",DICT_VAL_NOTE:this.dictValNoteCheckBox.attr("checked")?"1":"0"});return !!a},executeDelete:function(b,a){var c=parus.database.execute("designer.BalanceReportForm.Indexes.Delete",{RN:b.getValue(a,"RN")});return !!c},executeInsertList:function(c,b){var a=parus.database.execute("designer.BalanceReportForm.Indexes.InsertList",{PRN:c,RN:b});return a},executeInsertGroup:function(c,b){var a=parus.database.execute("designer.BalanceReportForm.Indexes.InsertGroup",{PRN:c,GROUP:b});return a}});