Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 222 → Rev 223

/trunk/DBViewer/database.cpp
203,6 → 203,8
QString pointerField; // èìÿ ïîëÿ-óêàçàòåëÿ íà ðîäèòåëüñêèé êëàññ
QString inctance; // èìÿ òàáëèöû, õðàíèëèùà
QString className; // èìÿ êëàññà
QString modelID; // èäåíòèôèêàòîð ìîäåëè
QString add_filtr; // äîïîëíèòåëüíûé ôèëüòð
int field_ID;
int icon_field_index;
bool filtr_empty;
216,8 → 218,12
// font.setWeight(40);
font.setBold(true);
filtr_empty = filtr.isEmpty();
 
classID = model_item->text(1);
modelID = model_item->text(6);
add_filtr = MainWindow::getFiltrString(modelID, classID);
 
 
icon = model_item->icon(0);
 
parentClassID = model_item->parent()->text(1);
236,6 → 242,7
title_item->setText(2, classID);
title_item->setText(3, inctance);
title_item->setText(4, pointerField);
title_item->setText(5, add_filtr); // çàïîìíèì ôèëüòð äëÿ êëàññà â äåðåâå ñ äàííûìè
title_item->setTextColor(0, Qt::darkBlue);
 
title_item->setIcon(0, icon);
245,6 → 252,15
" from " //íàõîäèì âñå îáúåêòû êëàññà â òàáëèöå - õðàíèëèùå îáúåêòîâ êëàññà
);
sql_str.append(inctance);
 
 
if (filtr.isEmpty() && (!add_filtr.isEmpty())) // ôèëüòð ïóñòîé, äîïîëíèòåëüíûé ôèëüòð íå ïóñòîé
{
filtr.append(tr ("where "));
filtr.append(add_filtr);
}
 
 
if (!filtr.isEmpty()) { // åñëè ôèëüòð íå ïóñòîé
sql_str.append(tr(" "));
sql_str.append(filtr); // äîáàâëÿåì â çàïðîñ ôèëüòð
515,6 → 531,7
QString parent_object_id; // èäåíòèôèêàòîð ðîäèòåëüñêîãî îáúåêòà
 
QString parent_class_inctance;
QString class_filter;
 
 
ui->pushButton->setEnabled(true);
526,6 → 543,7
 
class_id = item->text(2);
inctance = item->text(3);
class_filter = item->text(5);
 
pointer_name = item->text(4);
delete sql_mogel;
546,9 → 564,23
filtr_tmp.append(parent_object_id);
filtr_tmp.append(tr("'"));
 
 
if (!class_filter.isEmpty()) // åñëè ôèëüòð äëÿ êëàññà íå ïóñòîé
{
filtr_tmp.append(tr(" and "));
filtr_tmp.append(class_filter); // äîáàâèì è ôèëüòð äëÿ êëàññà (êîòîðûé óêàçûâàëè â äåðåâå ìîäåëåé)
 
}
 
 
 
 
}
else if(!class_filter.isEmpty()) // åñëè ôèëüòð äëÿ êëàññà íå ïóñòîé)
{
filtr_tmp.append(class_filter); // äîáàâèì è ôèëüòð äëÿ êëàññà (êîòîðûé óêàçûâàëè â äåðåâå ìîäåëåé)
}
 
 
}
 
 
869,7 → 901,9
 
void MainWindow::on_pushButton_12_clicked()// íàæàòèå êíîïêè "Ñáðîñèòü èçìåíåíèÿ" (íà âêëàäêå ôèëüòðîâ)
{
ui->tableView_3->setModel(filter_model);
filter_model->select();
 
ui->pushButton_11->setEnabled(false);
ui->pushButton_12->setEnabled(false);
}
1415,13 → 1449,13
 
 
result_str.append(Condition);
result_str.append(tr(" "));
result_str.append(tr(" `"));
result_str.append(FieldName);
result_str.append(tr(" "));
result_str.append(tr("`"));
result_str.append(ConditionalSymbol);
result_str.append(tr(" "));
result_str.append(tr("'"));
result_str.append(ValueForComparison);
result_str.append(tr(" "));
result_str.append(tr("' "));
result_str.append(PostCondition);