public string GetDeleteQuery() { string query = string.Empty; if (ControlDictionary == null || !ControlDictionary.Any()) { ControlDictionary = ChildControls.ToControlDictionary(); } foreach (var pair in ControlDictionary) { if (pair.Value is ILinesEnabled grid) { query += $"DELETE FROM {grid.TableName} WHERE {this.TableName}_id = (SELECT id FROM {this.TableName} WHERE STRFTIME('%Y%m%d', eb_created_at_device) < @strdate AND eb_synced <> {(int)DataSyncStatus.NotSynced});"; } } return(query + $"DELETE FROM {this.TableName} WHERE STRFTIME('%Y%m%d', eb_created_at_device) < @strdate AND eb_synced <> {(int)DataSyncStatus.NotSynced}; "); }
public async Task UploadFiles(int RowId, WebformData WebFormData) { ControlDictionary = ChildControls.ToControlDictionary(); List <FileWrapper> Files = new List <FileWrapper>(); foreach (var pair in ControlDictionary) { if (pair.Value is EbMobileFileUpload) { string pattern = $"{this.TableName}-{RowId}-{pair.Value.Name}*"; Files.AddRange(HelperFunctions.GetFilesByPattern(pattern, pair.Value.Name)); } } if (Files.Count > 0) { var ApiFiles = await FormService.Instance.SendFilesAsync(Files); WebFormData.FillFromSendFileResp(Files, ApiFiles); } }
public string GetQuery() { List <string> colums = new List <string> { "eb_device_id", "eb_appversion", "eb_created_at_device", "eb_retry_count", "eb_loc_id", "id" }; if (ControlDictionary == null || !ControlDictionary.Any()) { ControlDictionary = ChildControls.ToControlDictionary(); } foreach (var pair in ControlDictionary) { if (!(pair.Value is INonPersistControl) && !(pair.Value is ILinesEnabled)) { colums.Add(pair.Value.Name); } } colums.Reverse(); return(string.Join(",", colums.ToArray())); }