示例#1
0
        public override void CommitSend()
        {
            if (new EnumTableSyncStatus[] { EnumTableSyncStatus.Sending, EnumTableSyncStatus.CompleteSend }.Contains(SyncInfo.Status))
            {
                DataTable table  = MobileCommon.ExecuteDataAdapter($"select Id from LabourTimeEntry where CompanyId={CompanyId} and SyncStatus='{EnumRecordSyncStatus.Submiting}'");
                var       idList = table.Select().ToList().Select(r => (int)r["Id"]);
                foreach (int id in idList)
                {
                    var match = SyncCoreMatch.GetMatch(TableName, id);
                    MobileCommon.ExecuteNonQuery($"update LabourTimeEntry set MatchID={match.MatchId}, SyncStatus='{EnumRecordSyncStatus.Submitted}' where Id={id}");
                }

                UpdateStatus(EnumTableSyncStatus.ReadyToSync);
            }
        }
示例#2
0
        public override void CommitSend()
        {
            if (new EnumTableSyncStatus[] { EnumTableSyncStatus.Sending, EnumTableSyncStatus.CompleteSend }.Contains(SyncInfo.Status))
            {
                DataTable table      = MobileCommon.ExecuteDataAdapter($"select FileRepository_ID from CFS_FileLink where SyncStatus='{EnumRecordSyncStatus.Submiting}' and CompanyID={CompanyId}");
                var       repoIdList = table.Select().Select(r => (int)r["FileRepository_ID"]);
                foreach (int repoId in repoIdList)
                {
                    var match = SyncCoreMatch.GetMatch(TableName, repoId);
                    MobileCommon.ExecuteNonQuery($"update CFS_FileLink set MatchID={match.MatchId}, SyncStatus='{EnumRecordSyncStatus.Submitted}' where FileRepository_ID={repoId}");
                }

                UpdateStatus(EnumTableSyncStatus.ReadyToSync);
            }
        }
示例#3
0
        public override void CommitSend()
        {
            if (new EnumTableSyncStatus[] { EnumTableSyncStatus.Sending, EnumTableSyncStatus.CompleteSend }.Contains(SyncInfo.Status))
            {
                DataTable table  = MobileCommon.ExecuteDataAdapter($"select Id from LemHeader where CompanyId={CompanyId} and SyncStatus='{EnumRecordSyncStatus.Submiting}'");
                var       idList = table.Select().ToList().Select(r => (int)r["Id"]);

                foreach (int id in idList)
                {
                    var    match = SyncCoreMatch.GetMatch(TableName, id);
                    string sql   = $"update LemHeader set SyncStatus='{EnumRecordSyncStatus.Submitted}', MatchID={match.MatchId}, LemNum='{match.SyncMatch}', EmailData=null, " +
                                   $"SubmitStatus='{(char)EnumSubmitStatus.Submitted}' where Id={id}";
                    MobileCommon.ExecuteNonQuery(sql);
                }

                UpdateStatus(EnumTableSyncStatus.ReadyToSync);
            }
        }
示例#4
0
        public override void CommitReceive()
        {
            if (new EnumTableSyncStatus[] { EnumTableSyncStatus.Receiving, EnumTableSyncStatus.CompleteReceive }.Contains(SyncInfo.Status))
            {
                DataTable table  = MobileCommon.ExecuteDataAdapter($"select Id from FieldPO where CompanyId={CompanyId} and SyncStatus='{EnumRecordSyncStatus.Updating}'");
                var       idList = table.Select().Select(r => (int)r["Id"]);

                foreach (int id in idList)
                {
                    var match = SyncCoreMatch.GetMatch(TableName, id);
                    if (match != null)
                    {
                        string sql = $"update FieldPO set SyncStatus='{EnumRecordSyncStatus.Submitted}', PONum='{match.SyncMatch}' where Id={id}";
                        MobileCommon.ExecuteNonQuery(sql);
                    }
                }

                UpdateStatus(EnumTableSyncStatus.ReadyToSync);
            }
        }