//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.1
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace BongahCS {
    
    
    public partial class BongahDB_DataCacheClientSyncProvider : Microsoft.Synchronization.Data.SqlServerCe.SqlCeClientSyncProvider {
        
        public BongahDB_DataCacheClientSyncProvider() {
            this.ConnectionString = global::BongahCS.Properties.Settings.Default.ClientBONGAHDB_DATAConnectionString;
        }
        
        public BongahDB_DataCacheClientSyncProvider(string connectionString) {
            this.ConnectionString = connectionString;
        }
    }
    
    public partial class BongahDB_DataCacheSyncAgent : Microsoft.Synchronization.SyncAgent {
        
        private tblContractsSyncTable _tblContractsSyncTable;
        
        private tblForuShandeganSyncTable _tblForuShandeganSyncTable;
        
        private tblKharidaranSyncTable _tblKharidaranSyncTable;
        
        private tblMelksSyncTable _tblMelksSyncTable;
        
        private tblMoamelehTypeSyncTable _tblMoamelehTypeSyncTable;
        
        private tblSanadsStatuseSyncTable _tblSanadsStatuseSyncTable;
        
        private userInfoSyncTable _userInfoSyncTable;
        
        partial void OnInitialized();
        
        public BongahDB_DataCacheSyncAgent() {
            this.InitializeSyncProviders();
            this.InitializeSyncTables();
            this.OnInitialized();
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public tblContractsSyncTable tblContracts {
            get {
                return this._tblContractsSyncTable;
            }
            set {
                this.Configuration.SyncTables.Remove(this._tblContractsSyncTable);
                this._tblContractsSyncTable = value;
                this.Configuration.SyncTables.Add(this._tblContractsSyncTable);
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public tblForuShandeganSyncTable tblForuShandegan {
            get {
                return this._tblForuShandeganSyncTable;
            }
            set {
                this.Configuration.SyncTables.Remove(this._tblForuShandeganSyncTable);
                this._tblForuShandeganSyncTable = value;
                this.Configuration.SyncTables.Add(this._tblForuShandeganSyncTable);
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public tblKharidaranSyncTable tblKharidaran {
            get {
                return this._tblKharidaranSyncTable;
            }
            set {
                this.Configuration.SyncTables.Remove(this._tblKharidaranSyncTable);
                this._tblKharidaranSyncTable = value;
                this.Configuration.SyncTables.Add(this._tblKharidaranSyncTable);
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public tblMelksSyncTable tblMelks {
            get {
                return this._tblMelksSyncTable;
            }
            set {
                this.Configuration.SyncTables.Remove(this._tblMelksSyncTable);
                this._tblMelksSyncTable = value;
                this.Configuration.SyncTables.Add(this._tblMelksSyncTable);
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public tblMoamelehTypeSyncTable tblMoamelehType {
            get {
                return this._tblMoamelehTypeSyncTable;
            }
            set {
                this.Configuration.SyncTables.Remove(this._tblMoamelehTypeSyncTable);
                this._tblMoamelehTypeSyncTable = value;
                this.Configuration.SyncTables.Add(this._tblMoamelehTypeSyncTable);
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public tblSanadsStatuseSyncTable tblSanadsStatuse {
            get {
                return this._tblSanadsStatuseSyncTable;
            }
            set {
                this.Configuration.SyncTables.Remove(this._tblSanadsStatuseSyncTable);
                this._tblSanadsStatuseSyncTable = value;
                this.Configuration.SyncTables.Add(this._tblSanadsStatuseSyncTable);
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public userInfoSyncTable userInfo {
            get {
                return this._userInfoSyncTable;
            }
            set {
                this.Configuration.SyncTables.Remove(this._userInfoSyncTable);
                this._userInfoSyncTable = value;
                this.Configuration.SyncTables.Add(this._userInfoSyncTable);
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeSyncProviders() {
            // Create SyncProviders.
            this.RemoteProvider = new BongahDB_DataCacheServerSyncProvider();
            this.LocalProvider = new BongahDB_DataCacheClientSyncProvider();
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeSyncTables() {
            // Create SyncTables.
            this._tblContractsSyncTable = new tblContractsSyncTable();
            this._tblContractsSyncTable.SyncGroup = new Microsoft.Synchronization.Data.SyncGroup("tblContractsSyncTableSyncGroup");
            this.Configuration.SyncTables.Add(this._tblContractsSyncTable);
            this._tblForuShandeganSyncTable = new tblForuShandeganSyncTable();
            this._tblForuShandeganSyncTable.SyncGroup = new Microsoft.Synchronization.Data.SyncGroup("tblForuShandeganSyncTableSyncGroup");
            this.Configuration.SyncTables.Add(this._tblForuShandeganSyncTable);
            this._tblKharidaranSyncTable = new tblKharidaranSyncTable();
            this._tblKharidaranSyncTable.SyncGroup = new Microsoft.Synchronization.Data.SyncGroup("tblKharidaranSyncTableSyncGroup");
            this.Configuration.SyncTables.Add(this._tblKharidaranSyncTable);
            this._tblMelksSyncTable = new tblMelksSyncTable();
            this._tblMelksSyncTable.SyncGroup = new Microsoft.Synchronization.Data.SyncGroup("tblMelksSyncTableSyncGroup");
            this.Configuration.SyncTables.Add(this._tblMelksSyncTable);
            this._tblMoamelehTypeSyncTable = new tblMoamelehTypeSyncTable();
            this._tblMoamelehTypeSyncTable.SyncGroup = new Microsoft.Synchronization.Data.SyncGroup("tblMoamelehTypeSyncTableSyncGroup");
            this.Configuration.SyncTables.Add(this._tblMoamelehTypeSyncTable);
            this._tblSanadsStatuseSyncTable = new tblSanadsStatuseSyncTable();
            this._tblSanadsStatuseSyncTable.SyncGroup = new Microsoft.Synchronization.Data.SyncGroup("tblSanadsStatuseSyncTableSyncGroup");
            this.Configuration.SyncTables.Add(this._tblSanadsStatuseSyncTable);
            this._userInfoSyncTable = new userInfoSyncTable();
            this._userInfoSyncTable.SyncGroup = new Microsoft.Synchronization.Data.SyncGroup("userInfoSyncTableSyncGroup");
            this.Configuration.SyncTables.Add(this._userInfoSyncTable);
        }
        
        public partial class tblContractsSyncTable : Microsoft.Synchronization.Data.SyncTable {
            
            partial void OnInitialized();
            
            public tblContractsSyncTable() {
                this.InitializeTableOptions();
                this.OnInitialized();
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            private void InitializeTableOptions() {
                this.TableName = "tblContracts";
                this.CreationOption = Microsoft.Synchronization.Data.TableCreationOption.DropExistingOrCreateNewTable;
            }
        }
        
        public partial class tblForuShandeganSyncTable : Microsoft.Synchronization.Data.SyncTable {
            
            partial void OnInitialized();
            
            public tblForuShandeganSyncTable() {
                this.InitializeTableOptions();
                this.OnInitialized();
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            private void InitializeTableOptions() {
                this.TableName = "tblForuShandegan";
                this.CreationOption = Microsoft.Synchronization.Data.TableCreationOption.DropExistingOrCreateNewTable;
            }
        }
        
        public partial class tblKharidaranSyncTable : Microsoft.Synchronization.Data.SyncTable {
            
            partial void OnInitialized();
            
            public tblKharidaranSyncTable() {
                this.InitializeTableOptions();
                this.OnInitialized();
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            private void InitializeTableOptions() {
                this.TableName = "tblKharidaran";
                this.CreationOption = Microsoft.Synchronization.Data.TableCreationOption.DropExistingOrCreateNewTable;
            }
        }
        
        public partial class tblMelksSyncTable : Microsoft.Synchronization.Data.SyncTable {
            
            partial void OnInitialized();
            
            public tblMelksSyncTable() {
                this.InitializeTableOptions();
                this.OnInitialized();
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            private void InitializeTableOptions() {
                this.TableName = "tblMelks";
                this.CreationOption = Microsoft.Synchronization.Data.TableCreationOption.DropExistingOrCreateNewTable;
            }
        }
        
        public partial class tblMoamelehTypeSyncTable : Microsoft.Synchronization.Data.SyncTable {
            
            partial void OnInitialized();
            
            public tblMoamelehTypeSyncTable() {
                this.InitializeTableOptions();
                this.OnInitialized();
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            private void InitializeTableOptions() {
                this.TableName = "tblMoamelehType";
                this.CreationOption = Microsoft.Synchronization.Data.TableCreationOption.DropExistingOrCreateNewTable;
            }
        }
        
        public partial class tblSanadsStatuseSyncTable : Microsoft.Synchronization.Data.SyncTable {
            
            partial void OnInitialized();
            
            public tblSanadsStatuseSyncTable() {
                this.InitializeTableOptions();
                this.OnInitialized();
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            private void InitializeTableOptions() {
                this.TableName = "tblSanadsStatuse";
                this.CreationOption = Microsoft.Synchronization.Data.TableCreationOption.DropExistingOrCreateNewTable;
            }
        }
        
        public partial class userInfoSyncTable : Microsoft.Synchronization.Data.SyncTable {
            
            partial void OnInitialized();
            
            public userInfoSyncTable() {
                this.InitializeTableOptions();
                this.OnInitialized();
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            private void InitializeTableOptions() {
                this.TableName = "userInfo";
                this.CreationOption = Microsoft.Synchronization.Data.TableCreationOption.DropExistingOrCreateNewTable;
            }
        }
    }
}
namespace BongahCS {
    
    
    public partial class tblContractsSyncAdapter : Microsoft.Synchronization.Data.Server.SyncAdapter {
        
        partial void OnInitialized();
        
        public tblContractsSyncAdapter() {
            this.InitializeCommands();
            this.InitializeAdapterProperties();
            this.OnInitialized();
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeCommands() {
            // tblContractsSyncTableInsertCommand command.
            this.InsertCommand = new System.Data.SqlClient.SqlCommand();
            this.InsertCommand.CommandText = @" SET IDENTITY_INSERT dbo.tblContracts ON INSERT INTO dbo.tblContracts ([ContractID], [KharidarID], [ForooshandehID], [MelkID], [MoamelehTypeID], [datOdMoaMeleh], [MablagheGarardad], [HagheBongah], [RahgiriCode], [SerialNumber], [LastEditDate], [CreationDate]) VALUES (@ContractID, @KharidarID, @ForooshandehID, @MelkID, @MoamelehTypeID, @datOdMoaMeleh, @MablagheGarardad, @HagheBongah, @RahgiriCode, @SerialNumber, @LastEditDate, @CreationDate) SET @sync_row_count = @@rowcount SET IDENTITY_INSERT dbo.tblContracts OFF ";
            this.InsertCommand.CommandType = System.Data.CommandType.Text;
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ContractID", System.Data.SqlDbType.Int));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KharidarID", System.Data.SqlDbType.Int));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ForooshandehID", System.Data.SqlDbType.Int));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelkID", System.Data.SqlDbType.Int));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MoamelehTypeID", System.Data.SqlDbType.Int));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@datOdMoaMeleh", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MablagheGarardad", System.Data.SqlDbType.Float));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@HagheBongah", System.Data.SqlDbType.Float));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RahgiriCode", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SerialNumber", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter insertcommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            insertcommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.InsertCommand.Parameters.Add(insertcommand_sync_row_countParameter);
            // tblContractsSyncTableDeleteCommand command.
            this.DeleteCommand = new System.Data.SqlClient.SqlCommand();
            this.DeleteCommand.CommandText = @"DELETE FROM dbo.tblContracts WHERE ([KharidarID] = @KharidarID AND [ForooshandehID] = @ForooshandehID AND [MelkID] = @MelkID AND [MoamelehTypeID] = @MoamelehTypeID AND [datOdMoaMeleh] = @datOdMoaMeleh) AND (@sync_force_write = 1 OR ([LastEditDate] <= @sync_last_received_anchor)) SET @sync_row_count = @@rowcount";
            this.DeleteCommand.CommandType = System.Data.CommandType.Text;
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KharidarID", System.Data.SqlDbType.Int));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ForooshandehID", System.Data.SqlDbType.Int));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelkID", System.Data.SqlDbType.Int));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MoamelehTypeID", System.Data.SqlDbType.Int));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@datOdMoaMeleh", System.Data.SqlDbType.NVarChar));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter deletecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            deletecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.DeleteCommand.Parameters.Add(deletecommand_sync_row_countParameter);
            // tblContractsSyncTableUpdateCommand command.
            this.UpdateCommand = new System.Data.SqlClient.SqlCommand();
            this.UpdateCommand.CommandText = @"UPDATE dbo.tblContracts SET [MablagheGarardad] = @MablagheGarardad, [HagheBongah] = @HagheBongah, [RahgiriCode] = @RahgiriCode, [SerialNumber] = @SerialNumber, [LastEditDate] = @LastEditDate, [CreationDate] = @CreationDate WHERE ([KharidarID] = @KharidarID AND [ForooshandehID] = @ForooshandehID AND [MelkID] = @MelkID AND [MoamelehTypeID] = @MoamelehTypeID AND [datOdMoaMeleh] = @datOdMoaMeleh) AND (@sync_force_write = 1 OR ([LastEditDate] <= @sync_last_received_anchor)) SET @sync_row_count = @@rowcount";
            this.UpdateCommand.CommandType = System.Data.CommandType.Text;
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MablagheGarardad", System.Data.SqlDbType.Float));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@HagheBongah", System.Data.SqlDbType.Float));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RahgiriCode", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SerialNumber", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KharidarID", System.Data.SqlDbType.Int));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ForooshandehID", System.Data.SqlDbType.Int));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelkID", System.Data.SqlDbType.Int));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MoamelehTypeID", System.Data.SqlDbType.Int));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@datOdMoaMeleh", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter updatecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            updatecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.UpdateCommand.Parameters.Add(updatecommand_sync_row_countParameter);
            // tblContractsSyncTableSelectConflictDeletedRowsCommand command.
            this.SelectConflictDeletedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictDeletedRowsCommand.CommandText = @"SELECT [KharidarID], [ForooshandehID], [MelkID], [MoamelehTypeID], [datOdMoaMeleh], [DeletionDate] FROM dbo.tblContracts_Tombstone WHERE ([KharidarID] = @KharidarID AND [ForooshandehID] = @ForooshandehID AND [MelkID] = @MelkID AND [MoamelehTypeID] = @MoamelehTypeID AND [datOdMoaMeleh] = @datOdMoaMeleh)";
            this.SelectConflictDeletedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictDeletedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KharidarID", System.Data.SqlDbType.Int));
            this.SelectConflictDeletedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ForooshandehID", System.Data.SqlDbType.Int));
            this.SelectConflictDeletedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelkID", System.Data.SqlDbType.Int));
            this.SelectConflictDeletedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MoamelehTypeID", System.Data.SqlDbType.Int));
            this.SelectConflictDeletedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@datOdMoaMeleh", System.Data.SqlDbType.NVarChar));
            // tblContractsSyncTableSelectConflictUpdatedRowsCommand command.
            this.SelectConflictUpdatedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictUpdatedRowsCommand.CommandText = @"SELECT [ContractID], [KharidarID], [ForooshandehID], [MelkID], [MoamelehTypeID], [datOdMoaMeleh], [MablagheGarardad], [HagheBongah], [RahgiriCode], [SerialNumber], [LastEditDate], [CreationDate] FROM dbo.tblContracts WHERE ([KharidarID] = @KharidarID AND [ForooshandehID] = @ForooshandehID AND [MelkID] = @MelkID AND [MoamelehTypeID] = @MoamelehTypeID AND [datOdMoaMeleh] = @datOdMoaMeleh)";
            this.SelectConflictUpdatedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictUpdatedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KharidarID", System.Data.SqlDbType.Int));
            this.SelectConflictUpdatedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ForooshandehID", System.Data.SqlDbType.Int));
            this.SelectConflictUpdatedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelkID", System.Data.SqlDbType.Int));
            this.SelectConflictUpdatedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MoamelehTypeID", System.Data.SqlDbType.Int));
            this.SelectConflictUpdatedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@datOdMoaMeleh", System.Data.SqlDbType.NVarChar));
            // tblContractsSyncTableSelectIncrementalInsertsCommand command.
            this.SelectIncrementalInsertsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalInsertsCommand.CommandText = @"SELECT [ContractID], [KharidarID], [ForooshandehID], [MelkID], [MoamelehTypeID], [datOdMoaMeleh], [MablagheGarardad], [HagheBongah], [RahgiriCode], [SerialNumber], [LastEditDate], [CreationDate] FROM dbo.tblContracts WHERE ([CreationDate] > @sync_last_received_anchor AND [CreationDate] <= @sync_new_received_anchor)";
            this.SelectIncrementalInsertsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // tblContractsSyncTableSelectIncrementalDeletesCommand command.
            this.SelectIncrementalDeletesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalDeletesCommand.CommandText = @"SELECT [KharidarID], [ForooshandehID], [MelkID], [MoamelehTypeID], [datOdMoaMeleh], [DeletionDate] FROM dbo.tblContracts_Tombstone WHERE (@sync_initialized = 1 AND [DeletionDate] > @sync_last_received_anchor AND [DeletionDate] <= @sync_new_received_anchor)";
            this.SelectIncrementalDeletesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_initialized", System.Data.SqlDbType.Bit));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // tblContractsSyncTableSelectIncrementalUpdatesCommand command.
            this.SelectIncrementalUpdatesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalUpdatesCommand.CommandText = @"SELECT [ContractID], [KharidarID], [ForooshandehID], [MelkID], [MoamelehTypeID], [datOdMoaMeleh], [MablagheGarardad], [HagheBongah], [RahgiriCode], [SerialNumber], [LastEditDate], [CreationDate] FROM dbo.tblContracts WHERE ([LastEditDate] > @sync_last_received_anchor AND [LastEditDate] <= @sync_new_received_anchor AND [CreationDate] <= @sync_last_received_anchor)";
            this.SelectIncrementalUpdatesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeAdapterProperties() {
            this.TableName = "tblContracts";
        }
    }
    
    public partial class tblForuShandeganSyncAdapter : Microsoft.Synchronization.Data.Server.SyncAdapter {
        
        partial void OnInitialized();
        
        public tblForuShandeganSyncAdapter() {
            this.InitializeCommands();
            this.InitializeAdapterProperties();
            this.OnInitialized();
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeCommands() {
            // tblForuShandeganSyncTableInsertCommand command.
            this.InsertCommand = new System.Data.SqlClient.SqlCommand();
            this.InsertCommand.CommandText = @" SET IDENTITY_INSERT dbo.tblForuShandegan ON INSERT INTO dbo.tblForuShandegan ([ForuShandehID], [Name], [Sname], [BirthDate], [Phone], [MelliCode], [Address], [LastEditDate], [CreationDate]) VALUES (@ForuShandehID, @Name, @Sname, @BirthDate, @Phone, @MelliCode, @Address, @LastEditDate, @CreationDate) SET @sync_row_count = @@rowcount SET IDENTITY_INSERT dbo.tblForuShandegan OFF ";
            this.InsertCommand.CommandType = System.Data.CommandType.Text;
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ForuShandehID", System.Data.SqlDbType.Int));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Sname", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BirthDate", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Phone", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelliCode", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter insertcommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            insertcommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.InsertCommand.Parameters.Add(insertcommand_sync_row_countParameter);
            // tblForuShandeganSyncTableDeleteCommand command.
            this.DeleteCommand = new System.Data.SqlClient.SqlCommand();
            this.DeleteCommand.CommandText = "DELETE FROM dbo.tblForuShandegan WHERE ([ForuShandehID] = @ForuShandehID) AND (@s" +
                "ync_force_write = 1 OR ([LastEditDate] <= @sync_last_received_anchor)) SET @sync" +
                "_row_count = @@rowcount";
            this.DeleteCommand.CommandType = System.Data.CommandType.Text;
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ForuShandehID", System.Data.SqlDbType.Int));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter deletecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            deletecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.DeleteCommand.Parameters.Add(deletecommand_sync_row_countParameter);
            // tblForuShandeganSyncTableUpdateCommand command.
            this.UpdateCommand = new System.Data.SqlClient.SqlCommand();
            this.UpdateCommand.CommandText = @"UPDATE dbo.tblForuShandegan SET [Name] = @Name, [Sname] = @Sname, [BirthDate] = @BirthDate, [Phone] = @Phone, [MelliCode] = @MelliCode, [Address] = @Address, [LastEditDate] = @LastEditDate, [CreationDate] = @CreationDate WHERE ([ForuShandehID] = @ForuShandehID) AND (@sync_force_write = 1 OR ([LastEditDate] <= @sync_last_received_anchor)) SET @sync_row_count = @@rowcount";
            this.UpdateCommand.CommandType = System.Data.CommandType.Text;
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Sname", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BirthDate", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Phone", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelliCode", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ForuShandehID", System.Data.SqlDbType.Int));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter updatecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            updatecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.UpdateCommand.Parameters.Add(updatecommand_sync_row_countParameter);
            // tblForuShandeganSyncTableSelectConflictDeletedRowsCommand command.
            this.SelectConflictDeletedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictDeletedRowsCommand.CommandText = "SELECT [ForuShandehID], [DeletionDate] FROM dbo.tblForuShandegan_Tombstone WHERE " +
                "([ForuShandehID] = @ForuShandehID)";
            this.SelectConflictDeletedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictDeletedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ForuShandehID", System.Data.SqlDbType.Int));
            // tblForuShandeganSyncTableSelectConflictUpdatedRowsCommand command.
            this.SelectConflictUpdatedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictUpdatedRowsCommand.CommandText = "SELECT [ForuShandehID], [Name], [Sname], [BirthDate], [Phone], [MelliCode], [Addr" +
                "ess], [LastEditDate], [CreationDate] FROM dbo.tblForuShandegan WHERE ([ForuShand" +
                "ehID] = @ForuShandehID)";
            this.SelectConflictUpdatedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictUpdatedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ForuShandehID", System.Data.SqlDbType.Int));
            // tblForuShandeganSyncTableSelectIncrementalInsertsCommand command.
            this.SelectIncrementalInsertsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalInsertsCommand.CommandText = "SELECT [ForuShandehID], [Name], [Sname], [BirthDate], [Phone], [MelliCode], [Addr" +
                "ess], [LastEditDate], [CreationDate] FROM dbo.tblForuShandegan WHERE ([CreationD" +
                "ate] > @sync_last_received_anchor AND [CreationDate] <= @sync_new_received_ancho" +
                "r)";
            this.SelectIncrementalInsertsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // tblForuShandeganSyncTableSelectIncrementalDeletesCommand command.
            this.SelectIncrementalDeletesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalDeletesCommand.CommandText = "SELECT [ForuShandehID], [DeletionDate] FROM dbo.tblForuShandegan_Tombstone WHERE " +
                "(@sync_initialized = 1 AND [DeletionDate] > @sync_last_received_anchor AND [Dele" +
                "tionDate] <= @sync_new_received_anchor)";
            this.SelectIncrementalDeletesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_initialized", System.Data.SqlDbType.Bit));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // tblForuShandeganSyncTableSelectIncrementalUpdatesCommand command.
            this.SelectIncrementalUpdatesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalUpdatesCommand.CommandText = @"SELECT [ForuShandehID], [Name], [Sname], [BirthDate], [Phone], [MelliCode], [Address], [LastEditDate], [CreationDate] FROM dbo.tblForuShandegan WHERE ([LastEditDate] > @sync_last_received_anchor AND [LastEditDate] <= @sync_new_received_anchor AND [CreationDate] <= @sync_last_received_anchor)";
            this.SelectIncrementalUpdatesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeAdapterProperties() {
            this.TableName = "tblForuShandegan";
        }
    }
    
    public partial class tblKharidaranSyncAdapter : Microsoft.Synchronization.Data.Server.SyncAdapter {
        
        partial void OnInitialized();
        
        public tblKharidaranSyncAdapter() {
            this.InitializeCommands();
            this.InitializeAdapterProperties();
            this.OnInitialized();
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeCommands() {
            // tblKharidaranSyncTableInsertCommand command.
            this.InsertCommand = new System.Data.SqlClient.SqlCommand();
            this.InsertCommand.CommandText = @" SET IDENTITY_INSERT dbo.tblKharidaran ON INSERT INTO dbo.tblKharidaran ([KharidarID], [Name], [Sname], [BirthDate], [Phone], [MelliCode], [Address], [LastEditDate], [CreationDate]) VALUES (@KharidarID, @Name, @Sname, @BirthDate, @Phone, @MelliCode, @Address, @LastEditDate, @CreationDate) SET @sync_row_count = @@rowcount SET IDENTITY_INSERT dbo.tblKharidaran OFF ";
            this.InsertCommand.CommandType = System.Data.CommandType.Text;
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KharidarID", System.Data.SqlDbType.Int));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Sname", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BirthDate", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Phone", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelliCode", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter insertcommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            insertcommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.InsertCommand.Parameters.Add(insertcommand_sync_row_countParameter);
            // tblKharidaranSyncTableDeleteCommand command.
            this.DeleteCommand = new System.Data.SqlClient.SqlCommand();
            this.DeleteCommand.CommandText = "DELETE FROM dbo.tblKharidaran WHERE ([KharidarID] = @KharidarID) AND (@sync_force" +
                "_write = 1 OR ([LastEditDate] <= @sync_last_received_anchor)) SET @sync_row_coun" +
                "t = @@rowcount";
            this.DeleteCommand.CommandType = System.Data.CommandType.Text;
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KharidarID", System.Data.SqlDbType.Int));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter deletecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            deletecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.DeleteCommand.Parameters.Add(deletecommand_sync_row_countParameter);
            // tblKharidaranSyncTableUpdateCommand command.
            this.UpdateCommand = new System.Data.SqlClient.SqlCommand();
            this.UpdateCommand.CommandText = @"UPDATE dbo.tblKharidaran SET [Name] = @Name, [Sname] = @Sname, [BirthDate] = @BirthDate, [Phone] = @Phone, [MelliCode] = @MelliCode, [Address] = @Address, [LastEditDate] = @LastEditDate, [CreationDate] = @CreationDate WHERE ([KharidarID] = @KharidarID) AND (@sync_force_write = 1 OR ([LastEditDate] <= @sync_last_received_anchor)) SET @sync_row_count = @@rowcount";
            this.UpdateCommand.CommandType = System.Data.CommandType.Text;
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Sname", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BirthDate", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Phone", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelliCode", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KharidarID", System.Data.SqlDbType.Int));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter updatecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            updatecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.UpdateCommand.Parameters.Add(updatecommand_sync_row_countParameter);
            // tblKharidaranSyncTableSelectConflictDeletedRowsCommand command.
            this.SelectConflictDeletedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictDeletedRowsCommand.CommandText = "SELECT [KharidarID], [DeletionDate] FROM dbo.tblKharidaran_Tombstone WHERE ([Khar" +
                "idarID] = @KharidarID)";
            this.SelectConflictDeletedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictDeletedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KharidarID", System.Data.SqlDbType.Int));
            // tblKharidaranSyncTableSelectConflictUpdatedRowsCommand command.
            this.SelectConflictUpdatedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictUpdatedRowsCommand.CommandText = "SELECT [KharidarID], [Name], [Sname], [BirthDate], [Phone], [MelliCode], [Address" +
                "], [LastEditDate], [CreationDate] FROM dbo.tblKharidaran WHERE ([KharidarID] = @" +
                "KharidarID)";
            this.SelectConflictUpdatedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictUpdatedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KharidarID", System.Data.SqlDbType.Int));
            // tblKharidaranSyncTableSelectIncrementalInsertsCommand command.
            this.SelectIncrementalInsertsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalInsertsCommand.CommandText = "SELECT [KharidarID], [Name], [Sname], [BirthDate], [Phone], [MelliCode], [Address" +
                "], [LastEditDate], [CreationDate] FROM dbo.tblKharidaran WHERE ([CreationDate] >" +
                " @sync_last_received_anchor AND [CreationDate] <= @sync_new_received_anchor)";
            this.SelectIncrementalInsertsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // tblKharidaranSyncTableSelectIncrementalDeletesCommand command.
            this.SelectIncrementalDeletesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalDeletesCommand.CommandText = "SELECT [KharidarID], [DeletionDate] FROM dbo.tblKharidaran_Tombstone WHERE (@sync" +
                "_initialized = 1 AND [DeletionDate] > @sync_last_received_anchor AND [DeletionDa" +
                "te] <= @sync_new_received_anchor)";
            this.SelectIncrementalDeletesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_initialized", System.Data.SqlDbType.Bit));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // tblKharidaranSyncTableSelectIncrementalUpdatesCommand command.
            this.SelectIncrementalUpdatesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalUpdatesCommand.CommandText = @"SELECT [KharidarID], [Name], [Sname], [BirthDate], [Phone], [MelliCode], [Address], [LastEditDate], [CreationDate] FROM dbo.tblKharidaran WHERE ([LastEditDate] > @sync_last_received_anchor AND [LastEditDate] <= @sync_new_received_anchor AND [CreationDate] <= @sync_last_received_anchor)";
            this.SelectIncrementalUpdatesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeAdapterProperties() {
            this.TableName = "tblKharidaran";
        }
    }
    
    public partial class tblMelksSyncAdapter : Microsoft.Synchronization.Data.Server.SyncAdapter {
        
        partial void OnInitialized();
        
        public tblMelksSyncAdapter() {
            this.InitializeCommands();
            this.InitializeAdapterProperties();
            this.OnInitialized();
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeCommands() {
            // tblMelksSyncTableInsertCommand command.
            this.InsertCommand = new System.Data.SqlClient.SqlCommand();
            this.InsertCommand.CommandText = @" SET IDENTITY_INSERT dbo.tblMelks ON INSERT INTO dbo.tblMelks ([MelkID], [MetraZH], [KarbariType], [Type], [SanadStatus], [ParvanehNumber], [RegisterNumber], [LastEditDate], [CreationDate]) VALUES (@MelkID, @MetraZH, @KarbariType, @Type, @SanadStatus, @ParvanehNumber, @RegisterNumber, @LastEditDate, @CreationDate) SET @sync_row_count = @@rowcount SET IDENTITY_INSERT dbo.tblMelks OFF ";
            this.InsertCommand.CommandType = System.Data.CommandType.Text;
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelkID", System.Data.SqlDbType.Int));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MetraZH", System.Data.SqlDbType.Float));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KarbariType", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Type", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SanadStatus", System.Data.SqlDbType.Int));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ParvanehNumber", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RegisterNumber", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter insertcommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            insertcommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.InsertCommand.Parameters.Add(insertcommand_sync_row_countParameter);
            // tblMelksSyncTableDeleteCommand command.
            this.DeleteCommand = new System.Data.SqlClient.SqlCommand();
            this.DeleteCommand.CommandText = "DELETE FROM dbo.tblMelks WHERE ([MelkID] = @MelkID) AND (@sync_force_write = 1 OR" +
                " ([LastEditDate] <= @sync_last_received_anchor)) SET @sync_row_count = @@rowcoun" +
                "t";
            this.DeleteCommand.CommandType = System.Data.CommandType.Text;
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelkID", System.Data.SqlDbType.Int));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter deletecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            deletecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.DeleteCommand.Parameters.Add(deletecommand_sync_row_countParameter);
            // tblMelksSyncTableUpdateCommand command.
            this.UpdateCommand = new System.Data.SqlClient.SqlCommand();
            this.UpdateCommand.CommandText = @"UPDATE dbo.tblMelks SET [MetraZH] = @MetraZH, [KarbariType] = @KarbariType, [Type] = @Type, [SanadStatus] = @SanadStatus, [ParvanehNumber] = @ParvanehNumber, [RegisterNumber] = @RegisterNumber, [LastEditDate] = @LastEditDate, [CreationDate] = @CreationDate WHERE ([MelkID] = @MelkID) AND (@sync_force_write = 1 OR ([LastEditDate] <= @sync_last_received_anchor)) SET @sync_row_count = @@rowcount";
            this.UpdateCommand.CommandType = System.Data.CommandType.Text;
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MetraZH", System.Data.SqlDbType.Float));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KarbariType", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Type", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SanadStatus", System.Data.SqlDbType.Int));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ParvanehNumber", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RegisterNumber", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelkID", System.Data.SqlDbType.Int));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter updatecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            updatecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.UpdateCommand.Parameters.Add(updatecommand_sync_row_countParameter);
            // tblMelksSyncTableSelectConflictDeletedRowsCommand command.
            this.SelectConflictDeletedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictDeletedRowsCommand.CommandText = "SELECT [MelkID], [DeletionDate] FROM dbo.tblMelks_Tombstone WHERE ([MelkID] = @Me" +
                "lkID)";
            this.SelectConflictDeletedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictDeletedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelkID", System.Data.SqlDbType.Int));
            // tblMelksSyncTableSelectConflictUpdatedRowsCommand command.
            this.SelectConflictUpdatedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictUpdatedRowsCommand.CommandText = "SELECT [MelkID], [MetraZH], [KarbariType], [Type], [SanadStatus], [ParvanehNumber" +
                "], [RegisterNumber], [LastEditDate], [CreationDate] FROM dbo.tblMelks WHERE ([Me" +
                "lkID] = @MelkID)";
            this.SelectConflictUpdatedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictUpdatedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MelkID", System.Data.SqlDbType.Int));
            // tblMelksSyncTableSelectIncrementalInsertsCommand command.
            this.SelectIncrementalInsertsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalInsertsCommand.CommandText = "SELECT [MelkID], [MetraZH], [KarbariType], [Type], [SanadStatus], [ParvanehNumber" +
                "], [RegisterNumber], [LastEditDate], [CreationDate] FROM dbo.tblMelks WHERE ([Cr" +
                "eationDate] > @sync_last_received_anchor AND [CreationDate] <= @sync_new_receive" +
                "d_anchor)";
            this.SelectIncrementalInsertsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // tblMelksSyncTableSelectIncrementalDeletesCommand command.
            this.SelectIncrementalDeletesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalDeletesCommand.CommandText = "SELECT [MelkID], [DeletionDate] FROM dbo.tblMelks_Tombstone WHERE (@sync_initiali" +
                "zed = 1 AND [DeletionDate] > @sync_last_received_anchor AND [DeletionDate] <= @s" +
                "ync_new_received_anchor)";
            this.SelectIncrementalDeletesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_initialized", System.Data.SqlDbType.Bit));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // tblMelksSyncTableSelectIncrementalUpdatesCommand command.
            this.SelectIncrementalUpdatesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalUpdatesCommand.CommandText = @"SELECT [MelkID], [MetraZH], [KarbariType], [Type], [SanadStatus], [ParvanehNumber], [RegisterNumber], [LastEditDate], [CreationDate] FROM dbo.tblMelks WHERE ([LastEditDate] > @sync_last_received_anchor AND [LastEditDate] <= @sync_new_received_anchor AND [CreationDate] <= @sync_last_received_anchor)";
            this.SelectIncrementalUpdatesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeAdapterProperties() {
            this.TableName = "tblMelks";
        }
    }
    
    public partial class tblMoamelehTypeSyncAdapter : Microsoft.Synchronization.Data.Server.SyncAdapter {
        
        partial void OnInitialized();
        
        public tblMoamelehTypeSyncAdapter() {
            this.InitializeCommands();
            this.InitializeAdapterProperties();
            this.OnInitialized();
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeCommands() {
            // tblMoamelehTypeSyncTableInsertCommand command.
            this.InsertCommand = new System.Data.SqlClient.SqlCommand();
            this.InsertCommand.CommandText = @" SET IDENTITY_INSERT dbo.tblMoamelehType ON INSERT INTO dbo.tblMoamelehType ([MoamelehTypeID], [MoamelehType], [LastEditDate], [CreationDate]) VALUES (@MoamelehTypeID, @MoamelehType, @LastEditDate, @CreationDate) SET @sync_row_count = @@rowcount SET IDENTITY_INSERT dbo.tblMoamelehType OFF ";
            this.InsertCommand.CommandType = System.Data.CommandType.Text;
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MoamelehTypeID", System.Data.SqlDbType.Int));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MoamelehType", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter insertcommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            insertcommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.InsertCommand.Parameters.Add(insertcommand_sync_row_countParameter);
            // tblMoamelehTypeSyncTableDeleteCommand command.
            this.DeleteCommand = new System.Data.SqlClient.SqlCommand();
            this.DeleteCommand.CommandText = "DELETE FROM dbo.tblMoamelehType WHERE ([MoamelehTypeID] = @MoamelehTypeID) AND (@" +
                "sync_force_write = 1 OR ([LastEditDate] <= @sync_last_received_anchor)) SET @syn" +
                "c_row_count = @@rowcount";
            this.DeleteCommand.CommandType = System.Data.CommandType.Text;
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MoamelehTypeID", System.Data.SqlDbType.Int));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter deletecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            deletecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.DeleteCommand.Parameters.Add(deletecommand_sync_row_countParameter);
            // tblMoamelehTypeSyncTableUpdateCommand command.
            this.UpdateCommand = new System.Data.SqlClient.SqlCommand();
            this.UpdateCommand.CommandText = @"UPDATE dbo.tblMoamelehType SET [MoamelehType] = @MoamelehType, [LastEditDate] = @LastEditDate, [CreationDate] = @CreationDate WHERE ([MoamelehTypeID] = @MoamelehTypeID) AND (@sync_force_write = 1 OR ([LastEditDate] <= @sync_last_received_anchor)) SET @sync_row_count = @@rowcount";
            this.UpdateCommand.CommandType = System.Data.CommandType.Text;
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MoamelehType", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MoamelehTypeID", System.Data.SqlDbType.Int));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter updatecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            updatecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.UpdateCommand.Parameters.Add(updatecommand_sync_row_countParameter);
            // tblMoamelehTypeSyncTableSelectConflictDeletedRowsCommand command.
            this.SelectConflictDeletedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictDeletedRowsCommand.CommandText = "SELECT [MoamelehTypeID], [DeletionDate] FROM dbo.tblMoamelehType_Tombstone WHERE " +
                "([MoamelehTypeID] = @MoamelehTypeID)";
            this.SelectConflictDeletedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictDeletedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MoamelehTypeID", System.Data.SqlDbType.Int));
            // tblMoamelehTypeSyncTableSelectConflictUpdatedRowsCommand command.
            this.SelectConflictUpdatedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictUpdatedRowsCommand.CommandText = "SELECT [MoamelehTypeID], [MoamelehType], [LastEditDate], [CreationDate] FROM dbo." +
                "tblMoamelehType WHERE ([MoamelehTypeID] = @MoamelehTypeID)";
            this.SelectConflictUpdatedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictUpdatedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MoamelehTypeID", System.Data.SqlDbType.Int));
            // tblMoamelehTypeSyncTableSelectIncrementalInsertsCommand command.
            this.SelectIncrementalInsertsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalInsertsCommand.CommandText = "SELECT [MoamelehTypeID], [MoamelehType], [LastEditDate], [CreationDate] FROM dbo." +
                "tblMoamelehType WHERE ([CreationDate] > @sync_last_received_anchor AND [Creation" +
                "Date] <= @sync_new_received_anchor)";
            this.SelectIncrementalInsertsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // tblMoamelehTypeSyncTableSelectIncrementalDeletesCommand command.
            this.SelectIncrementalDeletesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalDeletesCommand.CommandText = "SELECT [MoamelehTypeID], [DeletionDate] FROM dbo.tblMoamelehType_Tombstone WHERE " +
                "(@sync_initialized = 1 AND [DeletionDate] > @sync_last_received_anchor AND [Dele" +
                "tionDate] <= @sync_new_received_anchor)";
            this.SelectIncrementalDeletesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_initialized", System.Data.SqlDbType.Bit));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // tblMoamelehTypeSyncTableSelectIncrementalUpdatesCommand command.
            this.SelectIncrementalUpdatesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalUpdatesCommand.CommandText = "SELECT [MoamelehTypeID], [MoamelehType], [LastEditDate], [CreationDate] FROM dbo." +
                "tblMoamelehType WHERE ([LastEditDate] > @sync_last_received_anchor AND [LastEdit" +
                "Date] <= @sync_new_received_anchor AND [CreationDate] <= @sync_last_received_anc" +
                "hor)";
            this.SelectIncrementalUpdatesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeAdapterProperties() {
            this.TableName = "tblMoamelehType";
        }
    }
    
    public partial class tblSanadsStatuseSyncAdapter : Microsoft.Synchronization.Data.Server.SyncAdapter {
        
        partial void OnInitialized();
        
        public tblSanadsStatuseSyncAdapter() {
            this.InitializeCommands();
            this.InitializeAdapterProperties();
            this.OnInitialized();
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeCommands() {
            // tblSanadsStatuseSyncTableInsertCommand command.
            this.InsertCommand = new System.Data.SqlClient.SqlCommand();
            this.InsertCommand.CommandText = @" SET IDENTITY_INSERT dbo.tblSanadsStatuse ON INSERT INTO dbo.tblSanadsStatuse ([sanadStatuseID], [sanadStatusDescript], [LastEditDate], [CreationDate]) VALUES (@sanadStatuseID, @sanadStatusDescript, @LastEditDate, @CreationDate) SET @sync_row_count = @@rowcount SET IDENTITY_INSERT dbo.tblSanadsStatuse OFF ";
            this.InsertCommand.CommandType = System.Data.CommandType.Text;
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sanadStatuseID", System.Data.SqlDbType.Int));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sanadStatusDescript", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter insertcommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            insertcommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.InsertCommand.Parameters.Add(insertcommand_sync_row_countParameter);
            // tblSanadsStatuseSyncTableDeleteCommand command.
            this.DeleteCommand = new System.Data.SqlClient.SqlCommand();
            this.DeleteCommand.CommandText = "DELETE FROM dbo.tblSanadsStatuse WHERE ([sanadStatuseID] = @sanadStatuseID) AND (" +
                "@sync_force_write = 1 OR ([LastEditDate] <= @sync_last_received_anchor)) SET @sy" +
                "nc_row_count = @@rowcount";
            this.DeleteCommand.CommandType = System.Data.CommandType.Text;
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sanadStatuseID", System.Data.SqlDbType.Int));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter deletecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            deletecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.DeleteCommand.Parameters.Add(deletecommand_sync_row_countParameter);
            // tblSanadsStatuseSyncTableUpdateCommand command.
            this.UpdateCommand = new System.Data.SqlClient.SqlCommand();
            this.UpdateCommand.CommandText = @"UPDATE dbo.tblSanadsStatuse SET [sanadStatusDescript] = @sanadStatusDescript, [LastEditDate] = @LastEditDate, [CreationDate] = @CreationDate WHERE ([sanadStatuseID] = @sanadStatuseID) AND (@sync_force_write = 1 OR ([LastEditDate] <= @sync_last_received_anchor)) SET @sync_row_count = @@rowcount";
            this.UpdateCommand.CommandType = System.Data.CommandType.Text;
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sanadStatusDescript", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sanadStatuseID", System.Data.SqlDbType.Int));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter updatecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            updatecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.UpdateCommand.Parameters.Add(updatecommand_sync_row_countParameter);
            // tblSanadsStatuseSyncTableSelectConflictDeletedRowsCommand command.
            this.SelectConflictDeletedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictDeletedRowsCommand.CommandText = "SELECT [sanadStatuseID], [DeletionDate] FROM dbo.tblSanadsStatuse_Tombstone WHERE" +
                " ([sanadStatuseID] = @sanadStatuseID)";
            this.SelectConflictDeletedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictDeletedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sanadStatuseID", System.Data.SqlDbType.Int));
            // tblSanadsStatuseSyncTableSelectConflictUpdatedRowsCommand command.
            this.SelectConflictUpdatedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictUpdatedRowsCommand.CommandText = "SELECT [sanadStatuseID], [sanadStatusDescript], [LastEditDate], [CreationDate] FR" +
                "OM dbo.tblSanadsStatuse WHERE ([sanadStatuseID] = @sanadStatuseID)";
            this.SelectConflictUpdatedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictUpdatedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sanadStatuseID", System.Data.SqlDbType.Int));
            // tblSanadsStatuseSyncTableSelectIncrementalInsertsCommand command.
            this.SelectIncrementalInsertsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalInsertsCommand.CommandText = "SELECT [sanadStatuseID], [sanadStatusDescript], [LastEditDate], [CreationDate] FR" +
                "OM dbo.tblSanadsStatuse WHERE ([CreationDate] > @sync_last_received_anchor AND [" +
                "CreationDate] <= @sync_new_received_anchor)";
            this.SelectIncrementalInsertsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // tblSanadsStatuseSyncTableSelectIncrementalDeletesCommand command.
            this.SelectIncrementalDeletesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalDeletesCommand.CommandText = "SELECT [sanadStatuseID], [DeletionDate] FROM dbo.tblSanadsStatuse_Tombstone WHERE" +
                " (@sync_initialized = 1 AND [DeletionDate] > @sync_last_received_anchor AND [Del" +
                "etionDate] <= @sync_new_received_anchor)";
            this.SelectIncrementalDeletesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_initialized", System.Data.SqlDbType.Bit));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // tblSanadsStatuseSyncTableSelectIncrementalUpdatesCommand command.
            this.SelectIncrementalUpdatesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalUpdatesCommand.CommandText = "SELECT [sanadStatuseID], [sanadStatusDescript], [LastEditDate], [CreationDate] FR" +
                "OM dbo.tblSanadsStatuse WHERE ([LastEditDate] > @sync_last_received_anchor AND [" +
                "LastEditDate] <= @sync_new_received_anchor AND [CreationDate] <= @sync_last_rece" +
                "ived_anchor)";
            this.SelectIncrementalUpdatesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeAdapterProperties() {
            this.TableName = "tblSanadsStatuse";
        }
    }
    
    public partial class userInfoSyncAdapter : Microsoft.Synchronization.Data.Server.SyncAdapter {
        
        partial void OnInitialized();
        
        public userInfoSyncAdapter() {
            this.InitializeCommands();
            this.InitializeAdapterProperties();
            this.OnInitialized();
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeCommands() {
            // userInfoSyncTableInsertCommand command.
            this.InsertCommand = new System.Data.SqlClient.SqlCommand();
            this.InsertCommand.CommandText = @" SET IDENTITY_INSERT dbo.userInfo ON INSERT INTO dbo.userInfo ([userID], [UserName], [PassWord], [LastEditDate], [CreationDate]) VALUES (@userID, @UserName, @PassWord, @LastEditDate, @CreationDate) SET @sync_row_count = @@rowcount SET IDENTITY_INSERT dbo.userInfo OFF ";
            this.InsertCommand.CommandType = System.Data.CommandType.Text;
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@userID", System.Data.SqlDbType.Int));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@UserName", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PassWord", System.Data.SqlDbType.NVarChar));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter insertcommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            insertcommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.InsertCommand.Parameters.Add(insertcommand_sync_row_countParameter);
            // userInfoSyncTableDeleteCommand command.
            this.DeleteCommand = new System.Data.SqlClient.SqlCommand();
            this.DeleteCommand.CommandText = "DELETE FROM dbo.userInfo WHERE ([UserName] = @UserName) AND (@sync_force_write = " +
                "1 OR ([LastEditDate] <= @sync_last_received_anchor)) SET @sync_row_count = @@row" +
                "count";
            this.DeleteCommand.CommandType = System.Data.CommandType.Text;
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@UserName", System.Data.SqlDbType.NVarChar));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter deletecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            deletecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.DeleteCommand.Parameters.Add(deletecommand_sync_row_countParameter);
            // userInfoSyncTableUpdateCommand command.
            this.UpdateCommand = new System.Data.SqlClient.SqlCommand();
            this.UpdateCommand.CommandText = "UPDATE dbo.userInfo SET [PassWord] = @PassWord, [LastEditDate] = @LastEditDate, [" +
                "CreationDate] = @CreationDate WHERE ([UserName] = @UserName) AND (@sync_force_wr" +
                "ite = 1 OR ([LastEditDate] <= @sync_last_received_anchor)) SET @sync_row_count =" +
                " @@rowcount";
            this.UpdateCommand.CommandType = System.Data.CommandType.Text;
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PassWord", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastEditDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CreationDate", System.Data.SqlDbType.DateTime));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@UserName", System.Data.SqlDbType.NVarChar));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_force_write", System.Data.SqlDbType.Bit));
            this.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            System.Data.SqlClient.SqlParameter updatecommand_sync_row_countParameter = new System.Data.SqlClient.SqlParameter("@sync_row_count", System.Data.SqlDbType.Int);
            updatecommand_sync_row_countParameter.Direction = System.Data.ParameterDirection.Output;
            this.UpdateCommand.Parameters.Add(updatecommand_sync_row_countParameter);
            // userInfoSyncTableSelectConflictDeletedRowsCommand command.
            this.SelectConflictDeletedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictDeletedRowsCommand.CommandText = "SELECT [UserName], [DeletionDate] FROM dbo.userInfo_Tombstone WHERE ([UserName] =" +
                " @UserName)";
            this.SelectConflictDeletedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictDeletedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@UserName", System.Data.SqlDbType.NVarChar));
            // userInfoSyncTableSelectConflictUpdatedRowsCommand command.
            this.SelectConflictUpdatedRowsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectConflictUpdatedRowsCommand.CommandText = "SELECT [userID], [UserName], [PassWord], [LastEditDate], [CreationDate] FROM dbo." +
                "userInfo WHERE ([UserName] = @UserName)";
            this.SelectConflictUpdatedRowsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectConflictUpdatedRowsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@UserName", System.Data.SqlDbType.NVarChar));
            // userInfoSyncTableSelectIncrementalInsertsCommand command.
            this.SelectIncrementalInsertsCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalInsertsCommand.CommandText = "SELECT [userID], [UserName], [PassWord], [LastEditDate], [CreationDate] FROM dbo." +
                "userInfo WHERE ([CreationDate] > @sync_last_received_anchor AND [CreationDate] <" +
                "= @sync_new_received_anchor)";
            this.SelectIncrementalInsertsCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalInsertsCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // userInfoSyncTableSelectIncrementalDeletesCommand command.
            this.SelectIncrementalDeletesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalDeletesCommand.CommandText = "SELECT [UserName], [DeletionDate] FROM dbo.userInfo_Tombstone WHERE (@sync_initia" +
                "lized = 1 AND [DeletionDate] > @sync_last_received_anchor AND [DeletionDate] <= " +
                "@sync_new_received_anchor)";
            this.SelectIncrementalDeletesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_initialized", System.Data.SqlDbType.Bit));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalDeletesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
            // userInfoSyncTableSelectIncrementalUpdatesCommand command.
            this.SelectIncrementalUpdatesCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectIncrementalUpdatesCommand.CommandText = "SELECT [userID], [UserName], [PassWord], [LastEditDate], [CreationDate] FROM dbo." +
                "userInfo WHERE ([LastEditDate] > @sync_last_received_anchor AND [LastEditDate] <" +
                "= @sync_new_received_anchor AND [CreationDate] <= @sync_last_received_anchor)";
            this.SelectIncrementalUpdatesCommand.CommandType = System.Data.CommandType.Text;
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_last_received_anchor", System.Data.SqlDbType.DateTime));
            this.SelectIncrementalUpdatesCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime));
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeAdapterProperties() {
            this.TableName = "userInfo";
        }
    }
    
    public partial class BongahDB_DataCacheServerSyncProvider : Microsoft.Synchronization.Data.Server.DbServerSyncProvider {
        
        private tblContractsSyncAdapter _tblContractsSyncAdapter;
        
        private tblForuShandeganSyncAdapter _tblForuShandeganSyncAdapter;
        
        private tblKharidaranSyncAdapter _tblKharidaranSyncAdapter;
        
        private tblMelksSyncAdapter _tblMelksSyncAdapter;
        
        private tblMoamelehTypeSyncAdapter _tblMoamelehTypeSyncAdapter;
        
        private tblSanadsStatuseSyncAdapter _tblSanadsStatuseSyncAdapter;
        
        private userInfoSyncAdapter _userInfoSyncAdapter;
        
        partial void OnInitialized();
        
        public BongahDB_DataCacheServerSyncProvider() {
            string connectionString = global::BongahCS.Properties.Settings.Default.BongahDB_DataConnectionString;
            this.InitializeConnection(connectionString);
            this.InitializeSyncAdapters();
            this.InitializeNewAnchorCommand();
            this.OnInitialized();
        }
        
        public BongahDB_DataCacheServerSyncProvider(string connectionString) {
            this.InitializeConnection(connectionString);
            this.InitializeSyncAdapters();
            this.InitializeNewAnchorCommand();
            this.OnInitialized();
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public tblContractsSyncAdapter tblContractsSyncAdapter {
            get {
                return this._tblContractsSyncAdapter;
            }
            set {
                this._tblContractsSyncAdapter = value;
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public tblForuShandeganSyncAdapter tblForuShandeganSyncAdapter {
            get {
                return this._tblForuShandeganSyncAdapter;
            }
            set {
                this._tblForuShandeganSyncAdapter = value;
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public tblKharidaranSyncAdapter tblKharidaranSyncAdapter {
            get {
                return this._tblKharidaranSyncAdapter;
            }
            set {
                this._tblKharidaranSyncAdapter = value;
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public tblMelksSyncAdapter tblMelksSyncAdapter {
            get {
                return this._tblMelksSyncAdapter;
            }
            set {
                this._tblMelksSyncAdapter = value;
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public tblMoamelehTypeSyncAdapter tblMoamelehTypeSyncAdapter {
            get {
                return this._tblMoamelehTypeSyncAdapter;
            }
            set {
                this._tblMoamelehTypeSyncAdapter = value;
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public tblSanadsStatuseSyncAdapter tblSanadsStatuseSyncAdapter {
            get {
                return this._tblSanadsStatuseSyncAdapter;
            }
            set {
                this._tblSanadsStatuseSyncAdapter = value;
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public userInfoSyncAdapter userInfoSyncAdapter {
            get {
                return this._userInfoSyncAdapter;
            }
            set {
                this._userInfoSyncAdapter = value;
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeConnection(string connectionString) {
            this.Connection = new System.Data.SqlClient.SqlConnection(connectionString);
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeSyncAdapters() {
            // Create SyncAdapters.
            this._tblContractsSyncAdapter = new tblContractsSyncAdapter();
            this.SyncAdapters.Add(this._tblContractsSyncAdapter);
            this._tblForuShandeganSyncAdapter = new tblForuShandeganSyncAdapter();
            this.SyncAdapters.Add(this._tblForuShandeganSyncAdapter);
            this._tblKharidaranSyncAdapter = new tblKharidaranSyncAdapter();
            this.SyncAdapters.Add(this._tblKharidaranSyncAdapter);
            this._tblMelksSyncAdapter = new tblMelksSyncAdapter();
            this.SyncAdapters.Add(this._tblMelksSyncAdapter);
            this._tblMoamelehTypeSyncAdapter = new tblMoamelehTypeSyncAdapter();
            this.SyncAdapters.Add(this._tblMoamelehTypeSyncAdapter);
            this._tblSanadsStatuseSyncAdapter = new tblSanadsStatuseSyncAdapter();
            this.SyncAdapters.Add(this._tblSanadsStatuseSyncAdapter);
            this._userInfoSyncAdapter = new userInfoSyncAdapter();
            this.SyncAdapters.Add(this._userInfoSyncAdapter);
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitializeNewAnchorCommand() {
            // selectNewAnchorCmd command.
            this.SelectNewAnchorCommand = new System.Data.SqlClient.SqlCommand();
            this.SelectNewAnchorCommand.CommandText = "Select @sync_new_received_anchor = GETUTCDATE()";
            this.SelectNewAnchorCommand.CommandType = System.Data.CommandType.Text;
            System.Data.SqlClient.SqlParameter selectnewanchorcommand_sync_new_received_anchorParameter = new System.Data.SqlClient.SqlParameter("@sync_new_received_anchor", System.Data.SqlDbType.DateTime);
            selectnewanchorcommand_sync_new_received_anchorParameter.Direction = System.Data.ParameterDirection.Output;
            this.SelectNewAnchorCommand.Parameters.Add(selectnewanchorcommand_sync_new_received_anchorParameter);
        }
    }
}
