//--------------------------------------------------------- void CData_Source_PgSQL::Table_Rename(const wxTreeItemId &Item) { CData_Source_PgSQL_Data *pData = Item.IsOk() ? (CData_Source_PgSQL_Data *)GetItemData(Item) : NULL; if( pData == NULL ) return; wxString Name = GetItemText(Item); switch( pData->Get_Type() ) { //----------------------------------------------------- case TYPE_GRID: if( DLG_Get_Text(Name, _TL("Rename Raster Band"), _TL("Name")) ) { CSG_String Table = pData->Get_Value().BeforeFirst(':'); CSG_String rid = pData->Get_Value().AfterFirst (':'); CSG_String SQL = "UPDATE \"" + Table + "\" SET name='" + CSG_String(&Name) + "' WHERE " + rid + ";"; RUN_MODULE(DB_PGSQL_Execute_SQL, false, SET_PARAMETER("CONNECTION", pData->Get_Server()) && SET_PARAMETER("SQL" , SQL) ); if( bResult ) { SetItemText(Item, Name); } } break; //----------------------------------------------------- default: if( DLG_Get_Text(Name, _TL("Rename Table"), _TL("Name")) ) { CSG_String SQL = "ALTER TABLE \"" + pData->Get_Value() + "\" RENAME TO \"" + CSG_String(&Name) + "\";"; RUN_MODULE(DB_PGSQL_Execute_SQL, false, SET_PARAMETER("CONNECTION", pData->Get_Server()) && SET_PARAMETER("SQL" , SQL) ); if( bResult ) { SetItemText(Item, Name); } } break; } }
bool DLG_Get_Text(wxString &Value) { return( DLG_Get_Text(Value, _TL("Input"), _TL("Please enter a text:")) ); }
int DLG_Message_YesNoCancel(int ID_DLG) { return( DLG_Message_YesNoCancel(DLG_Get_Text(ID_DLG), DLG_Get_Caption(ID_DLG)) ); }
bool DLG_Message_Confirm(int ID_DLG) { return( DLG_Message_Confirm(DLG_Get_Text(ID_DLG), DLG_Get_Caption(ID_DLG)) ); }
int DLG_Message_Show_Error(int ID_DLG) { return( DLG_Message_Show_Error(DLG_Get_Text(ID_DLG), DLG_Get_Caption(ID_DLG)) ); }
void DLG_Message_Show(int ID_DLG) { DLG_Message_Show(DLG_Get_Text(ID_DLG), DLG_Get_Caption(ID_DLG)); }