public void DeleteComfortZoneData(string id)
{
/*
steps:1. Delete form the ..._comfort_zone_detail and then form _comfort_zone_chart_setting
*/
//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;";
string tableName2 = "tbl_" + selectedBuildingList[0].BuildingName + "_chart_comfort_zone_setting"; // currentLineTableFromDB;
using (SQLiteConnection connection = new SQLiteConnection(connString))
{
connection.Open();
//SQLiteDataReader reader = null;
string sql_string = "delete from " + tableName + " where id =@id ";
SQLiteCommand command = new SQLiteCommand(sql_string, connection);
command.CommandType = CommandType.Text;
command.Parameters.AddWithValue("@id", id);
command.ExecuteNonQuery();
string sql_string2 = "delete from " + tableName2 + " where comfort_zone_ID =@id ";
SQLiteCommand command2 = new SQLiteCommand(sql_string2, connection);
command2.CommandType = CommandType.Text;
command2.Parameters.AddWithValue("@id", id);
command2.ExecuteNonQuery();
}
}