dojo.provide("parus.designerReportTableConstraintAttributeDialog");dojo.require("dijit.Dialog");dojo.require("dijit.form.Button");dojo.require("dijit.form.ValidationTextBox");dojo.require("dijit.form.SimpleTextarea");dojo.require("dijit.form.RadioButton");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.designerReportTableIndexDialog");dojo.declare("parus.designerReportTableConstraintAttributeDialog",[parus.editDictionaryDialog],{onLoadParams:function(c,b,a){this.inherited(arguments);if(c&&b){this.numbEdit.attr("value",c.getValue(b,"NUMB"));this.indexEdit.attr("value",c.getValue(b,"BALANCEINDEX"))}if(!this.editMode){this.numbEdit.attr("value",this.executeGetNextNumber())}},getIndexCondition:function(){return{PRN:this.getParentDialogCondition("PRN")}},getExecParams:function(){return{NUMB:this.numbEdit.attr("value"),BALANCEINDEX:this.indexEdit.attr("value")}},executeInsert:function(b){var a=parus.database.execute("designer.BalanceTables.Constraints.Attributes.Insert",dojo.mixin(this.getExecParams(),{PRN:this.prn}));if(a){return parus.parus8.nodeField(parus.parus8.rowNodes(a)[0],"NRN")}},executeUpdate:function(){var a=parus.database.execute("designer.BalanceTables.Constraints.Attributes.Update",dojo.mixin(this.getExecParams(),{RN:this.rn}));return !!a},executeDelete:function(c,b){var a=parus.database.execute("designer.BalanceTables.Constraints.Attributes.Delete",{RN:c.getValue(b,"RN")});return !!a},executeGetNextNumber:function(){var a=parus.database.execute("designer.BalanceTables.Constraints.Attributes.GetNextNumber",{PRN:this.prn});if(a){return parus.parus8.nodeField(parus.parus8.rowNodes(a)[0],"NUMB")}}});