#include "supprimer_marchandise.h"
#include "ui_supprimer_marchandise.h"
#include <QSystemTrayIcon>

supprimer_marchandise::supprimer_marchandise(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::supprimer_marchandise)
{
    ui->setupUi(this);
}

supprimer_marchandise::~supprimer_marchandise()
{
    delete ui;
}

void supprimer_marchandise::on_pushButton_clicked()
{
   int    id=ui->lineEdit->text().toInt();
    bool test=tmpmarchandise->supprimermarchendise(id);
    if(test)

    {   //Smtp* s = new Smtp( "hajmoussa2368@gmail.com", "Hm123456", "smtp.gmail.com", 465 );
        //s->sendMail("hajmoussa2368@gmail.com","youssef.ghedas@esprit.tn","une caisse a été supprimer avec succés","Mr youssef");
        notifier = new QSystemTrayIcon(this);
        notifier->setIcon(QIcon("notification.png"));
        notifier->show();
        notifier->showMessage("Fait","l'article a été supprimer",QSystemTrayIcon::Warning,10000);
        hide();



    }
    else
    {  notifier = new QSystemTrayIcon(this);
        notifier->setIcon(QIcon("notification.png"));
        notifier->show();
        notifier->showMessage("Erreur","",QSystemTrayIcon::Warning,10000);


}
}
