
C# ПІДРУЧНИКИ / c# / Premier Press - C# Professional Projects
.pdfThis page intentionally left blank
|
|
Y |
|
L |
|
|
F |
|
|
M |
|
A |
|
|
E |
|
|
T |
|
|
Team-Fly®

PART IIIProfessional Project 1
This page intentionally left blank

Project 1
Creating a
Customer
Maintenance
Project

Project 1 Overview
Now that you have looked at the basics of C#, you can move on to developing projects by using C#. Beginning with this chapter, you will learn more about using C# and its features through projects. These projects will help you to get a better understanding of the features of C#, which will enable you to apply these features in real-life projects.
In this project, you will learn to create a customer maintenance system for CarKare, Inc. This involves creating a Windows application that contains Windows forms. In addition, you will learn to connect these Windows forms to an underlying database such that the Windows forms display data from the SQL database. Finally, you will learn to create crystal reports that provide you with an analysis of the customer data and the data of the job done by a worker in a month.
You will learn to create the Windows application throughout this project. In the next chapter, I will discuss the case study and design of the Windows application.

Chapter 7
Project
Case Study

114 Project 1 CREATING A CUSTOMER MAINTENANCE PROJECT
You have looked at the basics of C#; you will now move on to developing projects by using C#. Beginning with this chapter, you will learn more about using C# and its features through projects. These projects will help you to get a better understanding of the features of C#, which will enable you to apply these
features in real-life projects.
The first project will be to develop a Customer Maintenance project. This chapter covers the case study and design of the project.
Case Study
CareKar, Inc. is a car maintenance company in Atlanta. The workers of the company get their total compensation as a fixed salary added to allowances that are based on the work they do in a month. In addition, the company gives discounts to their regular customers. Don Burton, the accounts manager of the company, finds it difficult to calculate the gross salary of a worker at the end of a month. Therefore, Don has decided to track the work done by a worker on a daily basis. This would enable him to calculate the allowances given to workers at the end of a month. In addition, he has also decided to track the visits of a customer on a monthly basis. This data would enable him to calculate the discount to be given to a customer.
As a solution to Don’s problem, the company has decided to create databases that store information about workers, customers, work done by each worker, and consumable products. Based on the data in the databases, the company will then generate reports to analyze the data.The analysis of the data in the crystal reports will enable Don to find the work done by a worker in a month and, therefore, calculate the worker’s gross monthly salary. You will learn to create the Windows forms and crystal reports in the following chapters.
This project covers the creation of a Windows application for CareKar, Inc.However, before proceeding with the actual creation of the project, you must first understand the stages of a project. The following sections discuss the various stages in the development of a project in detail.

PROJECT CASE STUDY |
Chapter 7 |
|
115 |
|
|||
|
|
|
|
Project Life Cycle
The development life cycle of a project involves three phases:
Project initiation
Project execution
Project deployment
Project development actually starts when the need to develop or significantly change an existing system is identified. In this case, the need is to store, organize, and analyze the data.
After the business need is identified, the different approaches to meet it are reviewed for feasibility and appropriateness. An effective approach would be to create databases to store the data.The data in the databases can then be analyzed by displaying selective data or by grouping the data in a crystal report. I’ll now discuss the phases of a project life cycle in detail.
In the project initiation phase, a comprehensive list of tasks to be performed is prepared, and responsibilities, depending upon individual skills, are assigned to team members. I will be discussing the tasks that need to be performed when I proceed with the coding of the application.
In the project execution phase, the development team develops the application.This phase consists of the following stages:
Analyzing requirements
Creating high-level design
Creating low-level design
Constructing
Integration and testing
User acceptance testing
The final stage in the project life cycle is the project deployment phase. In this stage, the application is deployed at the client location, and support is provided to the client for a specified period. In addition, any bugs identified in the application are debugged. This phase consists of the following two stages:
Implementation
Operation and maintenance

116 Project 1 CREATING A CUSTOMER MAINTENANCE PROJECT
The following sections discuss each of these stages in detail. To start with, I will discuss the stages of the project execution phase.
Analyzing Requirements
Analyzing requirements is the process of determining and documenting a customer’s needs and constraints. Subsequently, based on these requirements, you create a plan for developing the application. The process of analyzing requirements often starts with a problem statement given by a customer or the customer’s representative. Analysts organize all the information gathered from the customer and analyze the customer’s needs. Finally, they prepare a written description of the customer’s problem and define a possible solution.
In this case, the problem statement, as stated by Don Burton, is “CareKar, Inc. needs to analyze data on jobs done by a worker and visits made by a customer.” On analyzing the problem statement, the analysts defined the following list of problems faced by CareKar, Inc.
The company needs to create databases to store and organize data.
The company needs to analyze the data.
Based on the analysis of the data, the company needs to find means to serve its customers better and more efficiently.
Based on the analysis of the data, the company needs to calculate the gross salary of an individual worker.
As a solution to the problems faced by the customer, the analysts proposed that a Windows application with the following features be developed for CareKar, Inc.
The application communicates with the databases and displays the data in the databases in the Windows forms.
The application includes a means to create crystal reports that are used for analysis of the data.
The application is then deployed at the client site.

PROJECT CASE STUDY |
Chapter 7 |
117 |
|
|
|
High-Level Design
The second stage in the project execution phase is to develop a high-level design. In the high-le vel design phase, the external characteristics of the system, such as interfaces, are designed. In addition, in this phase, the operating environment and various subsystems and their input and output are decided. In this stage, features that require user input or approval from the client are documented, and client approval is obtained for the same. These documents include the functional specifications document of the application, which is presented in a simple language to the client. The functional specifications include the description of the databases, forms, and reports that will be included in the application. This application will be called Customer Maintenance Project.
This project includes Windows forms that display data from an underlying database, CMS (Customer Maintenance System). The following section discusses the database design.
Database Design
The first step in the development of a project is to design a robust database. Before you design a database, it’s a good idea to recapitulate the concepts related to a database.
Why do you need a database? A database is a repository of data,a place where you can store data and extract it whenever required. You can store and extract data from a database in various ways. One of the ways is by using SQL (structured query language) statements. The following section discusses some of the basic SQL statements used to create and modify the data in a database.
The SQL Statements
SQL is an ANSI (American National Standards Institute) standard for accessing database systems. SQL statements can be used to retrieve and update data in a database. SQL works with databases such as Microsoft Access, DB2 (Database 2), Informix, Microsoft SQL Ser ver, Oracle, Sybase, and many others.
Databases contain tables, which contain the data in the form of rows and columns. Table 7-1 shows an example of how data is stored in tables.