-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from hybridmachine/btabone-userdoc
Btabone userdoc
- Loading branch information
Showing
16 changed files
with
365 additions
and
35 deletions.
There are no files selected for viewing
Binary file added
BIN
+136 KB
Docs/User Documentation/Microsoft Word Source/Signals And Transforms User Manual.docx
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Microsoft.Data.Sqlite; | ||
using Serilog; | ||
using SignalsAndTransforms.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace SignalsAndTransforms.DAL | ||
{ | ||
public static class SettingDAL | ||
{ | ||
|
||
/// <summary> | ||
/// Create a setting (deleting one if it is already there | ||
/// </summary> | ||
/// <param name="workBook"></param> | ||
/// <param name="key"></param> | ||
/// <param name="value"></param> | ||
/// <param name="con">SQL Connection, it is assumed a transaction is already in process</param> | ||
/// <returns></returns> | ||
public static bool Create(WorkBook workBook, string key, string value, SqliteConnection con) | ||
{ | ||
if (null == workBook) throw new ArgumentNullException(nameof(workBook)); | ||
if (null == key) throw new ArgumentNullException(nameof(key)); | ||
if (null == value) throw new ArgumentNullException(nameof(value)); | ||
if (null == con) throw new ArgumentException(nameof(con)); | ||
|
||
if (workBook.FilePath == null) | ||
{ | ||
throw new Exception(Properties.Resources.ERROR_WORKBOOK_FILEPATHNOTSET); | ||
} | ||
|
||
string sql = $@"DELETE FROM Settings WHERE Key=@Key AND WorkBookId=@WorkBookId; INSERT INTO Settings ('WorkBookId', 'Key', 'Value') VALUES(@WorkBookId, @Key,@Value);"; | ||
|
||
try | ||
{ | ||
SqliteCommand cmd = con.CreateCommand(); | ||
cmd.CommandText = sql; | ||
|
||
cmd.Parameters.AddWithValue("@WorkBookId", workBook.Id); | ||
cmd.Parameters.AddWithValue("@Key", key); | ||
cmd.Parameters.AddWithValue("@Value", value); | ||
cmd.ExecuteNonQuery(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Log.Error(ex, ex.Message); | ||
throw; | ||
} | ||
|
||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace SignalsAndTransforms.Interfaces | ||
{ | ||
// Common interface between filter types in the UI | ||
public interface IFilterIdentifier | ||
{ | ||
long Id { get; set; } | ||
string Name { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.