modifUVwindow::modifUVwindow(Factory* factory,QWidget *parent) : QDialog(parent), ui(new Ui::modifUVwindow), fac(factory) { ui->setupUi(this); ui->colonneuv->addItems(fac->getUVDAO()->getStringList("code")); ui->listcategorie->addItems(fac->getCategorieDAO()->getStringList("titre")); ui->listecursus->addItems(fac->getCursusDAO()->getStringList("code")); QObject::connect(ui->modifuv , SIGNAL(clicked()), this, SLOT(on_modifuv_clicked())); QObject::connect(ui->buttonBox , SIGNAL(accepted()), this, SLOT(saveuv())); QObject::connect(ui->butajoutcursus , SIGNAL(clicked()), this, SLOT(addcursus())); QObject::connect(ui->butretirecursus , SIGNAL(clicked()), this, SLOT(removecursus())); QObject::connect(ui->butajoutcredit , SIGNAL(clicked()), this, SLOT(addcredit())); QObject::connect(ui->butretirecredit , SIGNAL(clicked()), this, SLOT(removecredit())); }
void doprocessing (int sock) { int n; char buffer[256]; memset(&(buffer), '0', 256); int recvMsgSize; /* Receive message from client */ if ((recvMsgSize = recv(sock, buffer, 256, 0)) < 0) perror("ERROR reading to socket1"); if(buffer[3] == '|') //checks if add a credit to the Loan file addcredit(buffer); else if(buffer[4] == '|') //checks if edit a credit from the Loan file editcredit(buffer); else searchrfc(buffer, sock); //search for the credits based in the rfc /* Send received string and receive again until end of transmission */ while (recvMsgSize > 0) /* zero indicates end of transmission */ { /* Echo message back to client */ if (send(sock, buffer, recvMsgSize, 0) != recvMsgSize) perror("ERROR writing to socket"); /* See if there is more data to receive */ if ((recvMsgSize = recv(sock, buffer, 256, 0)) < 0) perror("ERROR reading to socket2"); } closesocket(sock); /* Close client socket */ }