dojo.provide("parus.designerReportTableConstraintDialog");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.formats");dojo.require("parus.controlActions");dojo.require("parus.editableDictionaryDialog");dojo.require("parus.editDictionaryDialog");dojo.require("parus.designerTemplateDialog");dojo.declare("parus.designerReportTableConstraintDialog",[parus.editDictionaryDialog],{editionRN:null,onLoadParams:function(c,b,a){this.inherited(arguments);if(!this.prn){this.prn=this.getParentDialogCondition("PRN")}if(this.parentDialog&&this.parentDialog.isInstanceOf(parus.editableDictionaryDialog)){this.editionRN=this.parentDialog.getParentDialogCondition("PRN")}if(c&&b){this.nameEdit.attr("value",c.getValue(b,"NAME"));this.constrTypeEdit.attr("value",c.getValue(b,"CONSTR_TYPE"));this.textEdit.attr("value",c.getValue(b,"TEXT"));this.messageEdit.attr("value",c.getValue(b,"MESSAGE"));this.templateEdit.attr("value",c.getValue(b,"TEMPLATE"));this.activeCheckBox.attr("checked",c.getValue(b,"ACTIVE_SIGN")=="1")}this.constrTypeEditChanged()},constrTypeEditChanged:function(){var a=this.constrTypeEdit.attr("value")=="0";parus.controlActions.setDisabled(this.textEdit,a);this.messageEdit.attr("required",!a)},getTemplatesCondition:function(){return{PRN:this.editionRN?this.editionRN:parus.parus8.CLASS_EmptyData}},executeInsert:function(b){var a=parus.database.execute("designer.BalanceTables.Constraints.Insert",{RN:b?this.rn:null,PRN:this.prn,NAME:this.nameEdit.attr("value"),CONSTR_TYPE:this.constrTypeEdit.attr("value"),TEXT:this.textEdit.attr("value"),MESSAGE:this.messageEdit.attr("value"),TEMPLATE:this.templateEdit.attr("value"),ACTIVE_SIGN:this.activeCheckBox.attr("checked")?"1":"0"});if(a){return parus.parus8.nodeField(parus.parus8.rowNodes(a)[0],"NRN")}},executeUpdate:function(){var a=parus.database.execute("designer.BalanceTables.Constraints.Update",{RN:this.rn,NAME:this.nameEdit.attr("value"),CONSTR_TYPE:this.constrTypeEdit.attr("value"),TEXT:this.textEdit.attr("value"),MESSAGE:this.messageEdit.attr("value"),TEMPLATE:this.templateEdit.attr("value"),ACTIVE_SIGN:this.activeCheckBox.attr("checked")?"1":"0"});return !!a},executeDelete:function(b,a){var c=parus.database.execute("designer.BalanceTables.Constraints.Delete",{RN:b.getValue(a,"RN")});return !!c}});