
// Generated by Intersoft Script Optimizer V1.5 + Intersoft JS Engine MaxObfuscate(tm) V1.0 
// Generated Datetime : 12/11/2009 3:13:44 PM
// Copyright (c) 2005 Intersoft Solutions.
// Unauthorized decryption/reproduction of any codes contained herein is strictly prohibited and will result in severe civil and criminal penalties .
//**Start Encode**
function WebGridPersistedRows(){ this._Type ="WebGridPersistedRows"; IWebGridPersistence.call(this);  this.Table =null; this.Items =new Array();  this.GetKeyValueString =function(v6e188) { if (this.Table ==null) return; return wg4a378.m36910(this.Table,v6e188); };  this.Remove =function(v6e188) { if (this.Items.length ==0 ||this.Table ==null) return;  var v5783 =this.IndexOf(this.GetKeyValueString(v6e188));  if (v5783 >-1) this.Items.splice(v5783,1); };  this.Add =function(v6e188) { var v34c24 =wg4a378.m33a20(v6e188); var v25252 =wgGetGridById(v34c24.gridId); var vaa679 =v25252.Tables[v34c24.tblName];  if (this.Table ==null) this.Table =vaa679; this.Items.push(this.GetKeyValueString(v6e188)); };  this.Contains =function(v6e188) { for (var v5783=0; v5783<this.Items.length; v5783++) { if (this.Items[v5783] ==this.GetKeyValueString(v6e188)) return true; }  return false; };  this.IndexOf =function(vb6788) { for (var v5783=0; v5783<this.Items.length; v5783++) { if (this.Items[v5783] ==vb6788) return v5783; }  return -1; };  this.SerializeToXml =function() { if (this.Items.length ==0) return null;  var v25252 =this.Table.GetGrid(); var vbeb79 =v25252.XmlDt; var v6f122 =this.Table.XmlNode; var v9506 =ISXml.CreateNodeOnly(vbeb79,"SelectedRows","");  for (var v5783=0; v5783<this.Items.length; v5783++) { ISXml.CreateCDATA(vbeb79,v9506,"Item",this.Items[v5783]); }  return v9506; };  this.Deserialize =function(v5fd24) { for (var v5783=0; v5783<v5fd24.childNodes.length; v5783++) { var v05951 =v5fd24.childNodes[v5783].text; var v81584 =v05951.split('\06');  for (var v04375=0; v04375<v81584.length; v04375++) { this.Items.push(v81584[v04375]); } } };  this.RefreshUI =function(vb9d24) { var vaa679; var v25252 =this.Table.Grid;  if (this.Table.IsRootTable) vaa679 =this.Table; else vaa679 =vb9d24; if (v25252.LayoutSettings.RestoreRowSelection =="Disabled") return;  if (!vaa679) return;  var vbe711 =vaa679.GetElement(WG40.BODY,WG40.HTMLTABLE); var v8e815 =vbe711.rows;  for (var v5783=0; v5783<v8e815.length; v5783++) { var v8b639 =v8e815[v5783];  if (wgIsRecordRow(v8b639)) { for (var v04375=0; v04375<this.Items.length; v04375++) { if (this.GetKeyValueString(v8b639)==this.Items[v04375]) { wgdee10.m4f150(v8b639,"CheckedRow",false,true);  if (v25252.BindingOperationMode =="ClientBinding" &&this.Table.GetRowCheckerColumn()!="") this.Table.ToRowObject(v8b639).Check(); } } } } };  this.Clear =function() { this.Items =new Array(); };}function WebGridPersistedChildRows(){ this._Type ="WebGridPersistedChildRows"; WebGridPersistedRows.call(this);  this.SerializeToXml =function() { if (this.Items.length ==0) return null;  var vf6f44 =this.Table.GetGrid(); var v4d350 =vf6f44.XmlDt; var v60760 =this.Table.XmlNode; var va4954 =ISXml.CreateNodeOnly(v4d350,"ChildRows","");  for (var v66488=0; v66488<this.Items.length; v66488++) { ISXml.CreateCDATA(v4d350,va4954,"Item",this.Items[v66488]); }  return va4954; };  this.RefreshUI =function(v33a63) { };}function WebGridBatchUpdateSettings(){ this._Type ="WebGridBatchUpdateSettings"; ISObject.call(this); this.AllowReviewChanges =false; this.AllowUndoChanges =true; this.AutomaticObjectUpdate =true; this.PromptOnUndoAllChanges =true; this.NotifyOnLostFocus =false; this.HighlightChanges =true; this.PromptUnsavedChanges =true; }function WebGridBatchPendingChanges(){ this._Type ="WebGridBatchPendingChanges"; IWebGridPersistence.call(this); this.Table =null; this.Items =new Array();  this.GetKeyValueString =function(v92b10) { return wg4a378.m36910(this.Table,v92b10); };  this.Remove =function(v8053) { var vffe99 =this.IndexOf(v8053);  if (vffe99 >-1) this.Items.splice(vffe99,1); };  this.Add =function(v8053) { this.Items.push(v8053); };  this.Get =function(vbeb29,va9a42) { var v7d629 =new Array();  for (var vffe99 =0; vffe99 <this.Items.length; vffe99++) { if (vbeb29 ==null ||(this.Items[vffe99].KeyValues ==vbeb29.GetKeyValueString())) { if (va9a42) { if (this.Items[vffe99].RowState ==va9a42) v7d629.push(this.Items[vffe99]); } else v7d629.push(this.Items[vffe99]); } } return v7d629; };  this.Contains =function(vbeb29) { for (var vffe99 =0; vffe99 <this.Items.length; vffe99++) { if (this.Items[vffe99].KeyValues ==vbeb29.GetKeyValueString()) return true; } return false; }; this.IndexOf =function(v8053) { for (var vffe99 =0; vffe99 <this.Items.length; vffe99++) { if (this.Items[vffe99] ==v8053) return vffe99; } return -1; };  this.SerializeToXml =function() { if (this.Items.length ==0) return null;  var v4bc43 =this.Table.GetGrid(); var v61195 =v4bc43.XmlDt; var v14724 =this.Table.XmlNode; var vfc113 =ISXml.CreateNodeOnly(v61195,"PendingChanges","");  for (var vffe99=0; vffe99<this.Items.length; vffe99++) { var vb0a85 =this.Items[vffe99]; var v07151 =ISXml.CreateNode(v61195,vfc113,"Item",""); var vd4b37 ="";  if (vb0a85.Data !=null) { for (var v6e222=0; v6e222<vb0a85.Data.length; v6e222++) { var vcd594 =vb0a85.Data[v6e222];  vd4b37 +="<C>"; vd4b37 +="<N>" +vcd594.Column.Name +"</N><NT>" +ISXml.EncodeString(vcd594.NewText)+"</NT><NV>" +ISXml.EncodeString(vcd594.NewValue.toString())+"</NV>";  if (vcd594.OldText !="" &&vcd594.OldText !=null) vd4b37 +="<OT>" +ISXml.EncodeString(vcd594.OldText)+"</OT>"; if (vcd594.OldValue !="" &&vcd594.OldValue !=null) vd4b37 +="<OV>" +ISXml.EncodeString(vcd594.OldValue.toString())+"</OV>";  vd4b37 +="</C>"; } }  ISXml.SetAttribute(v07151,"RowState",vb0a85.RowState); ISXml.SetAttribute(v07151,"TableName",vb0a85.Table.Name); ISXml.CreateCDATA(v61195,v07151,"Value",vb0a85.KeyValues.replace("\03"," ")); ISXml.CreateCDATA(v61195,v07151,"Data",vd4b37); if (vb0a85.RowState =="Added" &&vb0a85.Row.SubTable !=null) ISXml.CreateCDATA(v61195,v07151,"RelNames",vb0a85.Row.SubTable.RelNames); }  return vfc113; };  this.Deserialize =function(v2c365) { for (var vffe99=0; vffe99<v2c365.childNodes.length; vffe99++) { var vb0a85 =v2c365.childNodes[vffe99]; var v8053 =new WebGridRowChanges();  v8053.RowState =ISXml.GetAttribute(vb0a85,"RowState"); v8053.KeyValues =ISXml.GetNodeText(vb0a85,"Value").replace(" ","\03"); v8053.RequireInvalidate =true; v8053.Table =ISXml.GetAttribute(vb0a85,"TableName");  var v36d35 =ISXml.GetNode(vb0a85,"Data"); var vca757 =ISXml.CreateXmlDocument();  ISXml.LoadXml(vca757,"<Root>" +v36d35.text +"</Root>");  var v50174 =ISXml.GetNodes(vca757,"//C");  if (v50174 !=null &&v50174.length >0) { v8053.Data =new Array();  for (var v6e222=0; v6e222<v50174.length; v6e222++) { var vcd594 =new WebGridCellData(); var v7a440 =v50174[v6e222];  vcd594.Column =this.Table.Columns.GetNamedItem(ISXml.GetNodeText(v7a440,"N")); vcd594.NewText =ISXml.DecodeString(ISXml.GetNodeText(v7a440,"NT")); vcd594.NewValue =ISXml.DecodeString(ISXml.GetNodeText(v7a440,"NV")); vcd594.OldText =ISXml.DecodeString(ISXml.GetNodeText(v7a440,"OT")); vcd594.OldValue =ISXml.DecodeString(ISXml.GetNodeText(v7a440,"OV"));  v8053.Data.push(vcd594); } }  if (v8053.RowState =="Added") { var vbeb29 =this.Table.NewRow();  if (this.Table.HasMultiPrimaryKey) { var v9cf37 =v8053.KeyValues.split("\03"); vbeb29.KeyValues =new Array();  for (var v6e222=0; v6e222<v9cf37.length; v6e222++) vbeb29.KeyValues.push(v9cf37[v6e222]); } else { vbeb29.KeyValue =v8053.KeyValues; }  for (var v6e222=0; v6e222<v8053.Data.length; v6e222++) { var vcd594 =v8053.Data[v6e222]; var v4d825 =vbeb29.Cells.GetNamedItem(vcd594.Column.Name);  if (v4d825 !=null) { v4d825.Modified =true; v4d825.Text =vcd594.NewText; v4d825.Value =vcd594.NewValue; v4d825.OldText =vcd594.OldText; v4d825.OldValue =vcd594.OldValue; } }  vbeb29.RelNames =wg02f52.m38913(vbeb29);  if (!this.Table.IsRootTable) { var v43f93 =new WebGridSubTables(); v43f93.RelNames =ISXml.GetNodeText(vb0a85,"RelNames"); vbeb29.SubTable =v43f93; }  v8053.Row =vbeb29; }  this.Items.push(v8053); } };  this.RefreshUI =function(v43f93) { if (typeof(wg02f52)!="undefined") wg02f52.m38698(this,v43f93); };  this.Invalidate =function() { var v4bc43 =this.Table.Grid;  for (var vffe99=0; vffe99<this.Items.length; vffe99++) { var v8053 =this.Items[vffe99];  v8053.RequireInvalidate =true; v8053.Element =null;  if (v8053.Row !=null) v8053.Row.RowElement =null;  if (v8053.RowState !="Added") { if (v4bc43.BindingOperationMode =="ServerBinding" ||v4bc43.IsClientBinding("Server")) v8053.Row =null; } } }; this.Clear =function() { for (var vffe99=0; vffe99<this.Items.length; vffe99++) { var v8053 =this.Items[vffe99];  v8053.Element =null; v8053.Row =null; this.Items[vffe99] =null; }  this.Items =new Array(); };}function WebGridCellData(){ this._Type ="WebGridCellData"; ISObject.call(this);  this.Column =null; this.OldValue =null; this.OldText =null; this.NewValue =null; this.NewText =null;}function WebGridRowChanges(){ this._Type ="WebGridRowChanges"; ISObject.call(this);  this.RowState =""; this.Element =null; this.Data =null; this.Row =null; this.KeyValues =null; this.RequireInvalidate =false; this.Table =null;  this.Setup =function(v6ae42) { this.Element =v6ae42.GetElement(); this.Row =v6ae42; this.KeyValues =this.Row.GetKeyValueString(); this.Table =v6ae42.Table; if (this.RowState !="Deleted") { this.Data =new Array(); var v7c51 =this.Row.GetCells();  for (var v3b390=0; v3b390<v7c51.length; v3b390++) { var vd6d28 =v7c51[v3b390];  if (vd6d28 !=null &&(vd6d28.Modified &&vd6d28.Column.DataMember !="")) { var v4ce67 =new WebGridCellData(); v4ce67.Column =vd6d28.Column; v4ce67.OldValue =vd6d28.OldValue; v4ce67.NewValue =vd6d28.Value; v4ce67.OldText =vd6d28.OldText; v4ce67.NewText =vd6d28.Text;  if (vd6d28.Column.DataType =="System.Boolean") { if (v4ce67.NewValue =="" ||v4ce67.NewValue ==false) v4ce67.NewValue ="False"; else if (v4ce67.NewValue ==true) v4ce67.NewValue ="True";  if (v4ce67.OldValue ==false) v4ce67.OldValue ="False"; else if (v4ce67.NewValue ==true) v4ce67.NewValue ="True"; }  this.Data.push(v4ce67); } } } };  this.MergeChanges =function(v6ae42) { this.Row =v6ae42;  if (this.RowState =="Modified" ||this.RowState =="Added") { var v7c51 =this.Row.GetCells();  for (var v3b390=0; v3b390<v7c51.length; v3b390++) { var vd6d28 =v7c51[v3b390];  if (vd6d28 !=null &&vd6d28.Modified) { var v34453 =this.GetExistingData(vd6d28.Column.Name);  if (v34453) { v34453.NewValue =vd6d28.Value; v34453.NewText =vd6d28.Text; } else { var v4ce67 =new WebGridCellData(); v4ce67.Column =vd6d28.Column; v4ce67.OldValue =vd6d28.OldValue; v4ce67.NewValue =vd6d28.Value; v4ce67.OldText =vd6d28.OldText; v4ce67.NewText =vd6d28.Text; this.Data.push(v4ce67); } } } }  return true; }; this.GetExistingData =function(vc8f42) { if (this.Data ==null) return null;  for (var v3b390=0; v3b390<this.Data.length; v3b390++) { var v14838 =this.Data[v3b390];  if (v14838.Column.Name ==vc8f42) return v14838; }  return null; };  this.UndoUIChanges =function() { if (this.Element !=null) { if (this.RowState =="Added") { var ve0967 =this.Row.Table; var v8f679 =ve0967.Grid; var v4bc22 =wg4a378.m33a20(this.Element); var vdcd23 =null; var v59b14 =null;  wg02f52.me4f42(ve0967,this.Row); wg2f128.m9ae97(v8f679,ve0967,v4bc22,this.Element); if (v8f679.LayoutSettings.Hierarchical) { var v90b71 =wgGetLastVisibleRow(v4bc22); if (v90b71 !=null) { v59b14 =v90b71.GetRowElement(); wg2f128.m40e88(v8f679,ve0967,v4bc22,v59b14); wg2f128.m4fb90(v8f679,ve0967,v4bc22,v59b14); } } } else if (this.RowState =="Modified") { for (var v3b390=0; v3b390<this.Data.length; v3b390++) { var v7c55 =this.Data[v3b390]; var vd6d28 =wgGetCellByName(this.Element,v7c55.Column.Name);  if (vd6d28 !=null) { vd6d28.cellModified =true; vd6d28.oldCellValue =v7c55.OldValue; vd6d28.oldText =v7c55.OldText; } }  wg2f128.m01e94(this.Element); } else if (this.RowState =="Deleted") {  } } };}
