Review


Problem 1
Create a Wintempla dialog application called PeopleMng to manage Clients and Employees. BE SURE to check the "Toolbar Icons" option at the moment to create the application.
  1. You will need to create two icons as shown below.
  2. Add two new Wintempla dialogs: ClientDlg and EmployeeDlg.
  3. Set the re-sizing border in the main window and use the dock button to dock the list view control and the toolbar.
  4. Review the section Wintempla > GUI > Toolbar to learn how to create and use a toolbar.
  5. Review the section Wintempla > Graphics > The Printer to learn how to send a document to the printer.
  6. Set ON DELETE CASCADE in references so that you can delete from the client table and from the employee table
  7. The Edit and Delete buttons must be enabled only when there is one row selected in the list view control
  8. The first name, last name and city can be a one word or two words with letters only.
  9. The username and password must be at least six characters a-z, A-Z, 0-9, á, é, í, ó, ú, _ or #.
  10. The user is asked for confirmation before deleting a client or an employee
Points to evaluate:
  1. The toolbar has the respective buttons
  2. The list view control shows the employees
  3. The list view control shows the clients
  4. It is possible to delete a client
  5. It is possible to delete an employee
  6. It is possible to insert a client
  7. It is possible to insert an employee
  8. It is possible to edit a client
  9. It is possible to edit an employee
  10. It is possible to print the list of employees or clients
  11. Regular expressions were used to validate: first name, last name and city
  12. Regular expressions were used to validate: username and password
  13. Double click in the list view control allows editing the item
  14. The Delete key allows deleting an item from the list view
  15. After deleting, inserting or editing an item, any selection is removed from the list view control; thus the Delete and Edit buttons become disabled
  16. The window can be resized and the list view control resizes accordingly.
  17. The Copy button copies the information from the list view control to the clip board (use the method: listView.CopyToClipboard()
  18. The Export button saves the information from the list view control in a Microsoft Excel file (use the method: listView.ExportToMsExcel() and the File Dialog to collect from the user the filename

Icon

Tip
Resources are data that is stored inside an executable file or a dll. There are several types of resources: images, icons, menus, sounds, etc. Resources require an ID to be found, there are some standard names use for each resource as shown below.
Los recursos son datos que se pueden almacenar dentro de un archivo ejecutable o una dll. Hay varios tipos de recursos: imágenes, iconos, menús, sonidos, etc. Los recursos requieren una ID para que estos puedan ser encontrados, hay varios nombres estándares para cada recurso como se muestra debajo.

  ID    Resource  
IDBBitmap
IDI Icono
IDM Menu or command

Tip
In the next figure observe that IDI_EMPLOYEE is the ID for the employee icon, while IDM_EMPLOYEE is used for the employee command (where the M stands from menu command). As historically, toolbar commands were also menu commands, IDM is used for both of them.
En la siguiente figura observe que IDI_EMPLOYEE es el ID del icono de los empleados, mientas que IDM_EMPLOYEE es usado para el comando de los empleados (donde la letra M quiere decir comando del menú). Como históricamente, los comandos de la barra de herramientas eran también comandos del menú, IDM es usado para ambos.

AddingIDM

MainWindowEvents

PropleMngIni

PeopleMngEmployee

Print

ClientEdit

EmployeeEdit

Balloon

Password

Delete

Problem 2
Create a Wintempla Web application called PeopleMngWeb to manage Clients and Employees. Publish the web application to a web server using Anonymous Access. The site has five web pages:
  1. Index allows choosing: Client or Employee
  2. ClientVwPage list the clients
  3. EmployeeVwPage list the employees
  4. ClientPage allows editing and adding clients
  5. EmployeePage allows editing and adding employees
Points to evaluate:
  1. The main page has the respective navigation options
  2. The list view control shows the employees
  3. The list view control shows the clients
  4. It is possible to delete a client
  5. It is possible to delete an employee
  6. It is possible to insert a client
  7. It is possible to insert an employee
  8. It is possible to edit a client
  9. It is possible to edit an employee
  10. Regular expressions were used to validate: first name, last name and city
  11. Regular expressions were used to validate: username and password
  12. The application was published in a web server

Step A
You will need three image files for this project: best_buy.gif, client.png and employee.png. Copy these file to your project folder.

ImageFiles

Step B
Open the file Index.h or Index.cpp. Once the file is open, use Wintempla to edit the web page as shown. Insert a Parent Node (a table), an Image and two Image links.

imgLogo

imkClient

imkEmployee

indexHtml

indexBrowser

Step G
Add and edit the web page: ClientVwPage. Use the onclick event on the Delete button.

ClientVwPageHtml

ClientVwPageBrowser

Step H
Add and edit the web page: EmployeeVwPage. Use the onclick event on the Delete button.

EmployeeVwPageHtml

EmployeeVwPageBrowser

Step I
Add and edit the web page: ClientPage.

ClientPageHtml

ClientPageBrowser

Step J
Add and edit the web page: EmployeePage.

EmployeePageHtml

EmployeePageBrowser

Step K
Edit the PeopleMngWeb.cpp file to include header file of the four web pages.

PeopleMngWeb.cpp
#include "stdafx.h" //________________________________________ PeopleMngWeb.cpp
#include "PeopleMngWeb.h"
#include "EmployeeVwPage.h"
#include "ClientVwPage.h"
#include "EmployeePage.h"
#include "ClientPage.h"
...


Step L
Run your program.

IndexRun

Step M
Edit the files ClientVwPage.h and ClientVwPage.cpp

ClientVwPage.h
#pragma once //_____________________________________________ ClientVwPage.h
#include "resource.h"

class ClientVwPage: public Web::Page
{
public:
     ClientVwPage()
     {
     }
     ~ClientVwPage()
     {
     }
     void UpdateListView();
private:
...
};

Step N
Edit the files EmployeeVwPage.h and EmployeeVwPage.cpp

EmployeeVwPage.h
#pragma once //_____________________________________________ EmployeeVwPage.h
#include "resource.h"

class EmployeeVwPage: public Web::Page
{
public:
     EmployeeVwPage()
     {
     }
     ~EmployeeVwPage()
     {
     }
     void UpdateListView();
private:
     ...
};

Step O
Edit the files ClientPage.h and ClientPage.cpp

ClientPage.h
#pragma once //_____________________________________________ ClientPage.h
#include "resource.h"

class ClientPage: public Web::Page
{
public:
     ClientPage()
     {
          client_id = -1;
     }
     ~ClientPage()
     {
     }
     int client_id;
private:
     ...
};

Step P
Edit the files EmployeePage.h and EmployeePage.cpp

EmployeePage.h
#pragma once //_____________________________________________ EmployeePage.h
#include "resource.h"

class EmployeePage: public Web::Page
{
public:
     EmployeePage()
     {
          employee_id = -1;
     }
     ~EmployeePage()
     {
     }
     int employee_id;
private:
     ...
};

ClientVw

ClientEditWeb

EmployeeVw

EmployeeEditWeb

DeleteWeb

© Copyright 2000-2019 Wintempla selo. All Rights Reserved. Sep 05 2019. Home