public void UpdateComfortZoneValue(string id, string name, double min_temp, double max_temp, double min_hum, double max_hum, Color color)
{
//string idValue = GetGUID();
string tableName = "tbl_" + selectedBuildingList[0].BuildingName + "_comfort_zone_detail"; // 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();
//SQLiteDataReader reader = null;
string sql_string = "UPDATE " + tableName + " set name =@name , min_temp=@min_t, max_temp=@max_t, min_hum=@min_h, max_hum=@max_h , colorValue=@color where id =@id ";
// "update " + tableName + "(id,name,min_temp,max_temp,min_hum,max_hum,colorValue) VALUES(@id,@name,@min_t,@max_t,@min_h,@max_h,@color)";
SQLiteCommand command = new SQLiteCommand(sql_string, connection);
command.CommandType = CommandType.Text;
command.Parameters.AddWithValue("@id", id);
command.Parameters.AddWithValue("@name", name);
command.Parameters.AddWithValue("@min_t", min_temp.ToString());
command.Parameters.AddWithValue("@max_t", max_temp.ToString());
command.Parameters.AddWithValue("@min_h", min_hum.ToString());
command.Parameters.AddWithValue("@max_h", max_hum.ToString());
command.Parameters.AddWithValue("@color", ColorTranslator.ToHtml(color));
command.ExecuteNonQuery();
}
}