public SampleSyncAgent() { //Instantiate a client synchronization provider and specify it //as the local provider for this synchronization agent. this.LocalProvider = new SampleClientSyncProvider(); //Instantiate a server synchronization provider and specify it //as the remote provider for this synchronization agent. this.RemoteProvider = new SampleServerSyncProvider(); //Add the Customer table: specify a synchronization direction of //Bidirectional, and that an existing table should be dropped. SyncTable customerSyncTable = new SyncTable("Customer"); customerSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable; customerSyncTable.SyncDirection = SyncDirection.Bidirectional; this.Configuration.SyncTables.Add(customerSyncTable); }
// SqlCeConnection ce = null; public void CreateInitialLocalDB(string strConnectionString, bool isCreated) { try { strClientConnectionString = strConnectionString; // sync = new SqlCeClientSyncProvider(strClientConnectionString); clientSyncProvider = new SqlCeClientSyncProvider(strClientConnectionString); if (!isCreated) { SqlCeEngine clientEngine = new SqlCeEngine(strClientConnectionString); clientEngine.CreateDatabase(); clientEngine.Dispose(); tblCallTable = CreateCallTable(); tblLeadsTable = CreateLeadsTable(); tblCallBackTable = CreateCallBackTable(); } else { tblCallTable = new SyncTable("Call"); tblCallTable.SyncDirection = SyncDirection.UploadOnly; tblLeadsTable = new SyncTable("Leads"); tblLeadsTable.SyncDirection = SyncDirection.UploadOnly; tblCallBackTable = new SyncTable("CallBack"); tblCallBackTable.SyncDirection = SyncDirection.UploadOnly; } strClientConnectionString = strConnectionString; // sync = new SqlCeClientSyncProvider(strClientConnectionString); serverSyncProvider = new DbServerSyncProvider(); syncAgent = new SyncAgent(); // syncAgent.ServerSyncProvider = serverSyncProvider; syncAgent.RemoteProvider = serverSyncProvider; serverConnection = new SqlConnection(VMuktiInfo.MainConnectionString); serverSyncProvider.Connection = serverConnection; //SqlCommand cmdAnchor = new SqlCommand(); // cmdAnchor.CommandType = CommandType.Text; // cmdAnchor.CommandText = "SELECT @@DBTS"; // serverSyncProvider.SelectNewAnchorCommand = cmdAnchor; // SqlCommand cmdClientId = new SqlCommand(); // cmdClientId.CommandType = CommandType.Text; // cmdClientId.CommandText = "SELECT 1"; // serverSyncProvider.SelectClientIdCommand = cmdClientId; //syncAgent.ClientSyncProvider = clientSyncProvider; syncAgent.LocalProvider = clientSyncProvider; myGroup = new SyncGroup("DialerGroup"); tblCallTable.SyncGroup = myGroup; tblLeadsTable.SyncGroup = myGroup; tblCallBackTable.SyncGroup = myGroup; //syncAgent.SyncTables.Add(tblCallTable); //syncAgent.SyncTables.Add(tblLeadsTable); //syncAgent.SyncTables.Add(tblCallBackTable); syncAgent.Configuration.SyncTables.Add(tblCallTable); syncAgent.Configuration.SyncTables.Add(tblLeadsTable); syncAgent.Configuration.SyncTables.Add(tblCallBackTable); CallAdapter = new SqlSyncAdapterBuilder(); CallAdapter.Connection = serverConnection; CallAdapter.SyncDirection = SyncDirection.UploadOnly; CallAdapter.TableName = "Call"; CallAdapter.DataColumns.Add("ID"); CallAdapter.DataColumns.Add("LeadID"); CallAdapter.DataColumns.Add("CalledDate"); CallAdapter.DataColumns.Add("ModifiedDate"); CallAdapter.DataColumns.Add("ModifiedBy"); CallAdapter.DataColumns.Add("GeneratedBy"); CallAdapter.DataColumns.Add("StartDate"); CallAdapter.DataColumns.Add("StartTime"); CallAdapter.DataColumns.Add("DurationInSecond"); CallAdapter.DataColumns.Add("DespositionID"); CallAdapter.DataColumns.Add("CampaignID"); CallAdapter.DataColumns.Add("ConfID"); CallAdapter.DataColumns.Add("IsDeleted"); CallAdapter.DataColumns.Add("CallNote"); CallAdapter.DataColumns.Add("IsDNC"); CallAdapter.DataColumns.Add("IsGlobal"); CallAdapterSyncAdapter = CallAdapter.ToSyncAdapter(); CallAdapterSyncAdapter.DeleteCommand = null; serverSyncProvider.SyncAdapters.Add(CallAdapterSyncAdapter); LeadAdapter = new SqlSyncAdapterBuilder(); LeadAdapter.Connection = serverConnection; LeadAdapter.SyncDirection = SyncDirection.UploadOnly; LeadAdapter.TableName = "Leads"; LeadAdapter.DataColumns.Add("ID"); LeadAdapter.DataColumns.Add("PhoneNo"); LeadAdapter.DataColumns.Add("LeadFormatID"); LeadAdapter.DataColumns.Add("CreatedDate"); LeadAdapter.DataColumns.Add("CreatedBy"); LeadAdapter.DataColumns.Add("DeletedDate"); LeadAdapter.DataColumns.Add("DeletedBy"); LeadAdapter.DataColumns.Add("IsDeleted"); LeadAdapter.DataColumns.Add("ModifiedDate"); LeadAdapter.DataColumns.Add("ModifiedBy"); LeadAdapter.DataColumns.Add("DNCFlag"); LeadAdapter.DataColumns.Add("DNCBy"); LeadAdapter.DataColumns.Add("ListID"); LeadAdapter.DataColumns.Add("LocationID"); LeadAdapter.DataColumns.Add("RecycleCount"); LeadAdapter.DataColumns.Add("Status"); LeadAdapter.DataColumns.Add("IsGlobalDNC"); //LeadAdapter.DataColumns.Add("LastEditDate"); //LeadAdapter.DataColumns.Add("CreationDate"); LeadAdapterSyncAdapter = LeadAdapter.ToSyncAdapter(); LeadAdapterSyncAdapter.DeleteCommand = null; LeadAdapterSyncAdapter.InsertCommand = null; //LeadAdapterSyncAdapter.ColumnMappings.Add("Status", "Status"); //LeadAdapterSyncAdapter.ColumnMappings.Add("DNCFlag", "DNCFlag"); //LeadAdapterSyncAdapter.ColumnMappings.Add("DNCBy", "DNCBy"); serverSyncProvider.SyncAdapters.Add(LeadAdapterSyncAdapter); CallBackAdapter = new SqlSyncAdapterBuilder(); CallBackAdapter.Connection = serverConnection; CallBackAdapter.SyncDirection = SyncDirection.UploadOnly; CallBackAdapter.TableName = "CallBack"; CallBackAdapter.DataColumns.Add("ID"); CallBackAdapter.DataColumns.Add("CallID"); CallBackAdapter.DataColumns.Add("CallBackDate"); CallBackAdapter.DataColumns.Add("Comment"); CallBackAdapter.DataColumns.Add("IsPublic"); CallBackAdapter.DataColumns.Add("IsDeleted"); CallBackAdapterSyncAdapter = CallBackAdapter.ToSyncAdapter(); CallBackAdapterSyncAdapter.DeleteCommand = null; serverSyncProvider.SyncAdapters.Add(CallBackAdapterSyncAdapter); CheckPreviousSyncWithServer(); } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "CreateInitialLocalDB()", "ClsUserDataService.cs"); //MessageBox.Show("CreateInitialLocalDB: " + ex.Message); } }
private SyncTable CreateCallBackTable() { try { // if (!IsTableExits("CallBack")) { // SqlCeClientSyncProvider sync = new SqlCeClientSyncProvider(ClientConnectionString); tblCallBackTable = new SyncTable("CallBack"); tblCallBackTable.SyncDirection = SyncDirection.UploadOnly; SyncSchema syncSchemaCallBack = new SyncSchema(); syncSchemaCallBack.Tables.Add("CallBack"); syncSchemaCallBack.Tables["CallBack"].Columns.Add("ID"); syncSchemaCallBack.Tables["CallBack"].Columns["ID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCallBack.Tables["CallBack"].PrimaryKey = new string[] { "ID" }; syncSchemaCallBack.Tables["CallBack"].Columns["ID"].AutoIncrement = true; syncSchemaCallBack.Tables["CallBack"].Columns["ID"].AutoIncrementSeed = 1; syncSchemaCallBack.Tables["CallBack"].Columns["ID"].AutoIncrementStep = 1; syncSchemaCallBack.Tables["CallBack"].Columns["ID"].AllowNull = false; syncSchemaCallBack.Tables["CallBack"].Columns.Add("CallID"); syncSchemaCallBack.Tables["CallBack"].Columns["CallID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCallBack.Tables["CallBack"].Columns["CallID"].AllowNull = false; syncSchemaCallBack.Tables["CallBack"].Columns.Add("CallBackDate"); syncSchemaCallBack.Tables["CallBack"].Columns["CallBackDate"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaCallBack.Tables["CallBack"].Columns["CallBackDate"].AllowNull = false; syncSchemaCallBack.Tables["CallBack"].Columns.Add("Comment"); syncSchemaCallBack.Tables["CallBack"].Columns["Comment"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaCallBack.Tables["CallBack"].Columns["Comment"].MaxLength = 50; syncSchemaCallBack.Tables["CallBack"].Columns["Comment"].AllowNull = true; syncSchemaCallBack.Tables["CallBack"].Columns.Add("IsPublic"); syncSchemaCallBack.Tables["CallBack"].Columns["IsPublic"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaCallBack.Tables["CallBack"].Columns["IsPublic"].AllowNull = false; syncSchemaCallBack.Tables["CallBack"].Columns.Add("IsDeleted"); syncSchemaCallBack.Tables["CallBack"].Columns["IsDeleted"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaCallBack.Tables["CallBack"].Columns["IsDeleted"].AllowNull = false; // sync.CreateSchema(tblCallBackTable, syncSchemaCallBack); clientSyncProvider.CreateSchema(tblCallBackTable, syncSchemaCallBack); return tblCallBackTable; } } catch (Exception ex) { MessageBox.Show("Error In Creating CallBack Table"); VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "CreateCallBackTable()", "AutoDialer_ClsUserDataService.xaml.cs"); return null; } }
private SyncTable CreateDispositionTable() { try { tblDispositionTable = new SyncTable("Disposition"); tblDispositionTable.SyncDirection = SyncDirection.UploadOnly; SyncSchema syncSchemaDisposition = new SyncSchema(); syncSchemaDisposition.Tables.Add("Disposition"); syncSchemaDisposition.Tables["Disposition"].Columns.Add("ID"); syncSchemaDisposition.Tables["Disposition"].Columns["ID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaDisposition.Tables["Disposition"].PrimaryKey = new string[] { "ID" }; //syncSchemaDisposition.Tables["Disposition"].Columns["ID"].AutoIncrement = true; //syncSchemaDisposition.Tables["Disposition"].Columns["ID"].AutoIncrementSeed = 1; //syncSchemaDisposition.Tables["Disposition"].Columns["ID"].AutoIncrementStep = 1; syncSchemaDisposition.Tables["Disposition"].Columns["ID"].AllowNull = false; syncSchemaDisposition.Tables["Disposition"].Columns.Add("DespositionName"); syncSchemaDisposition.Tables["Disposition"].Columns["DespositionName"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaDisposition.Tables["Disposition"].Columns["DespositionName"].MaxLength = 50; syncSchemaDisposition.Tables["Disposition"].Columns["DespositionName"].AllowNull = false; syncSchemaDisposition.Tables["Disposition"].Columns.Add("Description"); syncSchemaDisposition.Tables["Disposition"].Columns["Description"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaDisposition.Tables["Disposition"].Columns["Description"].MaxLength = 250; syncSchemaDisposition.Tables["Disposition"].Columns["Description"].AllowNull = true; syncSchemaDisposition.Tables["Disposition"].Columns.Add("IsActive"); syncSchemaDisposition.Tables["Disposition"].Columns["IsActive"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaDisposition.Tables["Disposition"].Columns["IsActive"].AllowNull = true; syncSchemaDisposition.Tables["Disposition"].Columns.Add("IsDeleted"); syncSchemaDisposition.Tables["Disposition"].Columns["IsDeleted"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaDisposition.Tables["Disposition"].Columns["IsDeleted"].AllowNull = true; syncSchemaDisposition.Tables["Disposition"].Columns.Add("CreatedDate"); syncSchemaDisposition.Tables["Disposition"].Columns["CreatedDate"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaDisposition.Tables["Disposition"].Columns["CreatedDate"].AllowNull = true; syncSchemaDisposition.Tables["Disposition"].Columns.Add("CreatedBy"); syncSchemaDisposition.Tables["Disposition"].Columns["CreatedBy"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaDisposition.Tables["Disposition"].Columns["CreatedBy"].AllowNull = true; syncSchemaDisposition.Tables["Disposition"].Columns.Add("ModifiedDate"); syncSchemaDisposition.Tables["Disposition"].Columns["ModifiedDate"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaDisposition.Tables["Disposition"].Columns["ModifiedDate"].AllowNull = true; syncSchemaDisposition.Tables["Disposition"].Columns.Add("ModifiedBy"); syncSchemaDisposition.Tables["Disposition"].Columns["ModifiedBy"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaDisposition.Tables["Disposition"].Columns["ModifiedBy"].AllowNull = true; clientSyncProvider.CreateSchema(tblDispositionTable,syncSchemaDisposition); return tblDispositionTable; } catch (Exception ex) { MessageBox.Show("Error In Creating Disposition Table"); VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "CreateDispositionTable()", "AutoDialer_ClsUserDataService.xaml.cs"); return null; } }
public SyncTable CreateCallTable() { try { // if (!IsTableExits("Call")) { tblCallTable = new SyncTable("Call"); tblCallTable.SyncDirection = SyncDirection.UploadOnly; SyncSchema syncSchemaCall= new SyncSchema(); syncSchemaCall.Tables.Add("Call"); syncSchemaCall.Tables["Call"].Columns.Add("ID"); syncSchemaCall.Tables["Call"].Columns["ID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].PrimaryKey = new string[] { "ID" }; syncSchemaCall.Tables["Call"].Columns["ID"].AutoIncrement = true; syncSchemaCall.Tables["Call"].Columns["ID"].AutoIncrementSeed = 1; syncSchemaCall.Tables["Call"].Columns["ID"].AutoIncrementStep = 1; syncSchemaCall.Tables["Call"].Columns["ID"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("LeadID"); syncSchemaCall.Tables["Call"].Columns["LeadID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["LeadID"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("CalledDate"); syncSchemaCall.Tables["Call"].Columns["CalledDate"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaCall.Tables["Call"].Columns["CalledDate"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("ModifiedDate"); syncSchemaCall.Tables["Call"].Columns["ModifiedDate"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaCall.Tables["Call"].Columns["ModifiedDate"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("ModifiedBy"); syncSchemaCall.Tables["Call"].Columns["ModifiedBy"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["ModifiedBy"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("GeneratedBy"); syncSchemaCall.Tables["Call"].Columns["GeneratedBy"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["GeneratedBy"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("StartDate"); syncSchemaCall.Tables["Call"].Columns["StartDate"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaCall.Tables["Call"].Columns["StartDate"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("StartTime"); syncSchemaCall.Tables["Call"].Columns["StartTime"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaCall.Tables["Call"].Columns["StartTime"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("DurationInSecond"); syncSchemaCall.Tables["Call"].Columns["DurationInSecond"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["DurationInSecond"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("DespositionID"); syncSchemaCall.Tables["Call"].Columns["DespositionID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["DespositionID"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("CampaignID"); syncSchemaCall.Tables["Call"].Columns["CampaignID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["CampaignID"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("ConfID"); syncSchemaCall.Tables["Call"].Columns["ConfID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["ConfID"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("IsDeleted"); syncSchemaCall.Tables["Call"].Columns["IsDeleted"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaCall.Tables["Call"].Columns["IsDeleted"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("CallNote"); syncSchemaCall.Tables["Call"].Columns["CallNote"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaCall.Tables["Call"].Columns["CallNote"].MaxLength = 50; syncSchemaCall.Tables["Call"].Columns["CallNote"].AllowNull = true; syncSchemaCall.Tables["Call"].Columns.Add("IsDNC"); syncSchemaCall.Tables["Call"].Columns["IsDNC"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaCall.Tables["Call"].Columns["IsDNC"].AllowNull = true; syncSchemaCall.Tables["Call"].Columns.Add("IsGlobal"); syncSchemaCall.Tables["Call"].Columns["IsGlobal"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaCall.Tables["Call"].Columns["IsGlobal"].AllowNull = true; syncSchemaCall.Tables["Call"].Columns.Add("RecordedFileName"); syncSchemaCall.Tables["Call"].Columns["RecordedFileName"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaCall.Tables["Call"].Columns["RecordedFileName"].MaxLength = 100; syncSchemaCall.Tables["Call"].Columns["RecordedFileName"].AllowNull = true; //sync.CreateSchema(tblCallTable, syncSchemaCall); clientSyncProvider.CreateSchema(tblCallTable, syncSchemaCall); return tblCallTable; } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); return null; } }
public override Task ExecuteBatchCommandAsync(DbCommand cmd, Guid senderScopeId, IEnumerable <SyncRow> arrayItems, SyncTable schemaChangesTable, SyncTable failedRows, long?lastTimestamp, DbConnection connection, DbTransaction transaction = null) => throw new NotImplementedException();
/// <summary> /// this function will use for keeping track of supernode's node list. e.g. how many number of nodes(HTTP or P2P) is connected with perticular supernode. /// </summary> void fncCreateUserSuperNode_NodeInfoTable() { try { if (false == File.Exists(strLocalDBPath)) { SqlCeEngine clientEngine = new SqlCeEngine(ClientConnectionString); clientEngine.CreateDatabase(); } if (!IsTableExits("SuperNode_Node_Info")) { SqlCeClientSyncProvider sync = new SqlCeClientSyncProvider(ClientConnectionString); SyncTable tblSuperNode_Node_Info = new SyncTable("SuperNode_Node_Info"); SyncSchema syncSchemaLead = new SyncSchema(); syncSchemaLead.Tables.Add("SuperNode_Node_Info"); syncSchemaLead.Tables["SuperNode_Node_Info"].Columns.Add("ID"); syncSchemaLead.Tables["SuperNode_Node_Info"].Columns["ID"].ProviderDataType = SqlDbType.Int.ToString(); syncSchemaLead.Tables["SuperNode_Node_Info"].Columns["ID"].AutoIncrement = true; syncSchemaLead.Tables["SuperNode_Node_Info"].Columns["ID"].AutoIncrementSeed = 1; syncSchemaLead.Tables["SuperNode_Node_Info"].Columns["ID"].AutoIncrementStep = 1; syncSchemaLead.Tables["SuperNode_Node_Info"].PrimaryKey = new string[] { "ID" }; syncSchemaLead.Tables["SuperNode_Node_Info"].Columns.Add("SuperNode_Id"); syncSchemaLead.Tables["SuperNode_Node_Info"].Columns["SuperNode_Id"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["SuperNode_Node_Info"].Columns["SuperNode_Id"].MaxLength = 30; syncSchemaLead.Tables["SuperNode_Node_Info"].Columns["SuperNode_Id"].AllowNull = false; syncSchemaLead.Tables["SuperNode_Node_Info"].Columns.Add("Node_Name"); syncSchemaLead.Tables["SuperNode_Node_Info"].Columns["Node_Name"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["SuperNode_Node_Info"].Columns["Node_Name"].MaxLength = 50; syncSchemaLead.Tables["SuperNode_Node_Info"].Columns["Node_Name"].AllowNull = false; sync.CreateSchema(tblSuperNode_Node_Info, syncSchemaLead); } } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "fncCreateUserSuperNode_NodeInfoTable()", "Domains\\BootstrapServiceDomain.cs"); } }
private SyncTable CreateCallBackTable() { SqlCeConnection ce = null; try { // if (!IsTableExits("CallBack")) { // SqlCeClientSyncProvider sync = new SqlCeClientSyncProvider(ClientConnectionString); ce = new SqlCeConnection(strClientConnectionString); ce.Open(); // OpenConnection(true); tblCallBackTable = new SyncTable("CallBack"); tblCallBackTable.SyncDirection = SyncDirection.UploadOnly; SyncSchema syncSchemaCallBack = new SyncSchema(); syncSchemaCallBack.Tables.Add("CallBack"); syncSchemaCallBack.Tables["CallBack"].Columns.Add("ID"); syncSchemaCallBack.Tables["CallBack"].Columns["ID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCallBack.Tables["CallBack"].PrimaryKey = new string[] { "ID" }; syncSchemaCallBack.Tables["CallBack"].Columns["ID"].AutoIncrement = true; syncSchemaCallBack.Tables["CallBack"].Columns["ID"].AutoIncrementSeed = 1; syncSchemaCallBack.Tables["CallBack"].Columns["ID"].AutoIncrementStep = 1; syncSchemaCallBack.Tables["CallBack"].Columns["ID"].AllowNull = false; syncSchemaCallBack.Tables["CallBack"].Columns.Add("CallID"); syncSchemaCallBack.Tables["CallBack"].Columns["CallID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCallBack.Tables["CallBack"].Columns["CallID"].AllowNull = false; syncSchemaCallBack.Tables["CallBack"].Columns.Add("CallBackDate"); syncSchemaCallBack.Tables["CallBack"].Columns["CallBackDate"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaCallBack.Tables["CallBack"].Columns["CallBackDate"].AllowNull = false; syncSchemaCallBack.Tables["CallBack"].Columns.Add("Comment"); syncSchemaCallBack.Tables["CallBack"].Columns["Comment"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaCallBack.Tables["CallBack"].Columns["Comment"].MaxLength = 50; syncSchemaCallBack.Tables["CallBack"].Columns["Comment"].AllowNull = true; syncSchemaCallBack.Tables["CallBack"].Columns.Add("IsPublic"); syncSchemaCallBack.Tables["CallBack"].Columns["IsPublic"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaCallBack.Tables["CallBack"].Columns["IsPublic"].AllowNull = false; syncSchemaCallBack.Tables["CallBack"].Columns.Add("IsDeleted"); syncSchemaCallBack.Tables["CallBack"].Columns["IsDeleted"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaCallBack.Tables["CallBack"].Columns["IsDeleted"].AllowNull = false; // sync.CreateSchema(tblCallBackTable, syncSchemaCallBack); clientSyncProvider.CreateSchema(tblCallBackTable, syncSchemaCallBack); return tblCallBackTable; } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "CreateCallBackTable()", "ClsUserDataService.cs"); //MessageBox.Show("CreateCallBackTable: " + ex.Message); return null; } finally { // OpenConnection(false); if (ce != null && ce.State == ConnectionState.Open) { ce.Close(); } } }
public SqliteTableBuilder(SyncTable tableDescription, ParserName tableName, ParserName trackingTableName, SyncSetup setup) : base(tableDescription, tableName, trackingTableName, setup) { this.sqliteObjectNames = new SqliteObjectNames(tableDescription, this.TableName, this.TrackingTableName, setup); this.sqliteDbMetadata = new SqliteDbMetadata(); }
public SqliteTableBuilder(SyncTable tableDescription, SyncSetup setup) : base(tableDescription, setup) { sqlObjectNames = new SqliteObjectNames(tableDescription, this.TableName, this.TrackingTableName, setup); }
/// <summary> /// Executing a batch command /// </summary> public override async Task ExecuteBatchCommandAsync(DbCommand cmd, Guid senderScopeId, IEnumerable <SyncRow> applyRows, SyncTable schemaChangesTable, SyncTable failedRows, long lastTimestamp, DbConnection connection, DbTransaction transaction = null) { var applyRowsCount = applyRows.Count(); if (applyRowsCount <= 0) { return; } var dataRowState = DataRowState.Unchanged; bool alreadyOpened = connection.State == ConnectionState.Open; try { foreach (var row in applyRows) { } } catch (DbException ex) { Debug.WriteLine(ex.Message); throw; } finally { if (!alreadyOpened && connection.State != ConnectionState.Closed) { connection.Close(); } } }
public NpgsqlSyncAdapter(SyncTable tableDescription, ParserName tableName, ParserName trackingName, SyncSetup setup) : base(tableDescription, setup) { this.sqlObjectNames = new NpgsqlObjectNames(tableDescription, setup); this.sqlMetadata = new NpgsqlDbMetadata(); }
public MySqlDownloadOnlyTableBuilder(SyncTable tableDescription, ParserName tableName, ParserName trackingTableName, SyncSetup setup, string scopeName) : base(tableDescription, tableName, trackingTableName, setup, scopeName) { }
public override DbTableBuilder GetTableBuilder(SyncTable tableDescription, ParserName tableName, ParserName trackingTableName, SyncSetup setup, string scopeName) => new MySqlDownloadOnlyTableBuilder(tableDescription, tableName, trackingTableName, setup, scopeName);
public SyncTable CreateCallTable() { SqlCeConnection ce = null; try { // if (!IsTableExits("Call")) { // OpenConnection(true); ce = new SqlCeConnection(strClientConnectionString); ce.Open(); tblCallTable = new SyncTable("Call"); tblCallTable.SyncDirection = SyncDirection.UploadOnly; SyncSchema syncSchemaCall = new SyncSchema(); syncSchemaCall.Tables.Add("Call"); syncSchemaCall.Tables["Call"].Columns.Add("ID"); syncSchemaCall.Tables["Call"].Columns["ID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].PrimaryKey = new string[] { "ID" }; syncSchemaCall.Tables["Call"].Columns["ID"].AutoIncrement = true; syncSchemaCall.Tables["Call"].Columns["ID"].AutoIncrementSeed = 1; syncSchemaCall.Tables["Call"].Columns["ID"].AutoIncrementStep = 1; syncSchemaCall.Tables["Call"].Columns["ID"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("LeadID"); syncSchemaCall.Tables["Call"].Columns["LeadID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["LeadID"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("CalledDate"); syncSchemaCall.Tables["Call"].Columns["CalledDate"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaCall.Tables["Call"].Columns["CalledDate"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("ModifiedDate"); syncSchemaCall.Tables["Call"].Columns["ModifiedDate"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaCall.Tables["Call"].Columns["ModifiedDate"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("ModifiedBy"); syncSchemaCall.Tables["Call"].Columns["ModifiedBy"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["ModifiedBy"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("GeneratedBy"); syncSchemaCall.Tables["Call"].Columns["GeneratedBy"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["GeneratedBy"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("StartDate"); syncSchemaCall.Tables["Call"].Columns["StartDate"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaCall.Tables["Call"].Columns["StartDate"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("StartTime"); syncSchemaCall.Tables["Call"].Columns["StartTime"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaCall.Tables["Call"].Columns["StartTime"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("DurationInSecond"); syncSchemaCall.Tables["Call"].Columns["DurationInSecond"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["DurationInSecond"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("DespositionID"); syncSchemaCall.Tables["Call"].Columns["DespositionID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["DespositionID"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("CampaignID"); syncSchemaCall.Tables["Call"].Columns["CampaignID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["CampaignID"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("ConfID"); syncSchemaCall.Tables["Call"].Columns["ConfID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaCall.Tables["Call"].Columns["ConfID"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("IsDeleted"); syncSchemaCall.Tables["Call"].Columns["IsDeleted"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaCall.Tables["Call"].Columns["IsDeleted"].AllowNull = false; syncSchemaCall.Tables["Call"].Columns.Add("CallNote"); syncSchemaCall.Tables["Call"].Columns["CallNote"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaCall.Tables["Call"].Columns["CallNote"].MaxLength = 50; syncSchemaCall.Tables["Call"].Columns["CallNote"].AllowNull = true; syncSchemaCall.Tables["Call"].Columns.Add("IsDNC"); syncSchemaCall.Tables["Call"].Columns["IsDNC"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaCall.Tables["Call"].Columns["IsDNC"].AllowNull = true; syncSchemaCall.Tables["Call"].Columns.Add("IsGlobal"); syncSchemaCall.Tables["Call"].Columns["IsGlobal"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaCall.Tables["Call"].Columns["IsGlobal"].AllowNull = true; //sync.CreateSchema(tblCallTable, syncSchemaCall); clientSyncProvider.CreateSchema(tblCallTable, syncSchemaCall); return tblCallTable; } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "CreateCallTable()", "ClsUserDataService.cs"); //System.Windows.Forms.MessageBox.Show("CreateCallTable: " + ex.Message); return null; } finally { // OpenConnection(false); if (ce != null && ce.State == ConnectionState.Open) { ce.Close(); } } }
private SyncTable CreateLeadsTable() { SqlCeConnection ce = null; try { // if (!IsTableExits("Leads")) { // SqlCeClientSyncProvider sync = new SqlCeClientSyncProvider(ClientConnectionString); //OpenConnection(true); ce = new SqlCeConnection(strClientConnectionString); ce.Open(); tblLeadsTable = new SyncTable("Leads"); tblLeadsTable.SyncDirection = SyncDirection.UploadOnly; SyncSchema syncSchemaLead = new SyncSchema(); syncSchemaLead.Tables.Add("Leads"); syncSchemaLead.Tables["Leads"].Columns.Add("ID"); syncSchemaLead.Tables["Leads"].Columns["ID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaLead.Tables["Leads"].PrimaryKey = new string[] { "ID" }; //syncSchemaLead.Tables["Leads"].Columns["ID"].AutoIncrement = true; //syncSchemaLead.Tables["Leads"].Columns["ID"].AutoIncrementSeed = 1; //syncSchemaLead.Tables["Leads"].Columns["ID"].AutoIncrementStep = 1; syncSchemaLead.Tables["Leads"].Columns["ID"].AllowNull = false; syncSchemaLead.Tables["Leads"].Columns.Add("PhoneNo"); syncSchemaLead.Tables["Leads"].Columns["PhoneNo"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaLead.Tables["Leads"].Columns["PhoneNo"].AllowNull = false; syncSchemaLead.Tables["Leads"].Columns.Add("LeadFormatID"); syncSchemaLead.Tables["Leads"].Columns["LeadFormatID"].ProviderDataType = SqlDbType.Int.ToString(); syncSchemaLead.Tables["Leads"].Columns["LeadFormatID"].AllowNull = false; syncSchemaLead.Tables["Leads"].Columns.Add("CreatedDate"); syncSchemaLead.Tables["Leads"].Columns["CreatedDate"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaLead.Tables["Leads"].Columns["CreatedDate"].AllowNull = true; syncSchemaLead.Tables["Leads"].Columns.Add("CreatedBy"); syncSchemaLead.Tables["Leads"].Columns["CreatedBy"].ProviderDataType = SqlDbType.Int.ToString(); syncSchemaLead.Tables["Leads"].Columns["CreatedBy"].AllowNull = false; syncSchemaLead.Tables["Leads"].Columns.Add("DeletedDate"); syncSchemaLead.Tables["Leads"].Columns["DeletedDate"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaLead.Tables["Leads"].Columns["DeletedDate"].AllowNull = true; syncSchemaLead.Tables["Leads"].Columns.Add("DeletedBy"); syncSchemaLead.Tables["Leads"].Columns["DeletedBy"].ProviderDataType = SqlDbType.Int.ToString(); syncSchemaLead.Tables["Leads"].Columns["DeletedBy"].AllowNull = true; syncSchemaLead.Tables["Leads"].Columns.Add("IsDeleted"); syncSchemaLead.Tables["Leads"].Columns["IsDeleted"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaLead.Tables["Leads"].Columns["IsDeleted"].AllowNull = false; syncSchemaLead.Tables["Leads"].Columns.Add("ModifiedDate"); syncSchemaLead.Tables["Leads"].Columns["ModifiedDate"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaLead.Tables["Leads"].Columns["ModifiedDate"].AllowNull = false; syncSchemaLead.Tables["Leads"].Columns.Add("ModifiedBy"); syncSchemaLead.Tables["Leads"].Columns["ModifiedBy"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaLead.Tables["Leads"].Columns["ModifiedBy"].AllowNull = false; syncSchemaLead.Tables["Leads"].Columns.Add("DNCFlag"); syncSchemaLead.Tables["Leads"].Columns["DNCFlag"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaLead.Tables["Leads"].Columns["DNCFlag"].AllowNull = false; syncSchemaLead.Tables["Leads"].Columns.Add("DNCBy"); syncSchemaLead.Tables["Leads"].Columns["DNCBy"].ProviderDataType = SqlDbType.Int.ToString(); syncSchemaLead.Tables["Leads"].Columns["DNCBy"].AllowNull = true; syncSchemaLead.Tables["Leads"].Columns.Add("ListID"); syncSchemaLead.Tables["Leads"].Columns["ListID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaLead.Tables["Leads"].Columns["ListID"].AllowNull = false; syncSchemaLead.Tables["Leads"].Columns.Add("LocationID"); syncSchemaLead.Tables["Leads"].Columns["LocationID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaLead.Tables["Leads"].Columns["LocationID"].AllowNull = false; syncSchemaLead.Tables["Leads"].Columns.Add("RecycleCount"); syncSchemaLead.Tables["Leads"].Columns["RecycleCount"].ProviderDataType = SqlDbType.Int.ToString(); syncSchemaLead.Tables["Leads"].Columns["RecycleCount"].AllowNull = false; syncSchemaLead.Tables["Leads"].Columns.Add("Status"); syncSchemaLead.Tables["Leads"].Columns["Status"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Leads"].Columns["Status"].MaxLength = 50; syncSchemaLead.Tables["Leads"].Columns["Status"].AllowNull = true; syncSchemaLead.Tables["Leads"].Columns.Add("IsGlobalDNC"); syncSchemaLead.Tables["Leads"].Columns["IsGlobalDNC"].ProviderDataType = SqlDbType.Bit.ToString(); syncSchemaLead.Tables["Leads"].Columns["IsGlobalDNC"].AllowNull = true; //syncSchemaLead.Tables["Leads"].Columns.Add("LastEditDate"); //syncSchemaLead.Tables["Leads"].Columns["LastEditDate"].ProviderDataType = SqlDbType.DateTime.ToString(); //syncSchemaLead.Tables["Leads"].Columns["LastEditDate"].AllowNull = false; //syncSchemaLead.Tables["Leads"].Columns.Add("CreationDate"); //syncSchemaLead.Tables["Leads"].Columns["CreationDate"].ProviderDataType = SqlDbType.DateTime.ToString(); //syncSchemaLead.Tables["Leads"].Columns["CreationDate"].AllowNull = false; // sync.CreateSchema(tblLeadsTable, syncSchemaLead); clientSyncProvider.CreateSchema(tblLeadsTable, syncSchemaLead); return tblLeadsTable; } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "CreateLeadsTable()", "ClsUserDataService.cs"); //MessageBox.Show("CreateLeadsTable: " + ex.Message); return null; } finally { //OpenConnection(false); if (ce != null && ce.State == ConnectionState.Open) { ce.Close(); } } }
public SqlDownloadOnlySyncAdapter(SyncTable tableDescription, ParserName tableName, ParserName trackingName, SyncSetup setup, string scopeName) : base(tableDescription, tableName, trackingName, setup, scopeName) { }
// Meet Code For Buddylist Implementation. #region DataBase Creation Function // public static string ClientConnectionString = @"Data Source=" + AppDomain.CurrentDomain.BaseDirectory + "AllocateConferenceNumber.sdf"; /// <summary> /// this function will create Node_Status table if it is not created. Buddy_Status will contains all the users with his/her status. /// </summary> void fncCreateBuddyStatusTable() { try { if (false == File.Exists(strLocalDBPath)) { SqlCeEngine clientEngine = new SqlCeEngine(ClientConnectionString); clientEngine.CreateDatabase(); } if (!IsTableExits("Node_Status")) { SqlCeClientSyncProvider sync = new SqlCeClientSyncProvider(ClientConnectionString); SyncTable tblNode_Status = new SyncTable("Node_Status"); SyncSchema syncSchemaLead = new SyncSchema(); syncSchemaLead.Tables.Add("Node_Status"); syncSchemaLead.Tables["Node_Status"].Columns.Add("Buddy_ID"); syncSchemaLead.Tables["Node_Status"].Columns["Buddy_ID"].ProviderDataType = SqlDbType.BigInt.ToString(); syncSchemaLead.Tables["Node_Status"].Columns["Buddy_ID"].AutoIncrement = true; syncSchemaLead.Tables["Node_Status"].Columns["Buddy_ID"].AutoIncrementSeed = 1; syncSchemaLead.Tables["Node_Status"].Columns["Buddy_ID"].AutoIncrementStep = 1; syncSchemaLead.Tables["Node_Status"].PrimaryKey = new string[] { "Buddy_ID" }; syncSchemaLead.Tables["Node_Status"].Columns.Add("Buddy_Name"); syncSchemaLead.Tables["Node_Status"].Columns["Buddy_Name"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Node_Status"].Columns["Buddy_Name"].MaxLength = 30; syncSchemaLead.Tables["Node_Status"].Columns.Add("Buddy_Status"); syncSchemaLead.Tables["Node_Status"].Columns["Buddy_Status"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Node_Status"].Columns["Buddy_Status"].MaxLength = 30; syncSchemaLead.Tables["Node_Status"].Columns.Add("Buddy_TimeStamp"); syncSchemaLead.Tables["Node_Status"].Columns["Buddy_TimeStamp"].ProviderDataType = SqlDbType.DateTime.ToString(); syncSchemaLead.Tables["Node_Status"].Columns["Buddy_TimeStamp"].MaxLength = 30; sync.CreateSchema(tblNode_Status, syncSchemaLead); } if (VMuktiInfo.CurrentPeer.DisplayName != null && VMuktiInfo.CurrentPeer.DisplayName != string.Empty) { fncSNInsertBuddy(VMuktiInfo.CurrentPeer.DisplayName, "Online"); } } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "fncCreateBuddyStatusTable()", "Domains\\BootstrapServiceDomain.cs"); } }
public void CreateInitialLocalDB(string strConnectionString,bool isCreated) { try { strClientConnectionString = strConnectionString; // sync = new SqlCeClientSyncProvider(strClientConnectionString); clientSyncProvider = new SqlCeClientSyncProvider(strClientConnectionString); if (!isCreated) { SqlCeEngine clientEngine = new SqlCeEngine(strClientConnectionString); clientEngine.CreateDatabase(); clientEngine.Dispose(); tblCallTable = CreateCallTable(); tblLeadsTable = CreateLeadsTable(); tblCallBackTable = CreateCallBackTable(); tblDispositionTable = CreateDispositionTable(); } else { tblCallTable = new SyncTable("Call"); tblCallTable.SyncDirection = SyncDirection.UploadOnly; tblLeadsTable = new SyncTable("Leads"); tblLeadsTable.SyncDirection = SyncDirection.UploadOnly; tblCallBackTable = new SyncTable("CallBack"); tblCallBackTable.SyncDirection = SyncDirection.UploadOnly; //Creating Disposition Table (Added by Alpa) tblDispositionTable = new SyncTable("Disposition"); tblDispositionTable.SyncDirection = SyncDirection.UploadOnly; } strClientConnectionString = strConnectionString; // sync = new SqlCeClientSyncProvider(strClientConnectionString); serverSyncProvider = new DbServerSyncProvider(); syncAgent = new SyncAgent(); // syncAgent.ServerSyncProvider = serverSyncProvider; syncAgent.RemoteProvider = serverSyncProvider; serverConnection = new SqlConnection(VMuktiAPI.VMuktiInfo.MainConnectionString); serverSyncProvider.Connection = serverConnection; serverSyncProvider.ApplyChangeFailed += new EventHandler<ApplyChangeFailedEventArgs>(serverSyncProvider_ApplyChangeFailed); //syncAgent.ClientSyncProvider = clientSyncProvider; syncAgent.LocalProvider = clientSyncProvider; myGroup = new SyncGroup("DialerGroup"); tblCallTable.SyncGroup = myGroup; tblLeadsTable.SyncGroup = myGroup; tblCallBackTable.SyncGroup = myGroup; tblDispositionTable.SyncGroup = myGroup; syncAgent.Configuration.SyncTables.Add(tblCallTable); syncAgent.Configuration.SyncTables.Add(tblLeadsTable); syncAgent.Configuration.SyncTables.Add(tblCallBackTable); syncAgent.Configuration.SyncTables.Add(tblDispositionTable); CallAdapter = new SqlSyncAdapterBuilder(); CallAdapter.Connection = serverConnection; CallAdapter.SyncDirection = SyncDirection.UploadOnly; CallAdapter.TableName = "Call"; // CallAdapter.DataColumns.Add("ID"); CallAdapter.DataColumns.Add("LeadID"); CallAdapter.DataColumns.Add("CalledDate"); CallAdapter.DataColumns.Add("ModifiedDate"); CallAdapter.DataColumns.Add("ModifiedBy"); CallAdapter.DataColumns.Add("GeneratedBy"); CallAdapter.DataColumns.Add("StartDate"); CallAdapter.DataColumns.Add("StartTime"); CallAdapter.DataColumns.Add("DurationInSecond"); CallAdapter.DataColumns.Add("DespositionID"); CallAdapter.DataColumns.Add("CampaignID"); CallAdapter.DataColumns.Add("ConfID"); CallAdapter.DataColumns.Add("IsDeleted"); CallAdapter.DataColumns.Add("CallNote"); CallAdapter.DataColumns.Add("IsDNC"); CallAdapter.DataColumns.Add("IsGlobal"); CallAdapter.DataColumns.Add("RecordedFileName"); //For Recording File Name CallAdapterSyncAdapter = CallAdapter.ToSyncAdapter(); CallAdapterSyncAdapter.DeleteCommand = null; serverSyncProvider.SyncAdapters.Add(CallAdapterSyncAdapter); LeadAdapter = new SqlSyncAdapterBuilder(); LeadAdapter.Connection = serverConnection; LeadAdapter.SyncDirection = SyncDirection.UploadOnly; LeadAdapter.TableName = "Leads"; LeadAdapter.DataColumns.Add("ID"); LeadAdapter.DataColumns.Add("PhoneNo"); LeadAdapter.DataColumns.Add("LeadFormatID"); LeadAdapter.DataColumns.Add("CreatedDate"); LeadAdapter.DataColumns.Add("CreatedBy"); LeadAdapter.DataColumns.Add("DeletedDate"); LeadAdapter.DataColumns.Add("DeletedBy"); LeadAdapter.DataColumns.Add("IsDeleted"); LeadAdapter.DataColumns.Add("ModifiedDate"); LeadAdapter.DataColumns.Add("ModifiedBy"); LeadAdapter.DataColumns.Add("DNCFlag"); LeadAdapter.DataColumns.Add("DNCBy"); LeadAdapter.DataColumns.Add("ListID"); LeadAdapter.DataColumns.Add("LocationID"); LeadAdapter.DataColumns.Add("RecycleCount"); LeadAdapter.DataColumns.Add("Status"); LeadAdapter.DataColumns.Add("IsGlobalDNC"); //LeadAdapter.DataColumns.Add("LastEditDate"); //LeadAdapter.DataColumns.Add("CreationDate"); LeadAdapterSyncAdapter = LeadAdapter.ToSyncAdapter(); LeadAdapterSyncAdapter.DeleteCommand = null; LeadAdapterSyncAdapter.InsertCommand = null; serverSyncProvider.SyncAdapters.Add(LeadAdapterSyncAdapter); CallBackAdapter = new SqlSyncAdapterBuilder(); CallBackAdapter.Connection = serverConnection; CallBackAdapter.SyncDirection = SyncDirection.UploadOnly; CallBackAdapter.TableName = "CallBack"; CallBackAdapter.DataColumns.Add("ID"); CallBackAdapter.DataColumns.Add("CallID"); CallBackAdapter.DataColumns.Add("CallBackDate"); CallBackAdapter.DataColumns.Add("Comment"); CallBackAdapter.DataColumns.Add("IsPublic"); CallBackAdapter.DataColumns.Add("IsDeleted"); CallBackAdapterSyncAdapter = CallBackAdapter.ToSyncAdapter(); CallBackAdapterSyncAdapter.DeleteCommand = null; serverSyncProvider.SyncAdapters.Add(CallBackAdapterSyncAdapter); //Creating Disposition Table in sdf (Added by Alpa) DispositionAdapter = new SqlSyncAdapterBuilder(); DispositionAdapter.Connection = serverConnection; DispositionAdapter.SyncDirection = SyncDirection.UploadOnly; DispositionAdapter.TableName = "Disposition"; DispositionAdapter.DataColumns.Add("ID"); DispositionAdapter.DataColumns.Add("DespositionName"); DispositionAdapter.DataColumns.Add("Description"); DispositionAdapter.DataColumns.Add("IsActive"); DispositionAdapter.DataColumns.Add("IsDeleted"); DispositionAdapter.DataColumns.Add("CreatedDate"); DispositionAdapter.DataColumns.Add("CreatedBy"); DispositionAdapter.DataColumns.Add("ModifiedDate"); DispositionAdapter.DataColumns.Add("ModifiedBy"); DispositionAdapterSyncAdapter = DispositionAdapter.ToSyncAdapter(); DispositionAdapterSyncAdapter.DeleteCommand = null; DispositionAdapterSyncAdapter.InsertCommand = null; serverSyncProvider.SyncAdapters.Add(DispositionAdapterSyncAdapter); ce = new SqlCeConnection(strClientConnectionString); ce.Open(); CheckPreviousSyncWithServer(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void fncActiveCallTable() { try { if (false == File.Exists(strLocalDBPath)) { SqlCeEngine clientEngine = new SqlCeEngine(ClientConnectionString); clientEngine.CreateDatabase(); } if (!IsTableExits("Active_call")) { SqlCeClientSyncProvider sync = new SqlCeClientSyncProvider(ClientConnectionString); SyncTable tblActive_call = new SyncTable("Active_call"); SyncSchema syncSchemaLead = new SyncSchema(); syncSchemaLead.Tables.Add("Active_call"); syncSchemaLead.Tables["Active_call"].Columns.Add("uName"); syncSchemaLead.Tables["Active_call"].Columns["uName"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Active_call"].Columns["uName"].AutoIncrement = false; syncSchemaLead.Tables["Active_call"].Columns["uName"].AutoIncrementSeed = 0; syncSchemaLead.Tables["Active_call"].Columns["uName"].AutoIncrementStep = 1; syncSchemaLead.Tables["Active_call"].Columns["uName"].MaxLength = 30; syncSchemaLead.Tables["Active_call"].PrimaryKey = new string[] { "uName" }; syncSchemaLead.Tables["Active_call"].Columns.Add("Campaign_Id"); syncSchemaLead.Tables["Active_call"].Columns["Campaign_Id"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Active_call"].Columns["Campaign_Id"].MaxLength = 30; syncSchemaLead.Tables["Active_call"].Columns["Campaign_Id"].AutoIncrement = false; syncSchemaLead.Tables["Active_call"].Columns["Campaign_Id"].AutoIncrementSeed = 0; syncSchemaLead.Tables["Active_call"].Columns["Campaign_Id"].AutoIncrementStep = 1; syncSchemaLead.Tables["Active_call"].Columns.Add("Status"); syncSchemaLead.Tables["Active_call"].Columns["Status"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Active_call"].Columns["Status"].MaxLength = 30; syncSchemaLead.Tables["Active_call"].Columns["Status"].AutoIncrement = false; syncSchemaLead.Tables["Active_call"].Columns["Status"].AutoIncrementSeed = 0; syncSchemaLead.Tables["Active_call"].Columns["Status"].AutoIncrementStep = 1; syncSchemaLead.Tables["Active_call"].Columns.Add("Group_Name"); syncSchemaLead.Tables["Active_call"].Columns["Group_Name"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Active_call"].Columns["Group_Name"].MaxLength = 30; syncSchemaLead.Tables["Active_call"].Columns["Group_Name"].AutoIncrement = false; syncSchemaLead.Tables["Active_call"].Columns["Group_Name"].AutoIncrementSeed = 0; syncSchemaLead.Tables["Active_call"].Columns["Group_Name"].AutoIncrementStep = 1; syncSchemaLead.Tables["Active_call"].Columns.Add("Phone_No"); syncSchemaLead.Tables["Active_call"].Columns["Phone_No"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Active_call"].Columns["Phone_No"].MaxLength = 30; syncSchemaLead.Tables["Active_call"].Columns["Phone_No"].AutoIncrement = false; syncSchemaLead.Tables["Active_call"].Columns["Phone_No"].AutoIncrementSeed = 0; syncSchemaLead.Tables["Active_call"].Columns["Phone_No"].AutoIncrementStep = 1; syncSchemaLead.Tables["Active_call"].Columns.Add("callDuration"); syncSchemaLead.Tables["Active_call"].Columns["callDuration"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Active_call"].Columns["callDuration"].MaxLength = 30; syncSchemaLead.Tables["Active_call"].Columns["callDuration"].AutoIncrement = false; syncSchemaLead.Tables["Active_call"].Columns["callDuration"].AutoIncrementSeed = 0; syncSchemaLead.Tables["Active_call"].Columns["callDuration"].AutoIncrementStep = 1; sync.CreateSchema(tblActive_call, syncSchemaLead); } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "fncActivecallTable()", "ctlrptActiveCall.xaml.cs"); } }
void fncActiveAgentTable() { try { if (false == File.Exists(strLocalDBPath)) { SqlCeEngine clientEngine = new SqlCeEngine(ClientConnectionString); clientEngine.CreateDatabase(); } if (!IsTableExits("Active_agent")) { SqlCeClientSyncProvider sync = new SqlCeClientSyncProvider(ClientConnectionString); SyncTable tblActive_agent = new SyncTable("Active_agent"); SyncSchema syncSchemaLead = new SyncSchema(); syncSchemaLead.Tables.Add("Active_agent"); syncSchemaLead.Tables["Active_agent"].Columns.Add("uName"); syncSchemaLead.Tables["Active_agent"].Columns["uName"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Active_agent"].Columns["uName"].AutoIncrement = false; syncSchemaLead.Tables["Active_agent"].Columns["uName"].AutoIncrementSeed = 0; syncSchemaLead.Tables["Active_agent"].Columns["uName"].AutoIncrementStep = 1; syncSchemaLead.Tables["Active_agent"].Columns["uName"].MaxLength = 30; syncSchemaLead.Tables["Active_agent"].PrimaryKey = new string[] { "uName" }; syncSchemaLead.Tables["Active_agent"].Columns.Add("Campaign_Id"); syncSchemaLead.Tables["Active_agent"].Columns["Campaign_Id"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Active_agent"].Columns["Campaign_Id"].MaxLength = 30; syncSchemaLead.Tables["Active_agent"].Columns["Campaign_Id"].AutoIncrement = false; syncSchemaLead.Tables["Active_agent"].Columns["Campaign_Id"].AutoIncrementSeed = 0; syncSchemaLead.Tables["Active_agent"].Columns["Campaign_Id"].AutoIncrementStep = 1; syncSchemaLead.Tables["Active_agent"].Columns.Add("Status"); syncSchemaLead.Tables["Active_agent"].Columns["Status"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Active_agent"].Columns["Status"].MaxLength = 30; syncSchemaLead.Tables["Active_agent"].Columns["Status"].AutoIncrement = false; syncSchemaLead.Tables["Active_agent"].Columns["Status"].AutoIncrementSeed = 0; syncSchemaLead.Tables["Active_agent"].Columns["Status"].AutoIncrementStep = 1; syncSchemaLead.Tables["Active_agent"].Columns.Add("Group_Name"); syncSchemaLead.Tables["Active_agent"].Columns["Group_Name"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Active_agent"].Columns["Group_Name"].MaxLength = 30; syncSchemaLead.Tables["Active_agent"].Columns["Group_Name"].AutoIncrement = false; syncSchemaLead.Tables["Active_agent"].Columns["Group_Name"].AutoIncrementSeed = 0; syncSchemaLead.Tables["Active_agent"].Columns["Group_Name"].AutoIncrementStep = 1; syncSchemaLead.Tables["Active_agent"].Columns.Add("Phone_No"); syncSchemaLead.Tables["Active_agent"].Columns["Phone_No"].ProviderDataType = SqlDbType.NVarChar.ToString(); syncSchemaLead.Tables["Active_agent"].Columns["Phone_No"].MaxLength = 30; syncSchemaLead.Tables["Active_agent"].Columns["Phone_No"].AutoIncrement = false; syncSchemaLead.Tables["Active_agent"].Columns["Phone_No"].AutoIncrementSeed = 0; syncSchemaLead.Tables["Active_agent"].Columns["Phone_No"].AutoIncrementStep = 1; sync.CreateSchema(tblActive_agent, syncSchemaLead); } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "fncActiveAgentTable()", "ctlrptActiveAgent.xaml.cs"); } }