public static DataTable FindEntriesByTag(string input) { string sql = StringCollection.caseTag; var data = Datatable.GetDataTable(sql, "@input", input, "@limit", MaxEntries.ToString()); return(data); }
public static DataTable ListTenantsAt(string input) { string sql = StringCollection.caseTenantsAt; var data = Datatable.GetDataTable(sql, "@input", input, "@limit", MaxEntries.ToString()); return(data); }
public static void LogEntry(string Time, string IDTag, string IDAction, string IDDoor, string IDCode) { string sql = StringCollection.caseLogEntry; string taggId = FindEntry.TaggID(IDTag); string actionId = FindEntry.ActionID(IDAction); string doorId = FindEntry.DoorID(IDDoor); string codeId = FindEntry.CodeID(IDCode); Datatable.GetDataTable(sql, "@Time", Time, "@IDTag", taggId, "@IDAction", actionId, "@IDDoor", doorId, "@IDCode", codeId); }
public static string CodeID(string input) { string sql = @"SELECT * FROM Codes WHERE Code LIKE @input"; var data = Datatable.GetDataTable(sql, "@input", input.Trim()); // Steg 1 - kolla om data är null if (data != null && data.Rows != null) { // steg 2 - Kolla om data.rows är större än 0 (i så fall har du fått datarader) if (data.Rows.Count > 0) { // steg 3 - Läs av din datarow var id = data.Rows[0]["Id"].ToString(); // steg 4 - returnera ID return(id); } } return(""); }