public static string RowToColumns(BillRow row) { var forward = row.Lob.Replace('\\', '/').Trim(); string result = $"'{row.Bill }'{DB.Separator}'{row.MeasureType }'{DB.Separator}" + $"'{row.MeasureNum }'{DB.Separator}'{forward }'{DB.Separator}" + $"{ row.NegativeScore }{ DB.Separator}{ row.PositiveScore }{ DB.Separator}" + $"'{row.Position }'{DB.Separator}'{row.BillVersionID }'{DB.Separator}" + $"'{row.Author }'{DB.Separator}'{row.Title }'{DB.Separator}" + $"'{row.Location }'{DB.Separator}'{row.Location2nd }'{DB.Separator}" + $"'{row.MeasureState }'{DB.Separator}'{row.CurrentHouse }'{DB.Separator}" + $"'{row.CurrentStatus }'"; return(result); }
public static BillRow Row(string bill) { BillRow result = null; var query = $"Select BillID,MeasureType,MeasureNum,Lob,NegativeScore,PositiveScore,Position,BillVersionID,Author,Title,Location,Location2nd,MeasureState,CurrentHouse,CurrentStatus from BillRows Where BillID='{bill}';"; try { using (SQLiteConnection con = DB.Connect()) { // Obtain SQLiteConnection con.Open(); // Open the connection to the database using (SQLiteCommand cmd = new SQLiteCommand(query, con)) { using (SQLiteDataReader reader = cmd.ExecuteReader()) { reader.Read(); result = new BillRow(reader); } } } } catch (Exception ex) { Log.Instance.Info($"BillRow.Row({query}): {ex.Message}"); throw; } return(result); }