dojo.provide("parus.designerTemplateDialog");dojo.require("dijit.Dialog");dojo.require("dijit.form.Button");dojo.require("dijit.form.DateTextBox");dojo.require("parus.parus8");dojo.require("parus.dialog");dojo.require("parus.formats");dojo.require("parus.editDictionaryDialog");dojo.declare("parus.designerTemplateDialog",[parus.editDictionaryDialog],{onLoadParams:function(c,b,a){this.inherited(arguments);if(!this.prn){this.prn=this.getParentDialogCondition("PRN")}if(c&&b){this.nameEdit.attr("value",c.getValue(b,"NAME"));this.usageSelect.attr("value",c.getValue(b,"USAGE"));this.directionSelect.attr("value",c.getValue(b,"DIRECT_TABLE"));this.exportToExcelSelect.attr("value",c.getValue(b,"TO_EXCEL_SIGN"));this.defaultCheckBox.attr("checked",c.getValue(b,"EDIT_DEFAULT")=="1");if(this.editMode){this.directionSelect.attr("disabled",true)}}},executeInsert:function(b){var a=parus.database.execute(b?"duplicateDesignerTemplate":"insertDesignerTemplate",{RN:b?this.rn:null,PRN:this.prn,NAME:this.nameEdit.attr("value"),USAGE:this.usageSelect.attr("value"),DIRECT_TABLE:this.directionSelect.attr("value"),TO_EXCEL_SIGN:this.exportToExcelSelect.attr("value"),EDIT_DEFAULT:(this.defaultCheckBox.attr("checked")?"1":"0")});if(a){return parus.parus8.nodeField(parus.parus8.rowNodes(a)[0],"NRN")}},executeUpdate:function(){var a=parus.database.execute("updateDesignerTemplate",{RN:this.rn,NAME:this.nameEdit.attr("value"),USAGE:this.usageSelect.attr("value"),TO_EXCEL_SIGN:this.exportToExcelSelect.attr("value"),EDIT_DEFAULT:(this.defaultCheckBox.attr("checked")?"1":"0")});return !!a},executeDelete:function(c,b){var a=parus.database.execute("deleteDesignerTemplate",{RN:c.getValue(b,"RN")});return !!a}});