intern report(erkin karahayit
TRANSCRIPT
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 1/55
1
METU
2009-2010 FALL
ELECTRICAL AND ELECTRONIC
ENGINEERING
EE300
SUMMER PRACTICE REPORT
Student Name : Erkin KARAHAYIT
Student ID : 1554948
SP Date : 17/08/2009 to 11/09/2009Submission Date : 21/09/2009
SP Company Name : Karel Electronics
Company Division : Communication Technology Design Group
Company Location : Bilkent/ANKARA
Related Field : Computers and Telecommunication
Student Contact Information:
Phone Number: 0537 634 6667
E-mail address: [email protected]
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 2/55
2
TABLE OF CONTENT
1. INTRODUCTION
2. DESCRIPTION OF COMPANY
2.1. COMPANY NAME
2.2COMPANY LOCATION
2.3. ORGANIZATION
2.4. NUMBER OF PEOPLE EMPLOYED
2.5. MAIN AREA OF BUSINESS
2.6. COMPANY PROFILE
2.7. RESEARCH AND DEVELOPMENT
2.8. PRODUCTION
2.9. SALES AND MARKETING
2.10. MISSION
2.11. BRIEF HISTORY OF COMPANY
3. WORK CONDUCTED AT THE SUMMER PRACTICE LOCATION
3.1. SOLDERING3.2. DESOLDERING
3.3. DESIGNING PROCEDURE
3.3.1 CREATING DATABASE FORM
3.3.2 WRITING DATA TO DATABAS
3.3.3 ENTERING DATA WITH DATE TIME PICKER TO DATABASE
3.3.4 FILTERING
3.4. TYPES OF BARCODES
3.5. BARCODE GENERATION SOFTWARE
3.6. BARCODE SCANNER
3.7. GENERAL PICTURE OF DATABASE PROGRAM
3.8. FULL CODE OF DATABASE PROGRAM
4. CONCLUSION
5. REFERENCES
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 3/55
3
1. INTRODUCTION
I have performed my second year Summer Practice in the research and development
center at Karel Electronics which is the leading telecommunication company of Turkey. Karel
designs all kinds of telephone systems including public switches and PBX systems withtelephone sets and other accessories. My summer practice lasted totally four weeks, started at
17.08.2009 and ended at 11.09.2009. The division at which I have performed my work is the
communications technology design department. I have performed my work under supervision
of Alper Sarıkan who is communications technology design leader of company. I decided to
do my summer practice at Karel Electronics due to two main reasons. First one is Karel is one
of the biggest telecommunication company of Turkey. The second reason is that my friend
who performed their summer practices in this company before suggested Karel to me.
The main purpose of my intern project assigned by Alper Sarıkan is to create database
program which allow users to reach and store some material information. Material
information is classified into thirteen (13) groups. Name of the subheadings of our material
information are:
1) Manufacturer Name
2) Manufacturer Number
3) Why does the user enter these materials to our database program?
4) Distributor
5) Who entered the data
6) Place
7) Quantity
8) Barcode Number
9) Date
10) Explanation of material
11) Type of material
12) Karel Reserve Number
13) Drawer Number
Barcode number has special importance among these subheadings since barcode scanner is
implemented to our database program. User can reach the properties of material easily reading
the barcode with the help of our barcode scanner and search this barcode number in our
database program using filter button. Barcode reader is used to make it easy to reach database
and find material more quickly. One of the main purposes of my project is to connect the data
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 4/55
4
information with barcode number. In other words user can reach all the information about
material when the barcode number is entered in our database program.
Another critical subheading is Karel_Reserve_Number. It is important because all of the
materials which are using in the company have some kind of identification number called
Karel_Reserve_Number. For example connectors have Karel_Reserve_Number like
HKNK00045. ‘HKNK’ is constant for all connectors but number changes depending on
connector type. This code crucial since they are used by Karel Research and Development
engineers while designing projects.
My intern project has five parts which are:
a) Creating database program
b) Choosing suitable barcode scanner to buy
c) Choosing suitable barcode type to print
d) Choosing suitable barcode generation software to print our barcodes
e) Reading barcode and implement this barcode information to our database program
I completed this project by using Borland C++ Builder. This program provides me the two-
way visual C++ development environment with outstanding features for quickly building
database applications.
In this report, a detailed description of the things that I have done and my observations duringmy internship is included. It begins with the general description of my summer practice
company, Karel Electronics, in which main areas of business, the organizational structure of
company and profile of company are explained. Then the main part of the report including the
works related with the creating database program, choosing barcode type, choosing barcode
scanner and soldering process follows the description part of the report. Afterwards, the
conclusion part comes, consisting of the general assessment of the company, the advantages
and disadvantages of the performing the summer practice in Karel Electronics Corporation.
Also an appendix is included as a reference text.
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 5/55
5
2. DESCRIPTION OF COMPANY
2.1. COMPANY NAME
Karel Electronics Corporation
2.2. COMPANY LOCATION
• Head OfficeAddress: Kore Şehitleri Caddesi Yzb. Kaya Aldoğan Sokak 16 Zincirlikuyu 34394 Đstanbul
Telephone: +902122883100
• Research and Development CenterAddress: Cyberpark Cyber plaza B Blok Kat 3 Bilkent 06800 Ankara
Telephone: +903122650297
• Production CenterAddress: Organize Sanayi Bölgesi Gazneliler Caddesi 10 Sincan 06935 Ankara
Telephone: +903122670244
2.3. ORGANIZATION
Karel Electronics Corporation has its headquarters in Istanbul, production premises
and the R&D Center in Ankara and offices in Đzmir, Antalya, Van and Bursa, employ 550
people with 100 engineer. Karel Research and Development center employs 79 people with58 engineers.
2.4. NUMBER OF PEOPLE EMPLOYED
It is reported that there are 110 employees, 77 of which are engineers, working at
Karel Research and Development Center.
2.5. MAIN AREA OF BUSINESS
Karel's core business is the design, development, production and marketing of all
kinds of telephone systems including public switches and PBX systems with telephone sets
and other accessories.
2.6. COMPANY PROFILE
Karel Electronics Corporation, established in 1986, is the leading manufacturer and
supplier of Telecommunication Equipment of Turkey. Karel devises all of its core products
under its own license. With its telephone systems covering the whole range from a few to
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 6/55
6
thousands of ports, Karel has the absolute and indisputable leadership in the local market and
a strong and widening presence in world markets. Its ever-rising performance has placed
Karel among the top 25 manufacturers of telephone systems in the world, and it is the leading
manufacturer of the world for PSE (Premises Switching Equipment) shipments to Middle East
& Africa as certified by Gartner Dataquest. The strong distribution network composed of
authorized distributors, wholesalers, dealers and sales points is the driving force for the
widespread marketing activities. Karel offers optimum solutions for a wide range of
enterprises such as hotels & hospitals, banks, manufacturing plants, multi-location offices,
public offices and telecom operators worldwide. Within the context of its activities in
telecommunications, Karel collaborates with reputable companies to develop turnkey projects
for private and public companies including telecom operators in its homeland as well as
neighboring countries.
2.7. RESEARCH AND DEVELOPMENT
The activities for product and system development are implemented by the Research
and Development Center in Cyberpark, Bilkent University. Karel's competitiveness in the
long run depends on its competence to get acquainted with new technologies, integrate them
in its products and solutions combined with its potential and capability to develop new
technologies. This is the philosophy behind Karel's generous 10 % investment of turnoverevery year in research and development activities. Karel does not have any technological
dependence for the license and know-how of the products in its portfolio. As of today, Karel
Research and Development Center gives support to the design of electronic boards produced
by Aselsan and Arcelik, which are the biggest manufacturers of military equipments and
household appliances in Turkey, respectively.
2.8. PRODUCTION
Karel performs its manufacturing activities in Ayas Industrial Zone, Ankara, through
Production Planning & Control, Purchasing and Production Departments, in its plant that sits
on 20.000 m2 of area of which 10.000 m2 is closed. The manufacturing chain that lies
between suppliers and customers is supervised via the ERP system integrated to the company
network. The insertion and test machines of latest technology are employed in the production
line which is under continuous development. Automatic insertion is based on axial, radial and
SMD technologies. In-circuit testers and functional testers are used for testing/verification.
Total automated component insertion rate is 210.000 components per hour. The quality and
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 7/55
7
reliability of the production is increased by the full automated conformal coating which is
done to protect the electronic boards from environmental influences, by heat test cabins and
vibration test devices.
2.9. SALES AND MARKETING
Globally, as per Gartner Dataquest Reports:
• Karel is one of the top 25 manufacturers of telephone exchanges in the world. • Karel is number one company in the Middle East and Africa region for PSE for the
last three years
• Karel’s market share in the region is over 23%.
Karel is leader of Turkish PABX market with:
• 460.000 PABX unit and 5.5 million total PABX lines installed.
Local Distribution Channels
Karel’s domestic sales organization consists of more than 300 authorized dealers and more
than 500 sales outlets, which are coordinated through Karel offices in Đstanbul, Ankara, Izmir,
Antalya and Van. Authorized Karel dealers offer sales and after sales services throughout
Turkey. The dealers are closely monitored by Karel and are regularly updated through
technical or other training programmers.
Worldwide Partnerships
Karel offers user-friendly and internationally approved telecommunication solutions to end-
users of more than 20 countries in Europe, Africa and Asia. Karel focuses on international
marketing by exporting over 30% of its overall production, and seeks to implement a
distribution network similar to the domestic one in the international markets. Karel
collaborates with her distributors and gives technical support for Karel products, worldwide.
In addition to export activities, Karel collaborates with well known vendors of
telecommunications equipments, and consequently, has introduced fax machines, GSM
telephones, CT-1, DECT handsets and many other well sought products into the domestic
market.
2.10. MISSION
Karel’s mission is to offer products and solutions based on:
• Powerful engineering force furnished with the best equipment available.
• A quality assurance system under continuous improvement.
• Monitoring customer requirements and market developments.
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 8/55
8
• Satisfying best(Price/Performance) ratio while keeping the quality maximum.
2.10. BRIEF HISTORY OF COMPANY
1986 -Karel was established. MS48 model telephone exchange system was started to
produce.
1988 -MS26 exchange system was presented to market.
1989 -The first tiny printer of the market was produced.
1990 -Exporting was started.
1991 -Exporting company, called Telekom A.S. was established.
1993 -Production and R&D center was established in Ankara - Sincan OSB.
1994 -ROBOP (Robot operator) was produced.
1995 -Karel joined with Defne to telephone market. MS14 exchange system was produced.
1996 -Pattern factor was established in Đstanbul.
-MS128 exchange system was produced.
-Headquarter was opened in Đzmir.
1997 -Headquarter was opened in Antalya.
-Design and production for Arçelik was started.
1998 -After reorganization and being corporation, ISO 9001 certificate was taken.
1999 -MS224 telephone exchange was presented to market.
-With DS200 numerical telephone exchange became finalist of TÜBĐTAK, TTGV
and TÜSĐAD technology awards in great company category.
-With DT04 DECT system became finalist of TESĐD electronics innovativeness-
creativeness awards in great company category.
2000 -Globally, as per Gartner Dataquest Reported, Karel was registered one of the top 25
manufacturers of telephone exchanges in the world and Karel was number one
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 9/55
9
company in the Middle East & Africa region for PSE for the previous three years.
2001 -Headquarter was opened in Van.
2003 -GT10-GT20 GSM router was presented to market.
2004 -Karel’s founders take place among the finalist at the Turkey election of “year
of entrepreneur in the world” which was arranged by Ernst & Young.
2005 -R&D was moved to Cyber plaza in Bilkent.
-IP PBX system with DS10 became finalist of TÜBĐTAK, TTGV and TÜSĐAD
Technology Greatest awards.
-MS26C telephone exchange was presented to market.
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 10/55
10
3. WORK CONDUCTED AT SUMMER PRACTICE LOCATION
3.1.SOLDERING
My first experience during my summer practice is to learn soldering at Karel
Production Center. Soldering is a process in electronics where two or more items are joined
together by melting and flowing a filler metal into the point, the filler metal having a
relatively low melting point. In other words soldering is a process to join metallic surfaces
when applying solder and flux. Flux is a chemical cleaner which prepares the hot surfaces for
the molten solder. Flux only cleans oxides of the surfaces to be soldered, but does not remove
dirt, oils and silicone. Hand soldering is performed with a soldering iron at Karel Electronics.
It is also necessary to select a suitable solder iron tip. All soldered joints require the same
elements of cleaning of the metal parts to be joined, fitting up the joints, heating the parts,applying the filter. Depending on the nature of flux material used cleaning of joints may be
required after they have cooled. In addition, when choosing a soldering tip, it is suggested to
select the largest possible diameter and shortest reach. For attachment of electronic
components to a PCB, proper selection and use of flux helps prevent oxidation during
soldering. The soldering iron must be clean and pre-timed with solder. After inserting a
through-hole mounted component, the excess head is cut off. Operator training and
experience provide better soldering results. It is also critical to understand soldercharacteristics, correct techniques and how a soldering iron works. Picture 2 is a good
illustration for soldering process.
Picture1 Picture2
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 11/55
11
3.2.DESOLDERING
In electronics, desoldering is a process to remove solder and components from printed
circuit boards. Desoldering is not as easy as soldering since printed circuit boards, especially
mother boards, have several layers . While trying to remove a component, it is possible tobreak the connection between the hole and the internal board layers. The main problem is that
printed circuit boards have several layers. We can see only two layers called solder layer and
component layer but there are other layers inside the printed circuit board. The holes where
the components are soldered to are metalized and serve not only to hold the component, but
also to make the electrical connection between the two visible PCB layers and the internal
PCB layers, which are not visible. If you make a wrong move while trying to remove a
component, you may break the connection between the hole and the internal board layers,
destroying your board.
3.3.DESIGNING PROCEDURE
Before starting to create my database program, it is necessary to study some basic C++
tutorials because there are some big difference like classes between C and C++. For that
reason the first thing that I have done is to read tutorials about Borland C++. This work is also
assigned me by Alper Sarıkan. During my summer project it is obvious that I will use these
two features of C++ Builder. Then I am ready to create our database program which is
available to store material information.
In Borland C++ Builder, the code should be written by hand. To make these
assignments occur, you must enter them in an event such as TbuttonOnClick event or edit
controls’ OnEnter event. Borland C++ Builder contains three (3) parts. The first one is ‘object
inspector’. It can be used to display and edit component properties and event handler
functions. The second one is ‘form window’ which contains buttons, icons, dialog boxes,
etc... It can be considered as visible part of the program for the user. And the last one is‘source page’ where the code is written. It is convenient to understand how the program
works, each control tool in the ‘form window’ and their task should be understood. Moreover
these buttons control static texts. I will explain my codes under the related buttons or edit
box’s heading.
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 12/55
12
3.3.1 CREATING DATABASE FORM
Delphi database applications get their data through the Borland Database Engine
(BDE). The database must be defined before the application developed. Therefore, the first
thing that I have done is to create table which store name, type and size of the field. This tableis created with the help of ‘Database Desktop’ software. At the end of this process, a table
containing 13 fields is created. In a relational database, the data is organized into tables. Each
row of table contains information about a particular item, called record. Each column contains
one piece of information that makes up record, called field. I determined type and size of each
field in my table. For example type of ‘Barcode’ is chosen as alpha and its size is chosen as
25 characters. The versions of Paradox are used to create tables. These tables have all the
necessary characteristics and requirements of a database table. It will be better to see the
picture (picture 3-4-5) of process while designing our table which contains our fields and their
properties.
Picture 3
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 13/55
13
Picture 4
Picture 5
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 14/55
14
After completing all of these processes, ‘karel.db’ is ready to use as a datasource in our
program. All the changes we made our database will directly upload ‘karel.db’. Next step is to
connect karel.db to TTable and TDataSource. Method of connection of TTable, TDataSource
and ‘karel.db’ is explained in detail below part.
3.3.2 WRITING DATA TO DATABASE
Before starting to explain how I connect the components such as TTable and TDataSource to
each other, it will be better to explain them.
TField:
For each field, Borland creates a corresponding TField component. TField components are
important because they provide a direct link to a database column. TFields contain columns’
data type, current value and its format. TField components are invisible components that
provide access to field values and display attributes. By default TField components are
dynamically generated at design time when Active = True of TTable. TField component and
the value I assigned must be compatible; otherwise, my program will give an error. Therefore
most of field type was chosen as alpha.
TDataSource:
It acts as a conduit between a data access component between TTable, TQuery componentsand data aware components such as TDBGrid.
TTable:
It retrieves data from a database table via the borland database engine(BDE) and supplies it to
one or more data aware components through a TDataSource component. TTable sends data
received from a component to database via the BDE. In other words TTable component
establishes a connection to table in database.
TDB Navigator:
The TDB Navigator component enables me to browse a dataset record by record. The
navigator provides buttons for first record, next record, previous record, last record, insert
record, delete record, edit record, cancel edits, post edits, and refresh respectively. (Shown in
picture 6) This button is especially used while entering, deleting and updating data to our
database, ‘karel.db’.
Picture 6
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 15/55
15
TDBGrid:
The DBGrid component displays a dataset in tabular or spreadsheet format.
Data Aware Controls:
TDBGrid and TDBEdit are classified in this group. They provide display of data on a form.
TDBGrid allows me look at, enter, change and delete data. These two components provide the
visible user interface of data but they are unaware of the structure of the table from which
they receive data.
Procedure:
To connect borland database engine to our program, intermediary object should be
used to perform the link from my program to the table of my database. The database,
‘karel.db’ that I need to connect is called our source. Database form wizard is used whilecreating database form. The advantage of this wizard is that I do not have to place any
database components to form. This wizard automatically places the necessary components
and a few properties of these components are changed with the help of object inspector
window. The Database Form Wizard enables me to create both simple forms and
master/detail forms. It enables me to choose whether my dataset will be a TTable or a
TQuery. The wizard enables me to select a database table and to select the fields from that
table that you want displayed on the form.Step 1:
The first step gives me options for selecting either a single table form or a master/detail form
as seen in picture 7. TTable components are used in our program since it is good enough for
local databases.
Picture 7
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 16/55
16
Step 2:
In this step I have to choose master data source, ‘karel.db’, and directory as seen in picture 8.
Picture 8
Step 3:
In this step fields of master table that I want to display in my form is selected as seen in
picture 9. All the fields are selected in my form by pushing ‘button >>’.
Picture 9
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 17/55
17
Step 4:
Next screen presents options for displaying the selected fields on the form (Picture 10). Third
option: Grid is selected in our project.
Picture 10
After completing all of these steps, our form including TDB Navigator, TDBGrid,
TTable and TDataSource is automatically created. Next step is to connect these components
to each other. I firstly changed some properties of TTable using object inspector window. The
directory, ‘samplebox’ where our database resides in the DataBaseName property is entered.
Secondly TableName is changed as ‘karel.db’ since this change connects TTable to our
database. Finally TDataSource component is connected to interactive data control components
and TTable data access objects by changing the property of TDataSource as DataSet=Table1.
Now TTable, TDataSource, TDBGrid and karel.db are connected to each other. Then our
fields should be added to our DBGrid. As shown in picture 1, all of our fields are added as a
column to our database table using edit command of grid. That means when the program iscompiled, our system is ready to be entered some data.
Picture 11
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 18/55
18
3.3.3 ENTERING DATA WITH DATE TIME PICKER TO DATABASE
While creating our table in ‘Database Desktop’ manager, the Islenme_Tarihi field is designed
as a type of date field. Because of this reason we can only enter the dates into our database in
the form of 01.01.2009. However, entering dates in this way can be a bit challenging for userssince user cannot know the exact form of date and if user tries to enter date in the different
format like 01/01/2009 our program will give an error. In order to prevent this problem, I
decided to place a drop down calendar into a cell of a DBGrid. This application creates
visually more attractive user interfaces for editing date fields, Islenme_Tarihi, inside a
DBGrid.(Picture 12)
Picture 12
Now it is time to explain how our calendar is matched to our fields. Firstly I placed a Button
and a DateTimePicker to our form. Secondly properties of DateTimePicker are changed with
the help of object inspector. These changes are DataField=Islenme_Tarihi and
DataSource=DataSource1. The property of button: visible = false is changed like this since
this button has no function in our program and it should not seen by program users. After
completing these processes, datetimepicker is directly connected to the Islenme_Tarihi field.
Then I implemented code shown in Table 1 to button1click.
void __fastcall TForm2::Button1Click(TObject *Sender)
{
char sdate1[20];
Button1->Default=False;
wsprintf(sdate1, "SDATE>='%s'", DBDateTimePicker1->Date.DateString());
}
Table 1
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 19/55
19
After implementing this code, calendar is shown when the user clicks on the Islenme_Tarihi
field.But we still have a problem. I need to allign datetimepicker to each cell of
Islenme_Tarihi column. In order to prevent this problem, code shown in table 2 is added to
our program.
void __fastcall TForm2::DBGrid1DrawColumnCell(TObject *Sender,
const TRect &Rect, int DataCol, TColumn *Column,
TGridDrawState State)
{
if ( State.Contains(gdFocused) )
{
if (Column->Field->FullName == "ISLENME_TARIHI")
{
{
DBDateTimePicker1->Left = Rect.Left + DBGrid1->Left + 1;
DBDateTimePicker1->Top = Rect.Top + DBGrid1->Top + 1;
DBDateTimePicker1->Width = Rect.Right - Rect.Left + 2;
DBDateTimePicker1->Height = Rect.Bottom - Rect.Top + 2;
DBDateTimePicker1->Visible = True;
}
}
}
}
Table 2
After adding these two parts of code to our program, we still have a problem. Datetimepicker
is not closed after entering date to our database. In order to solve this problem, code shown in
table 3 is added to our program.
void __fastcall TForm2::DBGrid1ColExit(TObject *Sender)
{
if ( DBGrid1->SelectedField->FieldName == "ISLENME_TARIHI" ) {
DBDateTimePicker1->Visible = False;
}
}
Table 3
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 20/55
20
3.3.4 FILTERING
One of the main idea of creating this program is to find the necessary electrical
components easily. For that reason, it is not enough to create database and store some
information about materials. User can easily reach properties of the necessary componentsusing filter button. So I placed three filter buttons which are Barcode, Karel_Reserve_Number
and Yeri are placed on visual part of our program. These buttons are connected to combo
boxes. When the user enters data, which is wanted to search in our database, in combo box
and clicks on to buttons, our program starts to search this keyword in the related field. Code
shown in table 4 is added to our program in order to filter data based on barcode number.
//Önyüzde bulunan 'BARCODE' Button'un arama komutu------------------------------
void __fastcall TForm2::Button3Click(TObject *Sender)
{
if(ComboBox2->Text != "")
{
if(strlen(ComboBox2->Text.c_str())<30)
{
if(DBGrid1->DataSource ==DataSource1)
{
wsprintf(sFilter, "BARCODE = '%s*'", ComboBox2->Text);
tFilter = sFilter;
Table1->Filter = tFilter;
Table1->Filtered = true;
Table1->Last();
}
if(ComboBox2->Items->Capacity == 0)
ComboBox2->Items->Add(ComboBox2->Text);
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 21/55
21
int i=0;
bool match=false;
while(i< ComboBox2->Items->Capacity)
{
if(ComboBox2->Text == ComboBox2->Items->Strings[i])
{
match=true;
break; }
i++;
}
if(!match)
ComboBox2->Items->Add(ComboBox2->Text);
}
else
{
ComboBox2->Text = "";
Table1->Filter = "";
Table1->Filtered = true;
}
}
else
{
Table1->Filter = "";
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 22/55
22
Table1->Filtered = true;
Table1->Last();
}
}
//---------------------------------------------------------------------------
Table 5
The same procedure is applied to the other two filtering button. However, after testing our
program this filter does not seem sufficient to me and I decided to create another filter button
including date filter and keyword filter. For that purpose I placed ‘Gelismis_Arama’ button onmy form and open new form called form 3 as shown in picture 13.
Picture 13
In this form when you enter the ‘Okey’ button on form 3, searching process in databaseautomatically starts and when you enter the cancel button, form 3 closes and user return to
main form. To activate filtering user have to use combo boxes and click them firstly. Filtering
with ‘Islenme_Tarihi’ and ‘Keyword’ have completely different codes. In table 6 and table 7,
these codes are given respectively. With help of this detailed search button, user can easily
reach material easily and especially using keyword button makes the life easier. During all the
filtering processes, filtering options of table are changed in order to make the search
caseinsensitive. That is foCaseSensitive = true.
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 23/55
23
if(CheckBox4->Checked == true)
{
if( Form2->Table1->Filter == "" )
{
cFilter = AnsiString("ISLENME_TARIHI >= '") + DateTimePicker1->Date.DateString()
+ "'";
cFilter = cFilter + " and " + AnsiString("ISLENME_TARIHI <= '") + DateTimePicker2-
>Date.DateString() + "'";
Form2->Table1->Filter = cFilter;
Form2->Table1->Filtered = true;
Form2->Table1->Last();
} else
{
cFilter = AnsiString("ISLENME_TARIHI >= '") + DateTimePicker1->Date.DateString()
+ "'";
cFilter = cFilter + " and " + AnsiString("ISLENME_TARIHI <= '") + DateTimePicker2-
>Date.DateString() + "'";
Form2->Table1->Filter = Form2->Table1->Filter + " and " + cFilter;
Form2->Table1->Filtered = true;
Form2->Table1->Last();
} }
Table 6
void __fastcall TForm3::BitBtn1Click(TObject *Sender)
{
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 24/55
24
char temp2[5]={'"','%',0,0,0};
char temp3[5]={'%','"',')',0,0};
char sdate1[20],sdate2[20];
char temp[1024]="";
if(CheckBox3->Checked == true)
{
strcpy(temp,"SELECT *FROM karel.db WHERE");
addExpression(temp, "YERI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "MALZEMENIN_TANIMI", ComboBox3->Text.c_str());addOperator(temp,"OR");
addExpression(temp, "URETICI_ADI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "BARCODE", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "ADET", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "CEKMECE_NO", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "MALZEMENIN_TIPI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "KAREL_STOK_NO", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "URETICI_NUMARASI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "NE_AMACLA_ISLENDI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "KIM_ISLEDI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 25/55
25
addExpression(temp, "NE_AMACLA_ISLENDI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "HANGI_PROJEDE_KULLANILDI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "DISTRIBUTOR", ComboBox3->Text.c_str());
Form2->DataSource1->DataSet->Active = false;
Form2->Query2->SQL->Clear();
Form2->Query2->SQL->Add(temp);
Form2->Query2->Filtered = true;
Form2->Query2->FilterOptions.Contains (foCaseInsensitive);
Form2->DataSource1->DataSet = Form2->Query2;
Form2->DataSource1->DataSet->Active = true;
}
Table 7
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 26/55
26
3.4.TYPES OF BARCODES
After creating our database program which stores material information, I decided to choose
which type of barcode is suitable for our project. Barcodes are machine-readable
representation of information. Different bar and space characters are used to represent
different characters. Set of these patterns are grouped together to form a “Symbology”. In the
sale and production management, the use of barcodes provides the detailed accurate
information on key aspects of business and allows quick decisions to be made with more
confiedence. Barcodes are useful in receiving items. That’s why we are sticking barcodes to
our electronıc components at our project. There are different barcode symbology each having
special characteristics and features. The symbologies are designed to meet the needs of
specific application in industry. While choosing the proper barcode type, there are two maincriteria. The first one is that our barcode must be suitable with our laser printer. That means I
cannot choose barcodes which are diffucult to print with ordinary printers. Most of barcodes
need high quality barcode printers like Zebra TLP3842. The second criteria while choosing
barcode type is that it should be applicable most of the electric components like printed circuit
board(PCB). At Karel Electronics, most of the PCBs have specific barcode number,Code 93,
and one of our puposes is to store this PCBs information at our database. So I decided to use
Code 93 type barcodes in our project. Code93 barcode standart is one of the popular barcodesymbology which is useful for encoding the electronic components. Code 93 provides added
security as compared to other available barcode symbology. Code 93 barcode was designed to
provide barcode with both higher density and security. Detail information about brcode types
are given below part.
Code 93
Code 93 is capable of encoding the exact same characters as the normal Code 39 barcode,
uppercase letters A-Z, digits 0-9 and special characters such as SPACE, minus (-), period (.),dollar sign ($), slash (/), percent (%) and plus (+). The only difference is that this symbol is
more compact.
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 27/55
27
Code 39
Capable of encoding uppercase letters A-Z, digits 0-9 and special characters such as SPACE,
minus (-), period (.), dollar sign ($), slash (/), percent (%) and plus (+).This barcode can be of
Any length, but the more characters encoded, the larger the symbol will be.
Code 39 (Full ASCII)
This extension to Code 39 allows the encoding of additional characters that aren’t part of the
Code 39 character set, such as lowercase letters and additional symbols. Encoding of the Full
ASCII character set is possible by encoding one of four Code 39 characters (+ $ % /) followedby one of the 26 alphabetic Code 39 characters.
Code 39 (HIBC)
Code 39 (HIBC) is an alphanumeric symbol that is exactly the same as the normal Code 39,
but requires the special character (+) plus as the start character for each symbol.
CodaBar
Capable of encoding digits 0-9, six special characters, (-) dash, (:) colon, (.) period, ($) dollar
sign, (/) slash and (+) plus and the start/stop characters A, B, C, and D.
Code 128
This is an alphanumeric symbol capable of encoding digits 0-9, upper and lowercase letters
A-Z and all standard ASCII symbols. Code 128 is variable length, the more characters, the
larger the symbol will be.
UCC/EAN 128
This symbol is capable of encoding the same characters as a normal Code 128 barcode, digits
0-9, upper and lowercase letters A-Z and all standard ASCII symbols. However, UCC/EAN
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 28/55
28
128 formats the data in a different way so that the type of information encoded can be
identified. This is done with application identifiers; these 2, 3, or 4 digit numbers are
enclosed in parenthesis and identify the type of data which follows.
INTERLEAVED 2 OF 5
This is a numeric only barcode that must contain an even number of digits.
PostNET
This numeric only symbol is capable of encoding digits 0-9 and can be printed as a 5-digit
PostNET barcode, a 9-digit Zip+4 PostNET barcode, or a 9-digit DPBC PostNET barcode.
UPC-A
This fixed length, numeric only symbol must contain 12 digits.
UPC-E
This fixed length, numeric only symbol is a compressed version of the UPC-A. All barcodes
must contain 6 digits and because the UPC-E is used for the number system zero, all symbols
must begin with a zero.
EAN-8
This fixed length, numeric only symbol is a compressed version of the UPC-A. All barcodes
must contain 6 digits and because the UPC-E is used for the number system zero, all symbolsmust begin with a zero.
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 29/55
29
EAN-13
This fixed length, numeric only symbol is similar to the UPC-A, but encodes 13 characters
instead of 12.
MSI/Plessy
This variant of the Plessey barcode is capable of encoding the digits 0-9 and is variable
length.
Bookland
Bookland encodes an ISBN number in an EAN-13 format. It is numeric only and always
begins with 978, which is the Bookland EAN prefix (this generator will automatically add this
prefix to your ISBN). The additional 10 digits are the ISBN number.
3.5.BARCODE GENERATION SOFTWARE
After making deep research in the internet, I decided to use ‘Universal Barcode Generator’
program. Since we can adjust the barcode value, barcode width, barcode height and barcode
format with help of this program. Moreover price of licence is 69$ which is convenient to our
budget.
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 30/55
30
Figure 1
3.6. BARCODE SCANNER
After choosing our barcode type and barcode generator software, next step is to determine
what kind of barcode scanner is suitable to our system. My advisor, Alper Sarıkan, wanted me
to make search about barcode scanner. After making some research 3 barcode scanners seem
perfect to our system. Name of these barcode scanners are:
Name: Price:
1) Intermec SR60 Industrial Barcode Scanner 900$
2) Motorola LS3408 Rugged Barcode Scanner 500$
3) Motorola LS2208 Symbol Barcode Scanner 200$
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 31/55
31
When I examined these products, the first thing I observed is huge gap between prices. Our
system is not too complicated. There are three main things that our system needs from
barcode scanner. The first one is that our barcode scanner should behave like keyboard. There
should not be any difference between entering barcode number from keyboard or reading
barcode with barcode scanner. Our database program is designed to enter barcode number
with barcode scanner like keyboard. In other words when we plug in the scanner, the
operating system will recognize it as a keyboard or human input device. It is designed like this
to make the program easier. The second one is that our barcode scanner should be capable of
decoding and transmitting Code 93 barcode type since I choose Code 93 barcode type to print.
And third one is best ratio of performance/ price. After making deep research and reading
features of these barcode scanners. My advisors, Alper Sarıkan, decided to use Motorola
Symbol LS2208 while storing barcode numbers into our database.
Advantages of using Motorola Symbol LS2208
a) Maximum productivity
b) Working range is 43cm( improves user productivity)
c) Fast performance at 100 scans per second( increases user productivity)
d) Affordable features
e) Getting started with the Symbol LS2208 is fast and simple 123scan setup utility
f) Easy-to-use tool reduces startup time and costs wherever the scanner is used
Symbol LS2208 Barcode Scanner
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 32/55
32
PHYSICAL CHARACTERISTICS OF LS2208
Color Twilight black, Cash register white
Corded Yes
Dimensions6 in. H x 2.5 in. W x 3.34 in. D 15.2 cm H x6.3 cm W x 8.4 cm
Handheld Yes
Power sourceHost power or external power supply; dependson host type
Voltage and current5 volts +/- 10% at 130 mA typical, 175 mA
max
Weight 5.15 oz./146 gm
PERFORMANCE CHARACTERISTICS OF LS2208
Decode capability 1D
Depth of fieldFrom contact to 17 in./43 cm on 100%U.P.C./EAN symbols
Interfaces supportedIBM, Keyboard wedge, RS-232, Synapse,
USB, Wand
Minimum resolution 20% minimum reflective difference
Pitch 2 +/-65 degrees
Roll (Tilt) 1 +/-30 degrees
Scan pattern Single line
Skew (Yaw) 3 +/-60 degrees
Technology Laser
USER ENVIRONMENT
Ambient light immunityImmune to direct exposure of normal officeand factory lighting conditions, as well asdirect exposure to sunlight
Drop specificationsUnit functions normally after repeated 5 ft./1.5m drops to concrete
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 33/55
33
3.8. GENERAL PICTURE OF DATABASE PROGRAM
Picture 14
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 34/55
34
Picture 15
3.8. FULL CODE OF DATABASE PROGRAM
HEADER FILE(Unit2.h)
//----------------------------------------------------------------------------
#ifndef Unit2H
#define Unit2H
//----------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Windows.hpp>
#include <Messages.hpp>
#include <Classes.hpp>
#include <Graphics.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <DBCtrls.hpp>
#include <DB.hpp>#include <DBGrids.hpp>
#include <Db.hpp>
#include <DBTables.hpp>
#include <ExtCtrls.hpp>
#include <Grids.hpp>
#include <Menus.hpp>
#include <Mask.hpp>#include <ComCtrls.hpp>
#include <ToolWin.hpp>
#include "DBDateTimePicker.hpp"
#include <Buttons.hpp>
#include <Dialogs.hpp>
//----------------------------------------------------------------------------
class TForm2 : public TForm
{
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 35/55
35
__published:
TDBGrid *DBGrid1;
TDBNavigator *DBNavigator;
TPanel *Panel1;
TDataSource *DataSource1;
TPanel *Panel2;
TTable *Table1;
TLabel *Label1;
TPanel *Panel3;
TButton *Button2;
TComboBox *ComboBox1;
TQuery *Query1;
TDBGrid *DBGrid2;
TComboBox *ComboBox2;
TComboBox *ComboBox3;
TButton *Button3;
TButton *GELISMIS_ARAMA;
TButton *Button4;
TButton *Button1;
TDBDateTimePicker *DBDateTimePicker1;
TLabel *Label2;
TDataSource *DataSource2;
TStringField *Table1URETICI_NUMARASI;
TStringField *Table1URETICI_ADI;
TStringField *Table1NE_AMACLA_ISLENDI;
TStringField *Table1HANGI_PROJEDE_KULLANILDI;
TStringField *Table1DISTRIBUTOR;
TStringField *Table1KIM_ISLEDI;
TStringField *Table1YERI;
TStringField *Table1BARCODE;
TStringField *Table1ADET;
TDateField *Table1ISLENME_TARIHI;
TStringField *Table1MALZEMENIN_TANIMI;
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 36/55
36
TStringField *Table1MALZEMENIN_TIPI;
TStringField *Table1KAREL_STOK_NO;
TStringField *Table1CEKMECE_NO;
TStringField *Query1URETICI_NUMARASI;
TStringField *Query1URETICI_ADI;
TStringField *Query1NE_AMACLA_ISLENDI;
TStringField *Query1HANGI_PROJEDE_KULLANILDI;
TStringField *Query1DISTRIBUTOR;
TStringField *Query1KIM_ISLEDI;
TStringField *Query1YERI;
TStringField *Query1BARCODE;
TStringField *Query1ADET;
TDateField *Query1ISLENME_TARIHI;
TStringField *Query1MALZEMENIN_TANIMI;
TStringField *Query1MALZEMENIN_TIPI;
TStringField *Query1KAREL_STOK_NO;
TStringField *Query1CEKMECE_NO;
TQuery *Query2;
void __fastcall FormCreate(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
void __fastcall Button3Click(TObject *Sender);
void __fastcall Button4Click(TObject *Sender);
void __fastcall Button1Click(TObject *Sender);
void __fastcall DBGrid1DrawColumnCell(TObject *Sender,
const TRect &Rect, int DataCol, TColumn *Column,
TGridDrawState State);
void __fastcall DBGrid1ColExit(TObject *Sender);
void __fastcall GELISMIS_ARAMAClick(TObject *Sender);
void __fastcall ToolButton7Click(TObject *Sender);
private:
// private declarations
public:
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 37/55
37
// public declarations
__fastcall TForm2(TComponent *Owner);
};
//----------------------------------------------------------------------------
extern TForm2 *Form2;
//----------------------------------------------------------------------------
#endif
SOURCE FILE(Unit2.cpp)
//----------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "Unit2.h"
#include "Unit3.h"
//----------------------------------------------------------------------------
#pragma link "DBDateTimePicker"
#pragma resource "*.dfm"
TForm2 *Form2;
AnsiString zFilter;
AnsiString tFilter;
AnsiString temp;
char sFilter[30];
//----------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent *Owner)
: TForm(Owner)
{
DBDateTimePicker1->Visible = False;
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 38/55
38
}
//----------------------------------------------------------------------------
void __fastcall TForm2::FormCreate(TObject *Sender)
{
Table1->Open();
}
//----------------------------------------------------------------------------
//Takvimi Field ile eşleştiriyor-----------------------------------------------
void __fastcall TForm2::Button1Click(TObject *Sender)
{
char sdate1[20];
Button1->Default=False;
wsprintf(sdate1, "SDATE>='%s'", DBDateTimePicker1->Date.DateString());
}
//-----------------------------------------------------------------------------
void __fastcall TForm2::DBGrid1DrawColumnCell(TObject *Sender,
const TRect &Rect, int DataCol, TColumn *Column,
TGridDrawState State)
{
if ( State.Contains(gdFocused) )
{
if (Column->Field->FullName == "ISLENME_TARIHI")
{
{
DBDateTimePicker1->Left = Rect.Left + DBGrid1->Left + 1;
DBDateTimePicker1->Top = Rect.Top + DBGrid1->Top + 1;
DBDateTimePicker1->Width = Rect.Right - Rect.Left + 2;
DBDateTimePicker1->Height = Rect.Bottom - Rect.Top + 2;
DBDateTimePicker1->Visible = True;
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 39/55
39
}
}
}
}
//---------------------------------------------------------------------------
void __fastcall TForm2::DBGrid1ColExit(TObject *Sender)
{
if ( DBGrid1->SelectedField->FieldName == "ISLENME_TARIHI" ) {
DBDateTimePicker1->Visible = False;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm2::GELISMIS_ARAMAClick(TObject *Sender)
{
Form3->Show();
}
//---------------------------------------------------------------------------
//Önyüzde bulunan 'YERI' Button'un arama komutu---------------------------------
void __fastcall TForm2::Button2Click(TObject *Sender)
{
if(ComboBox1->Text != "")
{
if(strlen(ComboBox1->Text.c_str())<30)
{
if(DBGrid1->DataSource ==DataSource1)
{
wsprintf(sFilter, "KAREL_STOK_NO = '%s*'", ComboBox1->Text);
tFilter = sFilter;
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 40/55
40
Table1->Filter = tFilter;
Table1->Filtered = true;
Table1->Last();
}
if(ComboBox1->Items->Capacity == 0)
ComboBox1->Items->Add(ComboBox1->Text);
int i=0;
bool match=false;
while(i< ComboBox1->Items->Capacity)
{
if(ComboBox1->Text == ComboBox1->Items->Strings[i])
{
match=true;
break;
}
i++;
}
if(!match)
ComboBox1->Items->Add(ComboBox1->Text);
}
else
{
ComboBox1->Text = "";
Table1->Filter = "";
Table1->Filtered = true;
}
}
else
{
Table1->Filter = "";
Table1->Filtered = true;
Table1->Last();
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 41/55
41
}
}
//---------------------------------------------------------------------------
//Önyüzde bulunan 'BARCODE' Button'un arama komutu------------------------------
void __fastcall TForm2::Button3Click(TObject *Sender)
{
if(ComboBox2->Text != "")
{
if(strlen(ComboBox2->Text.c_str())<30)
{
if(DBGrid1->DataSource ==DataSource1)
{
wsprintf(sFilter, "BARCODE = '%s*'", ComboBox2->Text);
tFilter = sFilter;
Table1->Filter = tFilter;
Table1->Filtered = true;
Table1->Last();
}
if(ComboBox2->Items->Capacity == 0)
ComboBox2->Items->Add(ComboBox2->Text);
int i=0;
bool match=false;
while(i< ComboBox2->Items->Capacity)
{
if(ComboBox2->Text == ComboBox2->Items->Strings[i])
{
match=true;
break;
}
i++;
}
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 42/55
42
if(!match)
ComboBox2->Items->Add(ComboBox2->Text);
}
else
{
ComboBox2->Text = "";
Table1->Filter = "";
Table1->Filtered = true;
}
}
else
{
Table1->Filter = "";
Table1->Filtered = true;
Table1->Last();
}
}
//---------------------------------------------------------------------------
//Önyüzde bulunan 'MALZEMENIN_TANIMI' Button'un arama komutu--------------------
void __fastcall TForm2::Button4Click(TObject *Sender)
{
if(ComboBox3->Text != "")
{
if(strlen(ComboBox3->Text.c_str())<30)
{
if(DBGrid1->DataSource ==DataSource1)
{
wsprintf(sFilter, "MALZEMENIN_TANIMI = '%s*'", ComboBox3->Text);
tFilter = sFilter;
Table1->Filter = tFilter;
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 43/55
43
Table1->Filtered = true;
Table1->Last();
}
if(ComboBox3->Items->Capacity == 0)
ComboBox3->Items->Add(ComboBox3->Text);
int i=0;
bool match=false;
while(i< ComboBox3->Items->Capacity)
{
if(ComboBox3->Text == ComboBox3->Items->Strings[i])
{
match=true;
break;
}
i++;
}
if(!match)
ComboBox3->Items->Add(ComboBox3->Text);
}
else
{
ComboBox3->Text = "";
Table1->Filter = "";
Table1->Filtered = true;
}
}
else
{
Table1->Filter = "";
Table1->Filtered = true;
Table1->Last();
}
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 44/55
44
}
void __fastcall TForm2::ToolButton7Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
DBDateTimePicker.hpp
// Borland C++ Builder // Copyright (c) 1995, 1999 by Borland International
// All rights reserved
// (DO NOT EDIT: machine generated header) 'DBDateTimePicker.pas' rev: 5.00
#ifndef DBDateTimePickerHPP
#define DBDateTimePickerHPP
#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Db.hpp> // Pascal unit
#include <DBCtrls.hpp> // Pascal unit
#include <ComCtrls.hpp> // Pascal unit
#include <Dialogs.hpp> // Pascal unit
#include <Forms.hpp> // Pascal unit
#include <Controls.hpp> // Pascal unit
#include <Graphics.hpp> // Pascal unit
#include <Classes.hpp> // Pascal unit
#include <SysUtils.hpp> // Pascal unit
#include <Messages.hpp> // Pascal unit
#include <Windows.hpp> // Pascal unit
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 45/55
45
#include <SysInit.hpp> // Pascal unit
#include <System.hpp> // Pascal unit
//-- user supplied -----------------------------------------------------------
namespace Dbdatetimepicker
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TDBDateTimePicker;
class PASCALIMPLEMENTATION TDBDateTimePicker : public
Comctrls::TDateTimePicker
{
typedef Comctrls::TDateTimePicker inherited;
private:
Dbctrls::TFieldDataLink* FDataLink;
void __fastcall dataChange(System::TObject* Sender);
void __fastcall updateData(System::TObject* Sender);
void __fastcall setDataSource(Db::TDataSource* Value);
Db::TDataSource* __fastcall getDataSource(void);
void __fastcall setDataField(const AnsiString value);
AnsiString __fastcall getDataField();
Db::TField* __fastcall getField(void);
HIDESBASE MESSAGE void __fastcall CMEnter(Messages::TWMNoParams
&Message);
HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams
&Message);
public:
__fastcall virtual TDBDateTimePicker(Classes::TComponent* AOwner);
__fastcall virtual ~TDBDateTimePicker(void);
DYNAMIC void __fastcall Change(void);
__property Db::TField* Field = {read=getField};
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 46/55
46
__published:
__property AnsiString DataField = {read=getDataField, write=setDataField};
__property Db::TDataSource* DataSource = {read=getDataSource,
write=setDataSource};
public:
#pragma option push -w-inl
/* TWinControl.CreateParented */ inline __fastcall TDBDateTimePicker(HWND
ParentWindow) : Comctrls::TDateTimePicker(
ParentWindow) { }
#pragma option pop
};
//-- var, const, procedure ---------------------------------------------------
extern PACKAGE void __fastcall Register(void);
} /* namespace Dbdatetimepicker */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Dbdatetimepicker;
#endif
#pragma option pop // -w-
#pragma option pop // -Vx
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // DBDateTimePicker
HEADER FILE(Unit3.h)
//---------------------------------------------------------------------------
#ifndef Unit3H
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 47/55
47
#define Unit3H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Buttons.hpp>
#include <ComCtrls.hpp>
#include <Db.hpp>
#include <DBTables.hpp>
#include <DBGrids.hpp>
#include <Grids.hpp>
//---------------------------------------------------------------------------
class TForm3 : public TForm
{
__published: // IDE-managed Components
TCheckBox *CheckBox2;
TCheckBox *CheckBox3;
TCheckBox *CheckBox4;
TBitBtn *BitBtn1;
TDateTimePicker *DateTimePicker1;
TDateTimePicker *DateTimePicker2;
TBitBtn *BitBtn2;
TCheckBox *CheckBox1;
TCheckBox *CheckBox5;
TComboBox *ComboBox1;
TComboBox *ComboBox2;
TLabel *Label1;
TComboBox *ComboBox3;
void __fastcall BitBtn1Click(TObject *Sender);
void __fastcall BitBtn2Click(TObject *Sender);
private: // User declarations
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 48/55
48
public: // User declarations
__fastcall TForm3(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm3 *Form3;
//---------------------------------------------------------------------------
#endif
SOURCE FILE(Unit3.cpp)
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit2.h"
#include "stdio.h"
#include "Unit3.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm3 *Form3;
AnsiString aFilter;
AnsiString bFilter;
AnsiString cFilter;
char mFilter[30];
void addExpression(char *dest, char *dbCol, char *exp);
void addOperator(char *dest, char *opr);
//---------------------------------------------------------------------------
__fastcall TForm3::TForm3(TComponent* Owner)
: TForm(Owner)
{
}
//Gelismis arama motoru acan komut-------------------------------------------
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 49/55
49
void __fastcall TForm3::BitBtn1Click(TObject *Sender)
{
char temp2[5]={'"','%',0,0,0};
char temp3[5]={'%','"',')',0,0};
char sdate1[20],sdate2[20];
char temp[512]="";
if(CheckBox3->Checked == true)
{
strcpy(temp,"SELECT *FROM karel.db WHERE");
addExpression(temp, "YERI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "MALZEMENIN_TANIMI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "URETICI_ADI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "BARCODE", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "ADET", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "CEKMECE_NO", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "MALZEMENIN_TIPI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "KAREL_STOK_NO", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "URETICI_NUMARASI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "NE_AMACLA_ISLENDI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "KIM_ISLEDI", ComboBox3->Text.c_str());
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 50/55
50
addOperator(temp,"OR");
addExpression(temp, "NE_AMACLA_ISLENDI", ComboBox3->Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "HANGI_PROJEDE_KULLANILDI", ComboBox3-
>Text.c_str());
addOperator(temp,"OR");
addExpression(temp, "DISTRIBUTOR", ComboBox3->Text.c_str());
Form2->DataSource1->DataSet->Active = false;
Form2->Query2->SQL->Clear();
Form2->Query2->SQL->Add(temp);
Form2->DataSource1->DataSet = Form2->Query2;
Form2->DataSource1->DataSet->Active = true;
}
if(CheckBox4->Checked == true)
{
if( Form2->Table1->Filter == "" )
{
cFilter = AnsiString("ISLENME_TARIHI >= '") + DateTimePicker1-
>Date.DateString() + "'";
cFilter = cFilter + " and " + AnsiString("ISLENME_TARIHI <= '") +
DateTimePicker2->Date.DateString() + "'";
Form2->Table1->Filter = cFilter;
Form2->Table1->Filtered = true;
Form2->Table1->Last();
}
else
{
cFilter = AnsiString("ISLENME_TARIHI >= '") + DateTimePicker1-
>Date.DateString() + "'";
cFilter = cFilter + " and " + AnsiString("ISLENME_TARIHI <= '") +
DateTimePicker2->Date.DateString() + "'";
Form2->Table1->Filter = Form2->Table1->Filter + " and " + cFilter;
Form2->Table1->Filtered = true;
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 51/55
51
Form2->Table1->Last();
}
}
if(CheckBox5->Checked == true )
{
if(ComboBox1->Text != "")
{
if(strlen(ComboBox1->Text.c_str())<50)
{
if(Form2->DBGrid1->DataSource ==Form2->DataSource1)
{
wsprintf(mFilter, "DISTRIBUTOR = '%s*'", ComboBox1->Text);
aFilter = mFilter;
Form2->Table1->Filter = aFilter;
Form2->Table1->Filtered = true;
Form2->Table1->Last();
}
if(ComboBox1->Items->Capacity == 0)
ComboBox1->Items->Add(ComboBox1->Text);
int i=0;
bool match=false;
while(i< ComboBox1->Items->Capacity)
{
if(ComboBox1->Text == ComboBox1->Items->Strings[i])
{
match=true;
break;
}
i++;
}
if(!match)
ComboBox1->Items->Add(ComboBox1->Text);
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 52/55
52
}
else
{
ComboBox1->Text = "";
Form2->Table1->Filter = "";
Form2->Table1->Filtered = true;
}
}
else
{
Form2->Table1->Filter = "";
Form2->Table1->Filtered = true;
Form2->Table1->Last();
}
}
//---------------------------------------------------------------------------
if(CheckBox2->Checked == true)
{
if(ComboBox2->Text != "")
{
if(strlen(ComboBox2->Text.c_str())<50)
{
if(Form2->DBGrid1->DataSource ==Form2->DataSource1)
{
wsprintf(mFilter, "HANGI_PROJEDE_KULLANILDI = '%s*'", ComboBox2->Text);
aFilter = mFilter;
Form2->Table1->Filter = aFilter;
Form2->Table1->Filtered = true;
Form2->Table1->Last();
}
if(ComboBox2->Items->Capacity == 0)
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 53/55
53
ComboBox2->Items->Add(ComboBox2->Text);
int i=0;
bool match=false;
while(i< ComboBox2->Items->Capacity)
{
if(ComboBox2->Text == ComboBox2->Items->Strings[i])
{
match=true;
break;
}
i++;
}
if(!match)
ComboBox2->Items->Add(ComboBox2->Text);
}
else
{
ComboBox2->Text = "";
Form2->Table1->Filter = "";
Form2->Table1->Filtered = true;
}
}
else
{
Form2->Table1->Filter = "";
Form2->Table1->Filtered = true;
Form2->Table1->Last();
}
}
}
//---------------------------------------------------------------------------
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 54/55
54
void __fastcall TForm3::BitBtn2Click(TObject *Sender)
{
Form3->Close();
}
//---------------------------------------------------------------------------
void addExpression(char *dest, char *dbCol, char *exp){
char temp1[5]={' ','(',0,0,0};
char temp2[10]=" LIKE ";
char temp3[5]={'"','%',0,0,0};
char temp4[5]={'%','"',')',0,0};
strcat (dest,temp1);
strcat (dest,dbCol);
strcat (dest,temp2);
strcat (dest,temp3);
strcat(dest,exp);
strcat (dest,temp4);
}
///////////////////////
void addOperator(char *dest, char *opr){
strcat (dest," ");
strcat (dest,opr);
strcat (dest," "); }
8/8/2019 Intern Report(Erkin Karahayit
http://slidepdf.com/reader/full/intern-reporterkin-karahayit 55/55
4. CONCLUSION
First of all it is proud of me doing my summer practice in Karel since Karel is one of the
leading companies of Turkey in the telecommunication area. I was appreciated to be part of
Karel; however, it was true for only one month. All of the engineers and the other workers
pay too much attention to their duty and all the works are done professionally and on time.
During my summer practice I had a chance of observing many things about business life. First
of all working environment is completely different from university. You should always
expand your knowledge and improve yourself. Moreover, it is not enough to have knowledge
only on your subject; you should have general idea about what your coworkers are doing.
When I started to work in Karel, the first thing I observed is that working environment is nottoo stressful which make me feel more comfortable. On the other hand, if I have talked about
the benefits that I got, first of all while creating database program I have learned one
programming language, Borland C++. Performing my summer practice using C++ language
has special importance on me because before starting my summer practice I was approaching
to programming language with bias. Moreover, I was sure that I will not work in the computer
area in the future. During my summer practice, my idea has changed and I started to like
programming. One thing I observed at Karel is that telecommunication and computer are tooconnected to each other. Now I am thinking to improve myself in the telecommunication area.
Karel is really good company for students who want to improve yourself in this area. The
second benefit that I got is after creating our program I entered data with their information. I
categorized them into groups. During this step, I looked datasheets and I learned a lot of
things during this process. Lastly it is good to know someone will benefit from your works. It
was helpful to learn how important the practical experience is; however, I have not got
enough theoretical background. Actually I recommend this company to all the students for
business life because Karel is one step further from most of the companies in Turkey with its
facilities and technological opportunities.