public void InsertLineInfoToDB(string id, string prevNodeId, string nextNodeId, Color lineColor, Series lineSeriesVal, int linethickness)
{
//--Note for series the series.name property will be stored in databse and later it will be converted.
string lineSeriesName = lineSeriesVal.Name;
//string tableName = currentLineTableFromDB;
string tableName = "tbl_" + selectedBuildingList[0].BuildingName + "_line_value"; // currentLineTableFromDB;
string databasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string databaseFile = databasePath + @"\db_psychrometric_project.s3db";
string connString = @"Data Source=" + databaseFile + ";Version=3;";
using (SQLiteConnection connection = new SQLiteConnection(connString))
{
connection.Open();
string sql_string = "insert into " + tableName + "(chart_respective_lineID,lineID,prevNodeId,nextNodeId,lineColorValue,lineSeriesId,thickness,name,status) VALUES(@chartid,@id,@pn,@nn,@lc,@ls,@thicknessValue,@nameVal,@statusVal)";
SQLiteCommand command = new SQLiteCommand(sql_string, connection);
command.CommandType = CommandType.Text;
command.Parameters.AddWithValue("@chartid", chartDetailList[indexForWhichChartIsSelected].chart_respective_lineID);
command.Parameters.AddWithValue("@id", id);
command.Parameters.AddWithValue("@pn", prevNodeId);
command.Parameters.AddWithValue("@nn", nextNodeId);
command.Parameters.AddWithValue("@lc", ColorTranslator.ToHtml(lineColor));
command.Parameters.AddWithValue("@ls", lineSeriesName);
command.Parameters.AddWithValue("@thicknessValue", linethickness);
command.Parameters.AddWithValue("@nameVal", lineName);
command.Parameters.AddWithValue("@statusVal", lineStatus_ON_OFF);
command.ExecuteNonQuery();
}
}