MIS 463 by jizhen1947

VIEWS: 7 PAGES: 133

									MIS 463     Decision Support Systems for Business        FALL 2009



                        Boğaziçi University
          Department of Management Information Systems




                PROJECT FINAL REPORT




                          DSS FOR

                 REAL ESTATE AGENCY




                         Team No: 07


                   ELİF ATEŞ (Coordinator)
                      GÜLAY YOLDAŞ
                     HATİCE GÜNGÖR
                   PERVİN İSKENDEROVA
Contents
I. INTRODUCTION .......................................................................................................................... 4
   I.1 The Decision Environment ................................................................................................... 4
   I.2 Mission of Project ................................................................................................................ 4
   I.3 Scope of Project ................................................................................................................... 4
   I.4 Methodology ........................................................................................................................ 5
II. LITERATURE SURVEY ................................................................................................................. 5
   II.1 Former Studies Review ....................................................................................................... 5
   II.2 Library Review ..................................................................................................................... 6
   II.3 Web Site Review ................................................................................................................. 6
III. DEVELOPMENT OF THE DSS ..................................................................................................... 7
   III.1. DSS Architecture ............................................................................................................... 7
   III.2. Technical Issues ................................................................................................................. 8
   III.3. Data Source and Flow Mechanism .................................................................................... 8
   III.4. Algoritms and Model......................................................................................................... 9
       III.4.1 Algorithms ................................................................................................................. 9
       III.4.2 Model ....................................................................................................................... 10
   III.5. User Interfaces ................................................................................................................ 26
IV. ASSESSMENT .......................................................................................................................... 32
V. CONCLUSION........................................................................................................................... 33
VI. REFERENCE ............................................................................................................................. 34
VII. APPENDIX .............................................................................................................................. 34
   VII.1. Code ............................................................................................................................... 34
       DBAccess ............................................................................................................................ 34
       Program.cs........................................................................................................................... 41
       Startup ................................................................................................................................. 42
       Main .................................................................................................................................... 42
       New User............................................................................................................................. 44
       New Customer..................................................................................................................... 45
       New Building ...................................................................................................................... 46
       Images ................................................................................................................................. 48
       Search User ......................................................................................................................... 49
       Search Customer ................................................................................................................. 52
       Search Building ................................................................................................................... 54
       AHP ..................................................................................................................................... 59


                                                                          -2-
Make Deal ......................................................................................................................... 131
Deals.................................................................................................................................. 132




                                                                   -3-
I. INTRODUCTION

I.1 The Decision Environment
To match the most suitable real-estate with customer through less effort and the shortest
time composes the basis of the decision problem in this project, when looked in focus, it
is clear that the problem is based on profit maximization or effort & cost minimization.
When deeply analyzed, it is obvious that there are two kinds of decision makers within
the scope of the problem. The real-estate agent is the main decision maker since s/he
wants to make as much as business (sale or rent) in the shortest time, the parameter with
the highest amount of sensitivity can be considered as the profit in this discussion. The
customer on the other hand is the minor decision maker who wants to find the most
economical real-estate with less effort and time.
The imbalance in the nature of economy presents a great deal of complexity to the
decision makers and will make the decision period of the customer very short on certain
occasions. While being a decision itself, the time it has taken also serves as a constraint
for the decisions of the real-estate agent. The level of goal attainment is certainly more
than the level of failure, however bad decision making can always lead to terrible results
since the outcomes are always somewhat unpredictable in a free economy.
The management of the real-estate in such a dynamic and complex environment
certainly has to necessitate the usage of a computerized information system for the most
spot on decision making not only for the customer but also for the real-estate agent.

I.2 Mission of Project
This project aims to design and develop a decision support system for the real estate
agency for helping its customers to find the more appropriate and convenient real estate
for themselves. Our DSS system’s goal is not only to serve our customers by providing
them the most suitable and detailed real estate but also make them to know how to
choose the best option by giving less effort and spending less time. With this system,
customers will minimize or even most likely to clear the options off, but also giving
very detailed and optimal options according to their need and wants.
Our project will decrease the time and effort which people spend while searching for a
suitable and the more convenient real estate for them and it will increase the
effectiveness and efficiency of the real estate searching process.
After completion of this project, the real estate agency will better help its customers to
find useful real estate for themselves and not to lose more time or energy to do this job.

I.3 Scope of Project
Generally, we will improve decision making process for selecting an appropriate real
estate by providing a system to respond to unique user needs. Users can use this screen
based system to find a suitable real estate by given criteria that they are searching for.
Our system also provides users to use several search options such as detailed search etc.
In the system, a database will be included and this database contains all data that
available for the real estates.
Users will spend less time and a low effort while they are searching for the residences
or offices that they want to rent or buy. After finding real estate that interests them, they
have the chance to find more about each one and their details.
Our project is going to include two types of real estate which are residence and office.
Any other types of real estate items will not be included in our project. Moreover, we

                                               -4-
plan not to take all the real estate that is included in the real estate agency. We will limit
the scope by choosing the only some number of the residence and office types.

I.4 Methodology
For modeling our decision support system, we decided to use the Analytic Hierarchy
Process (AHP) as our methodology. While searching a real estate, some number of
criteria is determined and evaluated by customers, and the importance of each criterion
differs from one person to another. Therefore, we need a methodology which each
individual is able to rank the criteria according to his/her priorities, and reach a decision
which best satisfies his/her needs. As in AHP the final decision is reached by
evaluating and comparing a number of different sub-decisions, the structure of our
decision problem is best match with AHP model.
In order to design our model, what we first need is to determine the set of criteria that
customers consider when choosing a real estate for them. For obtaining these data, we
plan to make a literature review and conduct a survey among the people who are going
to rent or buy a real estate recently. After determining these criteria, we need to develop
a database of the real estates and detailed information about them.

II. LITERATURE SURVEY
We have made documentation of a comprehensive review of the published and
unpublished work from secondary sources before building the system. The literature
survey part into three distinct titles namely, former studies, library review and website
review.

II.1 Former Studies Review
We have made a comprehensive research on similar projects in the sense of Analytical
Hierarchy Process (AHP) model. Unfortunately, there were very a few studies made on
real estate using AHP.
We could only derive benefit from the research “Environmental preferences of
homeowners Further evidence using the AHP method” published in the Journal of
Property Investment & Finance. (Bender et al., 2000) A comparative study of
perceptions concerning the environmental quality of residential real estate in
Switzerland based on empirical data collected in three different linguistic regions is
presented. Responses by homeowners in the Geneva, Zurich and Lugano areas to
questionnaires involving pairwise preference criteria are analyzed in the framework of
the analytic hierarchy process. Physical characteristics (such as the number of rooms,
the size of the lot and the building condition) can easily be measured and incorporated
in a hedonic model. In contrast, the measurement of environmental attributes (such as
proximity to the city center and to public transportation) is more problematic and binary
or other simple ordinal variables have traditionally been used. A major motivation for
examining environmental parameters in a real estate framework is that GIS technology
and databases have developed dynamically in most industrialized countries to the extent
that qualitative valuation methods may now be substituted by quantitative decision
support system. In conclusion, study says that to improve the applicability of the AHP
method to real estate, as well as to improve the statistical significance of the results,
substantially more data for more cities would be needed. With more input data, it would
be possible to obtain more reliable results for the preferences of different homeowner
categories. It might also be possible to refine the categories or add new ones of interest
for real estate market analysis. This method could, potentially, be used for research
covering several countries. This would make it possible to highlight different

                                               -5-
perceptions pertaining to the environmental quality which could be due to cultural
differences or socio-economic conditions.
We have benefited from this study while determining the criteria such as what should be
taken into consideration in terms of physical and environmental characteristics of the
real estate when buying or selling. However, we study on a local project that only
covers a small area in the Istanbul. We could not use all criteria given in the study
directly to our project.

II.2 Library Review
We have searched the electronic databases from Proquest and Emerald from the library
to find any useful literature related to real estate and real estate agencies. We have
looked over many articles. However, we have focused on mainly two articles.
Firstly, we have studied on “The web-based real estate multiple criterion negotiation
decision support systems: A new generation of decision support systems”.
(Urbanaviciene et al., 2009) It says that negotiations are inseparable part of the real
estate buying and selling process. Currently real estate are characterized by the intensive
creation and use of information, knowledge and automation (software, knowledge and
decision support systems, neural networks, etc.) applications. The article analyses
scientific research related to negotiations and presents the developed Web-based real
estate multiple criteria negotiation decision support system with integrated voice stress
analysis. We have benefited from this article to learn some extent of negotiation
processes. However, its main focus is on biometric technologies.
Secondly, we have analyzed the “The Conceptual Model of Construction and Real
Estate Negotiation”. (Urbanaviciene et al., 2009) The article says that scientific research
related to negotiations and presents the developed model for multiple criteria analysis of
construction and real estate negotiations. The analysis of the negotiation processes in
construction and real estate and the analysis of the relevant support for decision-making
in negotiations must be thorough; it must consider not only economic but also political,
legal, socio-cultural, psychological, consumer behavior, technological, quality of life
and other issues. However, we do not take in care legal, political or socio-cultural issues
in our project.
Although several articles that we have get help from during our project have some
relevant data, we totally cannot get the strict decision of our criteria from these articles.
Therefore, searching from several real estate websites and coming together in our
brainstorming meetings we have decided our criteria that we will use in our project.

II.3 Web Site Review
We have made some part of our search through web in order to use some selection
criteria and to get information about real estate sector. The web sites we used as a
reference are listed below:
     http://www.openhouse.com
     http://www.emlak.net/
     www.hurriyetemlak.com/
     www.milliyetemlak.com/
     http://www.ozenemlak.com.tr/main/index.php
     www.century21.com/
     www.realestateagencies.net/




                                               -6-
III. DEVELOPMENT OF THE DSS

III.1. DSS Architecture
Figure 1: Basic Workflow




The work flow of the system is illustrated basically by the diagram presented above.
Firstly, user selects the conditions or criteria of the house s/he looks for such as heating
type, building structure etc.
As second step, solver evaluates the criteria entered by the user, searches the database
and lists the optimum results according to DSS.
Optimum results are listed to the user as system output.




                                               -7-
III.2. Technical Issues
As determined in the project schedule, the coding phase of the project will start at the
10th week. The platform, tools and programming language will be as below:
      Because of the high convenience and usage, Microsoft Xp Proffesional
        Operating System will be used as platform by our programmers.
      The tools that will be used during the project are Sql Server 2005 for database,
        Microsoft Excel 2007 for the program and calculations, and Microsoft Word
        2007 for documentation purposes.
      The programming language of the project will be C# .Net


III.3. Data Source and Flow Mechanism

Inputs are obtained from user through user interfaces in our system. Firstly, user enters
the username and password to be authoritized. Main window of the system is opened.
User can record a new customer, building or a user. Also, customer or building search
can be made. If he makes a building search criteria shown to him. He selects criteria and
makes a search. Alternatives are listed suitable to him. He selects 3, 4 or 5 of the
alternatives. Then, the AHP is opened. He enters his points to each of real estate feature.
After all of the evaluations, solution is shown to the user, ranking of the each alternative
is done.




                                              -8-
III.4. Algoritms and Model
III.4.1 Algorithms

Figure 2: The Algorithm

                         System begins




 Select a Category                            Select a Location




                        Determine Price
                            Range

                                                                  Cancel


                          Determine
                        Number of Room




                        Determine Meter
                         Square Range




                       Click the “Find” or
                        “Cancel” Button




                              Find


                     Searching according to
                       criterias which are
                       determined upper
                               steps




                        An Alternatives
                          are listed



                         Click Picture
                       which you want to
                          see details



                        Building Details
                          are shown




                         System ends.




                                                   -9-
III.4.2 Model
III.4.2.1 Objective, Criteria and Alternatives

Objective: Selecting best suitable home or office for customer.
Criteria:
    Building Structure
          Floor Plan
          Condition
    Heating Type
          Natural Gas
          Kombi
          Central Heating
          Radiator
    Outdoor Attributes
          Security
          In Site
          Sport Center
          Swimming Pool
          Car Parking
    Price
Alternatives: User is able to filter buildings that offer home or office in the database
according to some criteria and chose three alternatives from the list. Database includes
100-120 buildings from Ulus, Bebek, Etiler and Levent.




                                             - 10 -
III.4.2.2 Hierarchical Tree
Figure 3: Hierarchical Tree




                              - 11 -
III.4.2.3 Modeling Steps


Step 1: In the first step, after user making pair wise matrix for criteria according to their
preferences, we determine the importance of the criterion. While giving the importance
to each criteria user can use a 9 point scale. User should enter the number between 0
and 9, if he enters number higher than 9 or lower than 0 system will give error. In
addition user also should every cell in the matrix; he cannot leave any cell blank. For
instance; user can fill matrix like, price is 7 times as important as building structure or
heating type is 4 times as important as outdoor attributes. Than we form our pair wise
matrix.

Table 1: Pair Wise Matrix
                             Building          Heating                        Outdoor
                             Structure         Type             Price         Attributes
Building structure                        1                 2            2                     2
Heating type                             1/2                1            3                     2
Price                                    1/2              1/3            1                     2
Outdoor Attributes                       1/2              1/2           1/2                    1
Sum                                   2 1/2                 4            7                     7




Step 2: In this step, we make some calculations to determine the priority vector. To do
this we take each entry and dividing it by the sum of the column it appears in. Then, we
get the following data table:

Table 2: Priority Vector Values
                        Building      Heating                    Outdoor            Priority
                        Structure     Type          Price        Attributes         Vector
Building structure          0,40000      0,52174    0,30769              0,28571           0,37879
Heating type                0,20000      0,26087    0,46154              0,28571           0,30203
Price                       0,20000      0,08696    0,15385              0,28571           0,18163
Outdoor Attributes          0,20000      0,13043    0,07692              0,14286           0,13755
                                                                                           1,00000




Step3: After finding the priority vector, we form a matrix in order to evaluate the
criterion consistency. The average random consistency degree in a 4 alternatives matrix
should be 0.9. The consistency ratio in our example is shown below:




                                                 - 12 -
Table 3: Consistency Ratios



                         Building        Heating                     Outdoor          Weighted
                         Structure       Type           Price        Attributes       Sum
 Building Structure       0,37879             0,60406   0,36326            0,27511         1,62121   4,2800
 Heating Type             0,18939             0,30203   0,54489            0,27511         1,31142   4,3420
 Price                    0,18939             0,10068   0,18163            0,27511         0,74681   4,1117
 Outdoor Attributes       0,18939             0,15102   0,09081            0,13755         0,56878   4,1349
                                                                                      Lamda          4,2172
                                                                                      CI             0,0724
                                                                                      CR             0,0804




Step 4: In this step we repeat same calculations for the sub criteria. We make the pair-wise
comparison of the sub criteria under the same criterion and normalize the evaluations.

Table 4: Repeating Calculations for sub criteria.


Building Structure
                   Floor plan           Condition
 Floor plan                         1                    2
 Condition                        1/2                    1
 Sum                            1 1/2                    3




Heating Type
                     Radiator Natural Gas Combi                  Central Heating
 Radiator                   1                  3          4                       3
 Natural gas              1/3                  1          2                       4
 Combi                    1/4                 1/2         1                       2
 Central Heating          1/3                 1/4       1/2                       1
 Sum                        2                  5          8                     10




Outdoor Attributes
                                                           Car
                     Security In Site         Sport Center Parking              Swimming Pool
 Security                   1            2                   2             2                   2
 In Site                  1/2            1                   3             2                   3
 Sport Center             1/2           1/3                  1             3                   2
 Car
 Parking                  1/2           1/2              1/3               1                   2
 Swimming Pool            1/2           1/3              1/2             1/2                   1
 Sum                        3        4 1/6              6 5/6           8 1/2                 10


                                                    - 13 -
Step 5: Then we also repeat Step 2 for sub criteria in order to find priority vector. We do
that by taking each entry and dividing by the sum of the column it appears in. Then, we get
the following data tables:

Table 5: Results of Step 5



Building
Structure      Floor Plan Condition        Priority Vector
Floor Plan          0,66667      0,66667            0,66667
Condition           0,33333      0,33333            0,33333
                                                    1,00000




                                                             Central       Priority
Heating Type          Radiator Natural Gas Combi             Heating       Vector
Radiator               0,52174       0,63158    0,53333          0,30000        0,49666
Natural gas            0,17391       0,21053    0,26667          0,40000        0,26278
Combi                  0,13043       0,10526    0,13333          0,20000        0,14226
Central Heating        0,17391       0,05263    0,06667          0,10000        0,09830
                                                                                1,00000




                                           Sport           Car           Swimming         Priority
Outdoor Attribute    Security In Site      Center          Parking       Pool             Vector
Security              0,33333 0,48000          0,29268         0,23529          0,20000     0,30826
In Site               0,16667 0,24000          0,43902         0,23529          0,30000     0,27620
Sport Center          0,16667 0,08000          0,14634         0,35294          0,20000     0,18919
Car
Parking               0,16667 0,12000          0,04878         0,11765          0,20000     0,13062
Swimming Pool         0,16667 0,08000          0,07317         0,05882          0,10000     0,09573
                                                                                            1,00000




                                                  - 14 -
      Step6: After finding the priority vector for each sub criteria, again we compose a matrix
      in order to evaluate the consistency ratio. The consistency ratio in our example for each
      sub criteria evaluation is shown in the following tables:

      Table 6: Results of Step 6

       Building                           Weighted
       Structure     Floor Plan Condition Sum
       Floor Plan          0,67           0,67                1,33             2,00
       Condition           0,33           0,33                0,67             2,00
                                                 Lamda                         2,00
                                                 CI                            0,00
                                                 CR                            0/0



                                 Natural                      Central           Weighted
       Heating Type     Radiator Gas               Combi      Heating           Sum
       Radiator                0,50        0,79       0,57              0,29            2,15            4,33
       Natural gas             0,17        0,26       0,28              0,39            1,11            4,21
       Combi                   0,12        0,13       0,14              0,20            0,59            4,18
       Central
       Heating                 0,17        0,07       0,07              0,10            0,40            4,08
                                                                                Lamda                   4,20
                                                                                CI                      0,07
                                                                                CR             0,073175133



Outdoor                                    Sport             Car                Swimming           Weighted
Attributes          Security In Site       Center            Parking            Pool               Sum
Security             0,30826    0,55239           0,37838            0,26124             0,19146        1,69174    5,488
In Site              0,15413    0,27620           0,56757            0,26124             0,28720        1,54633   5,5987
Sport
Center               0,15413    0,09207           0,18919            0,39186             0,19146        1,01871   5,3846
Car
Parking              0,15413    0,13810           0,06306            0,13062             0,19146        0,67738   5,1859
Swimming
Pool                 0,15413    0,09207           0,09459            0,06531             0,09573        0,50183   5,2421
                                                                                                   Lamda          5,3798
                                                                                                   CI              0,095
                                                                                                   CR             0,0848




                                                            - 15 -
Step7: The next concern is to evaluate all alternatives on each sub criterion and criteria
without any sub criterion. Then we might get the following matrixes:

Table 7: Weighting of Alternatives
Floor Plan               ALT1             ALT2                 ALT3                ALT4                   ALT5
ALT1                                  1                2                   3                       2               3
ALT2                                1/2                1                   3                       4               3
ALT3                                1/3              1/3                   1                       3               2
ALT4                                1/2              1/4                 1/3                       1               2
ALT5                                1/3              1/3                 1/2                     1/2               1
Sum                               2 2/3                4               7 5/6                  10 1/2              11



Condition         ALT1                ALT2            ALT3                  ALT4                        ALT5
ALT1                         1                   2                      2                         2                2
ALT2                       1/2                   1                      2                         3                3
ALT3                       1/2                 1/2                      1                         2                2
ALT4                       1/2                 1/3                    1/2                         1                2
ALT5                       1/2                 1/3                    1/2                       1/2                1
Sum                          3               4 1/6                      6                     8 1/2               10



Radiator          ALT1                ALT2                     ALT3                    ALT4                ALT5
ALT1                              1                   3                        2                       2               3
ALT2                          1/3                     1                        2                       3               3
ALT3                          1/2                    1/2                       1                       2               2
ALT4                          1/2                    1/3                    1/2                        1               3
ALT5                          1/3                    1/3                    1/2                   1/3                  1
Sum                        2 2/3                 5 1/6                         6                8 1/3              12

Natural Gas            ALT1               ALT2                  ALT3                   ALT4                ALT5
ALT1                                  1                    3                   4                      2                3
ALT2                               1/3                     1                   2                      3                3
ALT3                               1/4                1/2                      1                      2                2
ALT4                               1/2                1/3                    1/2                      1                2
ALT5                               1/3                1/3                    1/2                 1/2                   1
Sum                             2 2/5             5 1/6                        8                8 1/2              11


Combi           ALT1               ALT2                    ALT3                        ALT4             ALT5
ALT1                          1                      3                             2              4                    2
ALT2                       1/3                       1                             2              2                    3
ALT3                       1/2                   1/2                               1              2                    2
ALT4                       1/4                   1/2                         1/2                  1                    3
ALT5                       1/2                   1/3                         1/2                1/3                    1
Sum                      2 4/7                 5 1/3                               6          9 1/3                11




                                                           - 16 -
Central Heating          ALT1                ALT2            ALT3           ALT4                       ALT5
ALT1                                  1                 2               3                       2              4
ALT2                                1/2                 1               2                       3              2
ALT3                                1/3               1/2               1                       2              3
ALT4                                1/2               1/3             1/2                       1              2
ALT5                                1/4               1/2             1/3                     1/2              1
Sum                               2 4/7             4 1/3           6 5/6                   8 1/2             12


Security          ALT1                  ALT2                 ALT3                 ALT4                 ALT5
ALT1                               1                    2                    3                    2            4
ALT2                             1/2                    1                    3                    2            3
ALT3                             1/3                   1/3                   1                    3            2
ALT4                             1/2                   1/2                1/3                     1            2
ALT5                             1/4                   1/3                1/2                1/2               1
Sum                         2 4/7                   4 1/6                7 5/6             8 1/2              12


In Site           ALT1            ALT2                  ALT3                ALT4                 ALT5
ALT1                         1                     3                  2                  3                     4
ALT2                       1/3                     1                  2                  3                     3
ALT3                       1/2                   1/2                  1                  2                     2
ALT4                       1/3                   1/3                1/2                  1                     5
ALT5                       1/4                   1/3                1/2                1/5                     1
Sum                      2 2/5                 5 1/6                  6              9 1/5                    15




Swimming Pool       ALT1                ALT2            ALT3             ALT4                     ALT5
ALT1                              1                 3               2                       3                  2
ALT2                             1/3                1               2                       3                  3
ALT3                             1/2             1/2                1                       2                  2
ALT4                             1/3             1/3               1/2                      1                  2
ALT5                             1/2             1/3               1/2                    1/2                  1
Sum                         2 2/3              5 1/6                6                    9 1/2                10



Sport Center       ALT1                      ALT2                ALT3             ALT4                 ALT5
ALT1                                    1                    2               4                    2            3
ALT2                                   1/2                   1               2                    4            3
ALT3                                   1/4               1/2                 1                    2            2
ALT4                                   1/2               1/4                1/2                   1            3
ALT5                                   1/3               1/3                1/2                  1/3           1
Sum                               2 3/5                      4               8              9 1/3             12




                                                         - 17 -
Car Parking          ALT1             ALT2              ALT3            ALT4                 ALT5
ALT1                             1                2                2                     2           7
ALT2                            1/2               1                2                     2           3
ALT3                            1/2             1/2                1                     2           2
ALT4                            1/2             1/2               1/2                    1           4
ALT5                            1/7             1/3               1/2                  1/4           1
Sum                          2 2/3             4 1/3               6                 7 1/4          17


Price            ALT1                 ALT2              ALT3                 ALT4            ALT5
ALT1                            1                  2                    3                2           4
ALT2                           1/2                 1                    4                2           3
ALT3                           1/3               1/4                    1                2           2
ALT4                           1/2               1/2                   1/2               1           3
ALT5                           1/4               1/3                   1/2             1/3           1
Sum                         2 4/7                  4                    9            7 1/3          13


Table 8: Setting the Priorities

                                                                                         Priority
Floor Plan      ALT1           ALT2            ALT3             ALT4           ALT5      Vector
ALT1                   0,375           0,511            0,383            0,190     0,273        0,346
ALT2                   0,188           0,255            0,383            0,381     0,273        0,296
ALT3                   0,125           0,085            0,128            0,286         0,182        0,161
ALT4                   0,188           0,064            0,043            0,095         0,182        0,114
ALT5                   0,125           0,085            0,064            0,048         0,091        0,082
                                                                                                    1,000

                                                                                               Priority
Condition       ALT1      ALT2       ALT3      ALT4                                  ALT5      Vector
ALT1                0,333      0,480     0,333                               0,235       0,200      0,316
ALT2                0,167      0,240     0,333                               0,353       0,300      0,279
ALT3                0,167      0,120     0,167                               0,235       0,200      0,178
ALT4                0,167      0,080     0,083                               0,118       0,200      0,130
ALT5                0,167      0,080     0,083                               0,059       0,100      0,098
                                                                                                    1,000

                                                                                             Priority
Radiator      ALT1             ALT2              ALT3             ALT4             ALT5      Vector
ALT1                   0,375            0,581             0,333              0,240     0,250      0,356
ALT2                   0,125            0,194             0,333              0,360       0,250       0,252
ALT3                   0,188            0,097             0,167              0,240       0,167       0,172
ALT4                   0,188            0,065             0,083              0,120       0,250       0,141
ALT5                   0,125            0,065             0,083              0,040       0,083       0,079
                                                                                                     1,000




                                                       - 18 -
                                                                       Priority
Natural Gas       ALT1      ALT2       ALT3       ALT4       ALT5      Vector
ALT1                  0,414      0,581      0,500      0,235     0,273          0,400
ALT2                  0,138      0,194      0,250      0,353     0,273          0,241
ALT3                  0,103      0,097      0,125      0,235     0,182          0,148
ALT4                  0,207      0,065      0,063      0,118     0,182          0,127
ALT5                  0,138      0,065      0,063      0,059     0,091          0,083
                                                                                1,000


                                                                                                  Priority
Combi         ALT1             ALT2             ALT3               ALT4           ALT5            Vector
ALT1                   0,387           0,563               0,333          0,429          0,182         0,379
ALT2                   0,129           0,188               0,333          0,214          0,273         0,227
ALT3                   0,194           0,094               0,167          0,214          0,182         0,170
ALT4                   0,097           0,094               0,083          0,107          0,273         0,131
ALT5                   0,194           0,063               0,083          0,036          0,091         0,093
                                                                                                       1,000


                                                                                                 Priority
Central Heating       ALT1           ALT2           ALT3           ALT4           ALT5           Vector
ALT1                         0,387          0,462          0,439          0,235          0,333        0,371
ALT2                         0,194          0,231          0,293          0,353          0,167        0,247
ALT3                         0,129          0,115          0,146          0,235          0,250        0,175
ALT4                         0,194          0,077          0,073          0,118          0,167        0,126
ALT5                         0,097          0,115          0,049          0,059          0,083        0,081
                                                                                                      1,000


                                                                                                 Priority
Security       ALT1             ALT2            ALT3               ALT4           ALT5           Vector
ALT1                   0,387           0,480             0,383            0,235          0,333        0,364
ALT2                   0,194           0,240             0,383            0,235          0,250        0,260
ALT3                   0,129           0,080             0,128            0,353          0,167        0,171
ALT4                   0,194           0,120             0,043            0,118          0,167        0,128
ALT5                   0,097           0,080             0,064            0,059          0,083        0,077
                                                                                                      1,000


                                                                                             Priority
In Site       ALT1           ALT2             ALT3            ALT4           ALT5            Vector
ALT1                 0,414           0,581           0,333           0,326          0,267             0,384
ALT2                 0,138           0,194           0,333           0,326          0,200             0,238
ALT3                 0,207           0,097           0,167           0,217          0,133             0,164
ALT4                 0,138           0,065           0,083           0,109          0,333             0,146
ALT5                 0,103           0,065           0,083           0,022          0,067             0,068
                                                                                                      1,000




                                                     - 19 -
Swimming                                                                                          Priority
Pool             ALT1            ALT2            ALT3            ALT4            ALT5             Vector
ALT1                    0,375           0,581           0,333           0,316            0,200         0,361
ALT2                    0,125           0,194           0,333           0,316            0,300         0,254
ALT3                    0,188           0,097           0,167           0,211            0,200         0,172
ALT4                    0,125           0,065           0,083           0,105            0,200         0,116
ALT5                    0,188           0,065           0,083           0,053            0,100         0,098
                                                                                                       1,000


                                                                                                  Priority
Sport Center    ALT1              ALT2            ALT3             ALT4            ALT5           Vector
ALT1                     0,387           0,490            0,500           0,214           0,250        0,368
ALT2                     0,194           0,245            0,250           0,429           0,250        0,273
ALT3                     0,097           0,122            0,125           0,214           0,167        0,145
ALT4                     0,194           0,061            0,063           0,107           0,250        0,135
ALT5                     0,129           0,082            0,063           0,036           0,083        0,078
                                                                                                       1,000


                                                                                                   Priority
Car Parking      ALT1            ALT2             ALT3            ALT4            ALT5             Vector
ALT1                     0,378           0,462           0,333            0,276           0,412             0,372
ALT2                     0,189           0,231           0,333            0,276           0,176             0,241
ALT3                     0,189           0,115           0,167            0,276           0,118             0,173
ALT4                     0,189           0,115           0,083            0,138           0,235             0,152
ALT5                     0,054           0,077           0,083            0,034           0,059             0,062
                                                                                                            1,000


                                                                                                 Priority
Price          ALT1           ALT2              ALT3              ALT4            ALT5           Vector
ALT1                  0,387          0,490               0,333           0,273           0,308              0,358
ALT2                  0,194          0,245               0,444           0,273           0,231              0,277
ALT3                  0,129          0,061               0,111           0,273           0,154              0,146
ALT4                  0,194          0,122               0,056           0,136           0,231              0,148
ALT5                  0,097          0,082               0,056           0,045           0,077              0,071
                                                                                                            1,000




                                                   - 20 -
Consistency Ratios
Table 9: Floor Plan
Weighted Sum
          1,897           5,477
          1,656           5,598
          0,883           5,481
          0,580           5,079
          0,434           5,264
Lamda                     5,380
CI                     0,094961
CR                     0,084787




Table 10: Condition
 Weighted Sum
           1,684           5,321
           1,474           5,291
           0,930           5,232
           0,665           5,134
           0,502           5,139
 Lamda                     5,224
 CI                   0,05587741
 CR                   0,04989054




Table 11: Radiator
Weighted Sum
          1,976            5,553
          1,375            5,448
          0,916            5,342
          0,727            5,150
          0,415            5,234
Lamda                      5,346
CI                      0,086378
CR                      0,077123




                                   - 21 -
Table 12: Natural Gas
Weighted Sum
           2,221            5,545
           1,301            5,387
           0,789            5,311
           0,648            5,112
           0,434            5,239
Lamda                       5,319
CI                  0,0797035
CR                  0,0711638




Table 13: Combi

Weighted Sum
          2,110              5,573
          1,235              5,430
          0,921              5,417
          0,704              5,382
          0,487              5,224
Lamda                        5,405
CI                      0,101323
CR                      0,090467




Table 14: Central Heating
Weighted Sum
            1,965               5,293
            1,321               5,343
            0,916               5,226
            0,643               5,116
            0,418               5,189
Lamda                           5,233
CI                           0,058327
CR                           0,052078




                                        - 22 -
Table 15: Security
Weighted Sum
             1,961           5,390
             1,442           5,538
             0,917           5,352
             0,650           5,077
             0,404           5,277
Lamda                        5,327
CI                        0,081723
CR                        0,072967




Table 16: In Site
Weighted Sum
             2,136           5,560
             1,335           5,606
             0,902           5,495
             0,775           5,323
             0,355           5,219
Lamda                        5,440
CI                         0,11011
CR                        0,098312




Table 17: Swimming Pool
Weighted Sum
             2,008            5,564
             1,358            5,357
             0,906            5,258
             0,602            5,205
             0,507            5,190
Lamda                         5,315
CI                         0,078678
CR                         0,070248




                                      - 23 -
Table 18: Sport Center

Weighted Sum
            2,000             5,432
            1,522             5,569
            0,800             5,519
            0,695             5,154
            0,410             5,224
Lamda                         5,380
CI                       0,09489237
CR                       0,08472533




Table 19: Car Parking

Weighted Sum
            1,935              5,200
            1,262              5,234
            0,907              5,245
            0,791              5,199
            0,320              5,195
Lamda                          5,215
CI                         0,0536725
CR                         0,0479218




Table 20: Price


Weighted Sum
              1,930            5,389
              1,548            5,583
              0,772            5,305
              0,752            5,090
              0,375            5,266
Lamda                          5,326
CI                         0,0816226
CR                         0,0728774


                                       - 24 -
        Step8: The overall results of the evaluations are shown below:



           Building Structure                    Heating Type                    Price                            Outdoor Attributes                     Total
                                            Natural                 Central                                          Sport         Car       Swimming
         Floor Plan Condition   Radiator     Gas         Combi      Heating                Security    In Site       Center       Parking      Pool

Alt1     0,0874653 0,039948     0,053372 0,0317857 0,0162698         0,0110228 0,0650467 0,015424     0,0145929    0,0095829 0,00668692      0,004753153 0,3560

Alt2     0,0747208 0,035175 0,0378583 0,0191614 0,0097695           0,00734309 0,0503617   0,01104 0,00904892       0,007115 0,00433232       0,00333862 0,2693

Alt3     0,0406715    0,02244 0,0257295 0,0117833 0,0073048         0,00520208 0,0264431 0,007262 0,00623875       0,0037744 0,00310741      0,002268815 0,1622

Alt4     0,0288352 0,016355 0,0211615 0,0100538 0,0056176           0,00372886 0,0268334 0,005431 0,00553018       0,0035102 0,00273507      0,001522555 0,1313

Alt5     0,0208315 0,012344 0,0118861 0,0065823 0,0040045           0,00239362 0,0129444 0,003246     0,0025812    0,0020414     0,0011054   0,001285178 0,0812




Total        0,378786431                         0,302030578                   0,1816292                            0,137553751                          1,0000




        The analysis that we made through our example shows that the optimum real estate among three alternatives is the ALT1.




                                                      - 25 -
III.4.2.4 Database Structure

This database is designed according to literature information and online real estate
companies. This database includes seven tables as User, Owner, Building,
User_Building, Building_Properties, Customer and Building_Pictures. All tables have a
unique primary key and all tables connect each others with their primary keys.
Information about buildings are stored easily with using these tables.

Figure 4: Tables and Relationships in the database.



III.5. User Interfaces
This program begins with a “sign-in” interface. User will enter his username and
password. Then user clicks “” button to open selection page.


First screen when system runs is Login screen and it is used to enter to the system with
pre-defined user names and passwords.

Figure 5: Login screen.




When user name and password are entered, main window of the system is opened.
Recording a new customer, building or a user is the menu options. Also, searching is
among the menu options.




                                                 - 26 -
Figure 6: Main screen.




A new system user is created with his username and password.

Figure 7: New User screen.




                                          - 27 -
System users are searched. If required, passwords are changed by this window.

Figure 8: Search User screen.




New seller record is entered and saved via the new customer screen.

Figure 10: New Customer screen.




                                           - 28 -
Stored customer information is searched according to his/her id and name.

Figure 11: Search & Edit Customer screen.




New building record is entered with new building screen.



Figure 12: New Building screen.




                                            - 29 -
That is the building search window. First, you select the category of your real estate
whether it is buy building, rent building, buy Office or rent Office. Then, you select the
location, floor plane, condition, heating type and any additional features you look for.
When you click to the search buton, suitable buildings are listed.


Figure 13: Search Building screen.




                                             - 30 -
That is the AHP part of the system. You enter your points to the alternatives step by
step to the each of building features to rank your alternatives.

Figure 14: AHP screen.




This window shows the optimum solution. Each of the alternatives is scored according
to your priorities. Also, your selections are listed below to the window.

Figure 15: Solution screen.




                                             - 31 -
The ranking and percentages of the alternatives are shown here.

Figure 16: Ranking screen.




IV. ASSESSMENT
At the beginning, we determined our group members for DSS project. It was necessary
to find a subject for project .All group members declared an idea for project subject. At
the end, we decided to design and develop a decision support system for real estate
agency. We determined the aim of our system. Then, we made literature review about
real estate agency before building the system. We determined criteria for our system
with all group members. And then, for the rest of the project, we made the division of
labor. All group members completed the portion that is given to them in the desired
time. We know that to develop the project for DSS is difficult, but we overcame it as
studying effectively. Doing a project is a team work; we have a good team spirit. At the
end of the period, we believed that we have developed a useful system for real estate
agency.




                                             - 32 -
Following table shows our project schedule:

                          1     2     3    4     5      6   7   8     9   10   11   12    13    14
Group members
Decide topic
Gather information
Literature review
Determine Criterias
Apply methodology
Verification
Coding
Testing
Prepare Report
Presentation



V. CONCLUSION
Finding the right house is really a hard process for many people. During the real estate
search many people counter same problems because of inconvenient results of searches.
It is a nightmare for the real estate searchers.
DSS for Real Estate provides several different data points for you to consider. It offers
you most suitable and convenient results and makes you more informed during the
search period. To make our system more efficient AHP -which is one of the most
popular multiple criteria decision making methodology- is used to arrive at a right
decision.
According to our project plan, those phases are completed:

         Literature review (Former studies, Library, Web)
         Development of the model
         Mid-report
         Application

We created an application after the mid-report presentation according to comments
given the instructor. We prepared a system that works automatically to find the most
suitable houses for customer according to AHP model. AHP model determined all
priorities for houses as for those criteria’s. At the last step of the project, we tested the
system with real data then we know that our system works as a real AHP model and
shows most appropriate houses for customer with weighted percentages.




                                               - 33 -
VI. REFERENCE


[1] Bender, A., Din, A., Hoesli, M., & Brocher, S. (2000) "Environmental Preferences
of Homeowners Further Evidence Using The AHP Method", Journal of Property
Investment & Finance, Vol.8, Iss. 4; p. 445-455

[2] Urbanaviciene, V., Kaklauskas, A., Zavadskas, E. K., & Seniut, M. (2009) "The
Web Based Real Estate Multiple Criterion Negotiation Decision Support System: A
New Generation of Decision Support Systems", International Journal of Strategic
Property Management, Vol.13, Iss. 3; p. 267

[3] Urbanaviciene, V., Kaklauskas, A., & Zavadskas, E. K. (2009) "The Conceptual
Model of Construction and Real Estate Negotiation", International Journal of Strategic
Property Management, Vol. 13, Iss. 1; p. 53



VII. APPENDIX

VII.1. Code
DBAccess
using   System;
using   System.Collections.Generic;
using   System.Linq;
using   System.Text;
using   System.Data.SqlClient;
using   System.Data;

namespace Real_Estate
{
    class DBAccess
    {
        private SqlConnection conn;

        public DBAccess()
        {
            string connection = @"Data Source=.\SQLExpress;
database=REALESTATE;Integrated Security=True;";
           conn = new SqlConnection(connection);
        }

        public void NewCustomer(string tbName, string name,string
surname,string phone, string cell, string email,string address,string
uid)
        {
            conn.Open();
            string sql = "INSERT INTO CUSTOMERS VALUES('" + name +
"','" + surname +
                          "','" + phone + "','" + cell + "','" + email
+ "','" + address + "','"+uid+"')";
            SqlCommand cmd = new SqlCommand(sql, conn);
            cmd.ExecuteNonQuery();
            conn.Close();
        }

                                            - 34 -
        public DataTable SearchCustomerByName(DataTable dt, string
name)
        {
            try
            {
                conn.Open();
                string sql = "SELECT * FROM CUSTOMERS WHERE CNAME = '"
+ name.Split(' ')[0] + "' AND CSURNAME='" + name.Split(' ')[1] + "'";
                SqlDataAdapter da = new SqlDataAdapter(sql, conn);
                da.Fill(dt);
                conn.Close();
                return dt;
            }
            catch { return dt; }
        }

        public DataTable SearchCustomerByID(DataTable dt, int id)
        {
            try
            {
                conn.Open();
                string sql = "SELECT * FROM CUSTOMERS WHERE CID = " +
id;
                  SqlDataAdapter da = new SqlDataAdapter(sql, conn);
                  da.Fill(dt);
                  conn.Close();
                  return dt;
            }
            catch { return dt; }
        }

        public void GetAllCustomer(DataTable dt,string uid)
        {
            conn.Open();
            string sql = "SELECT * FROM CUSTOMERS WHERE
CUSERID='"+uid+"'";
            SqlDataAdapter da = new SqlDataAdapter(sql, conn);
            da.Fill(dt);
            conn.Close();
        }

        public int UpdateCustomer(int id,string name, string surname,
string phone, string cell, string email, string address)
        {
            int result;
            conn.Open();
            string sql = "UPDATE CUSTOMERS SET CNAME = '" + name +
"',CSURNAME='" + surname +
                          "', CPHONE='" + phone + "',CCELL='" + cell +
"',CEMAIL='" + email + "',CADDRESS='" + address +
                          "' WHERE CID=" + id;
            SqlCommand cmd = new SqlCommand(sql,conn);
            result=cmd.ExecuteNonQuery();
            conn.Close();
            return result;
        }

        public object NewBuilding(string usrid, int selid, string cat,
string city, string loc, string street, string road,



                                     - 35 -
                               int roomnum, int floor, string
floorplan, string apname, string zip, string adrdet,
                               int size, int cost, string cond, string
heat, string sec, string insite, string swim, string carpark, string
sport)
        {
            object result = new object();

            try
            {
                conn.Open();
                string sql = "INSERT INTO BUILDINGS" + " VALUES('" +
usrid + "',0," + selid + ",'"+cat+"','" + city + "','" + loc + "','" +
                              street + "','" + road + "'," + roomnum +
"," + floor + ",'" + floorplan + "','" + apname + "','" + zip + "','"
+ adrdet + "'," +
                              size + "," + cost + ",'" + cond + "','" +
heat + "','" + sec + "','" + insite + "','" + swim + "','" + carpark +
"','" + sport + "');SELECT @@Identity";
                SqlCommand cmd = new SqlCommand(sql, conn);
                result = cmd.ExecuteScalar();
                conn.Close();
            }
            catch { conn.Close(); }

            return result;
        }

        public void GetBuildings(DataTable dt,string Category,string
Location,string Condition,string Floorplane,
                                  string Heating,string Security,string
Swim,string Carpark,string Sporcenter,
                                  string Insite,string roomNum,string
cost, string size,string uid)
        {
             conn.Open();
             string sql = "SELECT (CUSTOMERS.CNAME+'
'+CUSTOMERS.CSURNAME) AS SELLER, BUILDINGS.CATEGORY, "+
                 " (BUILDINGS.LOCATION+' '+BUILDINGS.STREET+'
'+BUILDINGS.ROAD+' '+BUILDINGS.APARTNAME+' '+BUILDINGS.ADDRDETAIL) AS
ADDRESS, " +
                 " BUILDINGS.ROOMNUM, BUILDINGS.FLOOR,"+
                 " BUILDINGS.FLOORPLAN, BUILDINGS.ZIPCODE,
BUILDINGS.SIZE, "+
                 " BUILDINGS.COST, BUILDINGS.CONDITION,
BUILDINGS.HETAING, BUILDINGS.SECURITY, BUILDINGS.INSITE, "+
                 " BUILDINGS.SWIMPOOL, BUILDINGS.CARPARK,
BUILDINGS.SPORTCENTER,BUILDINGS.BID" +
                 " FROM BUILDINGS, CUSTOMERS WHERE
BUILDINGS.SELLERID=CUSTOMERS.CID AND BUILDINGS.BUYERID=0 AND (" +
Category + ") ";
             if (Location != "")
                 sql += "AND (" + Location + ") ";
             if (Condition != "")
                 sql += "AND (" + Condition + ") ";
             if (Floorplane != "")
                 sql += "AND (" + Floorplane + ") ";
             if (Heating != "")
                 sql += "AND (" + Heating + ") ";
             if (Security != "")
                 sql += "AND (" + Security + ") ";


                                    - 36 -
             if (Swim != "")
                 sql += "AND (" + Swim + ") ";
             if (Carpark != "")
                 sql += "AND (" + Carpark + ") ";
             if (Sporcenter != "")
                 sql += "AND (" + Sporcenter + ") ";
             if (Insite != "")
                 sql += "AND (" + Insite + ") ";
             if (Security != "")
                 sql += "AND (" + Security + ") ";
             if (size != "")
                 sql += "AND (" + size + ") ";
             if (cost != "")
                 sql += "AND (" + cost + ") ";
             if (roomNum != "")
                 sql += "AND (" + roomNum + ") ";
             sql += " AND USERID='" + uid + "'";

             SqlDataAdapter da = new SqlDataAdapter(sql, conn);
             da.Fill(dt);
             conn.Close();
         }

        public object CheckUser(string uid, string pwd)
        {
            conn.Open();
            string sql = "SELECT * FROM USERS WHERE UID='"+uid+"' AND
PASSWORD='"+pwd+"'";

             SqlCommand cmd = new SqlCommand(sql, conn);
             object result = cmd.ExecuteScalar();
             conn.Close();
             return result;
         }

         public void GetBuilByID(DataTable dt, int[] IDs)
         {
             conn.Open();
             string sql = "SELECT * FROM BUILDINGS WHERE BID IN (";
             for (int i = 0; i < IDs.Length; i++)
                 sql += IDs[i] + ",";
             sql = sql.Substring(0,sql.Length-1);
             sql += ")";
             SqlDataAdapter da = new SqlDataAdapter(sql, conn);
             da.Fill(dt);
             conn.Close();
         }

         public void GetAllCustomBui(DataTable dt, int custID, string
usrID)
         {
            conn.Open();
            string sql = "SELECT USERS.TITLE,(CUSTOMERS.CNAME+'
'+CUSTOMERS.CSURNAME) AS OWNER, CAST( BUILDINGS.BUYERID AS
varchar(30)) AS BUYER,BUILDINGS.CATEGORY, " +
            "
BUILDINGS.CITY,LOCATION,BUILDINGS.STREET,BUILDINGS.ROOMNUM,
BUILDINGS.FLOOR,"+
            " BUILDINGS.FLOORPLAN, BUILDINGS.ZIPCODE, BUILDINGS.SIZE,
"+



                                    - 37 -
            " BUILDINGS.COST, BUILDINGS.CONDITION, BUILDINGS.HETAING,
BUILDINGS.SECURITY, BUILDINGS.INSITE, "+
            " BUILDINGS.SWIMPOOL, BUILDINGS.CARPARK,
BUILDINGS.SPORTCENTER,BUILDINGS.BID"+
            " FROM BUILDINGS INNER JOIN USERS ON BUILDINGS.USERID =
USERS.UID CROSS JOIN CUSTOMERS "+
            " WHERE(BUILDINGS.USERID = '"+usrID +"') AND
(CUSTOMERS.CID = "+custID+") AND BUILDINGS.SELLERID="+custID;
            SqlDataAdapter da = new SqlDataAdapter(sql, conn);
            da.Fill(dt);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string g = dt.Rows[i]["BUYER"].ToString();
                if (dt.Rows[i]["BUYER"].ToString() == "0")
                {
                     dt.Rows[i]["BUYER"] = "FREE";
                }
                else
                {
                     string sql1 = "SELECT (CUSTOMERS.CNAME+'
'+CUSTOMERS.CSURNAME) AS BUYER FROM CUSTOMERS WHERE CID="+

int.Parse(dt.Rows[i]["BUYER"].ToString());
                    SqlCommand cmd = new SqlCommand(sql1, conn);
                    object obj = cmd.ExecuteScalar();
                    dt.Rows[i]["BUYER"] = obj.ToString();
                }
            }
            conn.Close();
        }

        public int NewUser(string uid, string pwd, string title)
        {
            int result = 0;
            conn.Open();
            string sql = "INSERT INTO USERS VALUES('" + uid + "','" +
pwd +
                          "','" + title + "'"+",''"+")";
            SqlCommand cmd = new SqlCommand(sql, conn);
            result=cmd.ExecuteNonQuery();
            conn.Close();
            return result;
        }

        public void GetAllUser(DataTable dt)
        {
            conn.Open();
            string sql = "SELECT * FROM USERS";
            SqlDataAdapter da = new SqlDataAdapter(sql, conn);
            da.Fill(dt);
            conn.Close();
        }

        public void GetUserByID(DataTable dt,string uid)
        {
            conn.Open();
            string sql = "SELECT * FROM USERS WHERE UID='"+uid+"'";
            SqlDataAdapter da = new SqlDataAdapter(sql, conn);
            da.Fill(dt);
            conn.Close();


                                    - 38 -
       }

        public int UpdateUser(string name,string pwd,string uid)
        {
            int result;
            conn.Open();
            string sql = "UPDATE USERS SET TITLE = '" + name +
"',PASSWORD='" + pwd + "' WHERE UID='"+uid+"'";
            SqlCommand cmd = new SqlCommand(sql, conn);
            result = cmd.ExecuteNonQuery();
            conn.Close();
            return result;
        }

        public int UpdateUserName(string name,string uid)
        {
            int result;
            conn.Open();
            string sql = "UPDATE USERS SET TITLE = '" + name + "'
WHERE UID='"+uid+"'";
            SqlCommand cmd = new SqlCommand(sql, conn);
            result = cmd.ExecuteNonQuery();
            conn.Close();
            return result;
        }

        public void GetAllDeals(DataTable dt, string uid)
        {
            conn.Open();
            string sql = "SELECT CUSTOMERS.CNAME + ' ' +
CUSTOMERS.CSURNAME AS NAME, CAST( DEALS.BUYERID AS varchar(30)) AS
BUYER, DEALS.BID, DEALS.DATE" +
                         " FROM DEALS INNER JOIN CUSTOMERS ON
DEALS.SELLERID= CUSTOMERS.CID WHERE DEALS.UID='" + uid + "'";
            SqlDataAdapter da = new SqlDataAdapter(sql, conn);
            da.Fill(dt);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string g = dt.Rows[i]["BUYER"].ToString();
                if(g!="0")
                {
                string sql1 = "SELECT (CUSTOMERS.CNAME+'
'+CUSTOMERS.CSURNAME) AS BUYER FROM CUSTOMERS WHERE CID=" +

int.Parse(dt.Rows[i]["BUYER"].ToString());
                SqlCommand cmd = new SqlCommand(sql1, conn);
                object obj = cmd.ExecuteScalar();
                dt.Rows[i]["BUYER"] = obj.ToString();
                }
            }

           conn.Close();
       }

        public void GetAllDealsBySeller(DataTable dt, string
uid,string names)
        {
            conn.Open();
            string[] name = names.Split(' ');



                                   - 39 -
            string sql = "SELECT CUSTOMERS.CNAME + ' ' +
CUSTOMERS.CSURNAME AS NAME, CAST( DEALS.BUYERID AS varchar(30)) AS
BUYER, DEALS.BID, DEALS.DATE" +
                         " FROM DEALS INNER JOIN CUSTOMERS ON
DEALS.SELLERID= CUSTOMERS.CID WHERE DEALS.UID='" + uid + "' AND
CUSTOMERS.CNAME='" + name[0] + "' AND CUSTOMERS.CSURNAME='" + name[1]
+ "'";
            SqlDataAdapter da = new SqlDataAdapter(sql, conn);
            da.Fill(dt);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string g = dt.Rows[i]["BUYER"].ToString();
                if (g!="0")
                {
                    string sql1 = "SELECT (CUSTOMERS.CNAME+'
'+CUSTOMERS.CSURNAME) AS BUYER FROM CUSTOMERS WHERE CID=" +

int.Parse(dt.Rows[i]["BUYER"].ToString());
                    SqlCommand cmd = new SqlCommand(sql1, conn);
                    object obj = cmd.ExecuteScalar();
                    dt.Rows[i]["BUYER"] = obj.ToString();
                }
            }

           conn.Close();
       }

        public void GetAllDealsByBuyer(DataTable dt, string uid,
string names)
        {
            conn.Open();
            string[] name = names.Split(' ');
            string sql = "SELECT CUSTOMERS.CNAME + ' ' +
CUSTOMERS.CSURNAME AS NAME, CAST( DEALS.BUYERID AS varchar(30)) AS
BUYER, DEALS.BID, DEALS.DATE" +
                         " FROM DEALS INNER JOIN CUSTOMERS ON
DEALS.SELLERID= CUSTOMERS.CID WHERE DEALS.UID='" + uid + "' AND
CUSTOMERS.CNAME='" + name[0] + "' AND CUSTOMERS.CSURNAME='" + name[1]
+ "'";
            SqlDataAdapter da = new SqlDataAdapter(sql, conn);
            da.Fill(dt);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string g = dt.Rows[i]["BUYER"].ToString();
                string sql1 = "SELECT (CUSTOMERS.CNAME+'
'+CUSTOMERS.CSURNAME) AS BUYER FROM CUSTOMERS WHERE CID=" +

int.Parse(dt.Rows[i]["BUYER"].ToString());
                SqlCommand cmd = new SqlCommand(sql1, conn);
                object obj = cmd.ExecuteScalar();
                dt.Rows[i]["BUYER"] = obj.ToString();
            }

           conn.Close();
       }

       public int MakeDeal(string uid,int bid,int buyer)
       {
           int result = 0;


                                   - 40 -
               conn.Open();

               string sql1 = "SELECT SELLERID FROM BUILDINGS WHERE BID="
+ bid;
               SqlCommand cmd = new SqlCommand(sql1, conn);
               object result1 = cmd.ExecuteScalar();

            string sql = "INSERT INTO DEALS VALUES('" + uid + "'," +
bid + "," + int.Parse(result1.ToString()) + "," +
                           buyer + ",'" + DateTime.Now.ToString() +
"')";
            SqlCommand cmd1 = new SqlCommand(sql, conn);
            result = cmd1.ExecuteNonQuery();
            conn.Close();
            return result;

           }

        public void UpdateBui(int bid,int buyer)
        {
            conn.Open();
            string sql = "UPDATE BUILDINGS SET BUYERID = "+buyer+"
WHERE BID=" + bid;
            SqlCommand cmd = new SqlCommand(sql, conn);
            cmd.ExecuteNonQuery();
            conn.Close();

           }
    }
}


Program.cs
using    System;
using    System.Collections.Generic;
using    System.Linq;
using    System.Windows.Forms;

namespace Real_Estate
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new startup());
        }
    }
}




                                       - 41 -
Startup

using   System;
using   System.Collections.Generic;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Linq;
using   System.Text;
using   System.Windows.Forms;

namespace Real_Estate
{
    public partial class startup : Form
    {
        static public string UserID = "";
        public startup()
        {
            InitializeComponent();
        }

          private void btnEnter_Click(object sender, EventArgs e)
          {
              DBAccess dba = new DBAccess();
              if (dba.CheckUser(textBox1.Text, textBox2.Text) == null)
              {
                   lblError.Text = "Wrong parameters";
                   return;
              }
              else
              {
                   UserID = textBox1.Text;
                   Form1 frm = new Form1(UserID);
                   frm.Show();
              }

          }

          private void startup_Load(object sender, EventArgs e)
          {
              lblError.Text = "";
          }


    }
}


Main
using   System;
using   System.Collections.Generic;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Linq;
using   System.Text;
using   System.Windows.Forms;

namespace Real_Estate
{


                                      - 42 -
public partial class Form1 : Form
{
    static string UserID = "";
    //public Form1()
    //{
    //    InitializeComponent();
    //}

   public Form1(string uid)
   {
       InitializeComponent();
       UserID = uid;
   }

   private void newCustomer_Click(object sender, EventArgs e)
   {
       try
       {
           newCustomer nc = new newCustomer(UserID);
           nc.MdiParent= this;
           nc.Show();
       }
       catch (Exception ex)
       {
       }
   }

   private void searchCustomer_Click(object sender, EventArgs e)
   {
       try
       {
           searchCustomer sc = new searchCustomer(UserID);
           sc.MdiParent = this;
           sc.Show();
       }
       catch (Exception ex)
       {
       }
   }

   private void newBuilding_Click(object sender, EventArgs e)
   {
       try
       {
           newBuilding nb = new newBuilding(UserID);
           nb.MdiParent = this;
           nb.Show();
       }
       catch (Exception ex)
       {
       }
   }

   private void searchBuilding_Click(object sender, EventArgs e)
   {
       try
       {
           searchBuilding sb = new searchBuilding(UserID);
           sb.MdiParent = this;
           sb.Show();
       }


                                - 43 -
              catch (Exception ex)
              {
              }
          }

          private void Form1_Load(object sender, EventArgs e)
          {
              startup stp = new startup();
              stp.Hide();
          }

        private void Form1_FormClosing(object sender,
FormClosingEventArgs e)
        {
            startup stp = new startup();
            stp.Close();
        }

        private void newUserToolStripMenuItem_Click(object sender,
EventArgs e)
        {
             NewUser nu = new NewUser();
             nu.MdiParent = this;
             nu.Show();
        }

        private void searchUserToolStripMenuItem_Click(object sender,
EventArgs e)
        {
             SearchUser su = new SearchUser();
             su.MdiParent = this;
             su.Show();
        }

New User
using   System;
using   System.Collections.Generic;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Linq;
using   System.Text;
using   System.Windows.Forms;

namespace Real_Estate
{
    public partial class NewUser : Form
    {
        public NewUser()
        {
            InitializeComponent();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            lblError.Text = "";
            DBAccess dba = new DBAccess();
            if (txtName.Text == "" || txtUserId.Text == "" ||
txtPwd.Text == "" || txtConfPwd.Text == "")
            {
                lblError.Text = "Fill all mandatory fields!";

                                      - 44 -
                 return;
            }
            else if(txtConfPwd.Text!=txtPwd.Text)
            {
                 lblError.Text = "Passwords are not matched!";
                 return;
            }
            else
            {
                 int result =
dba.NewUser(txtUserId.Text,txtPwd.Text,txtName.Text);
                 if (result > 0)
                      lblError.Text = "New user is added successfully!";
                 else
                      lblError.Text = "New user could not inserted!";

              }
          }

          private void btnCancel_Click(object sender, EventArgs e)
          {
              lblError.Text = "";
              txtPwd.Text = "";
              txtConfPwd.Text = "";
              txtUserId.Text = "";
              txtName.Text = "";
          }

          private void button2_Click(object sender, EventArgs e)
          {

          }
    }
}


New Customer
using   System;
using   System.Collections.Generic;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Linq;
using   System.Text;
using   System.Windows.Forms;

namespace Real_Estate
{
    public partial class newCustomer : Form
    {
        static string UserID = "";

          public newCustomer(string uid)
          {
              InitializeComponent();
              UserID = uid;
          }


          private void btnSave_Click(object sender, EventArgs e)
          {

                                      - 45 -
            lblError.Text = "";
            try
            {
                DBAccess dba = new DBAccess();
                dba.NewCustomer("CUSTOMERS", txtName.Text,
txtSurname.Text, txtPhone.Text,
                                txtCell.Text, txtEmail.Text,
txtAddress.Text, UserID);
                lblError.Text = "New user is added succesfully";
            }
            catch
            {
                lblError.Text = "New user is not added! Try again.";
            }
        }

         private void btnCancel_Click(object sender, EventArgs e)
         {
             txtCell.Text = "";
             txtEmail.Text = "";
             txtName.Text = "";
             txtPhone.Text = "";
             txtSurname.Text = "";
         }

         private void groupBox1_Enter(object sender, EventArgs e)
         {

         }

         private void newCustomer_Load(object sender, EventArgs e)
         {

         }
    }
}


New Building
using   System;
using   System.Collections.Generic;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Linq;
using   System.Text;
using   System.Windows.Forms;
using   System.IO;

namespace Real_Estate
{
    public partial class newBuilding : Form
    {
        static string UserID = "";

         public newBuilding(string uid)
         {
             InitializeComponent();
             UserID = uid;
         }


                                      - 46 -
       private void newBuilding_Load(object sender, EventArgs e)
       {
           DBAccess dba = new DBAccess();
           DataTable dt = new DataTable();
           dba.GetAllCustomer(dt, UserID);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    cmbSeller.Items.Add(dt.Rows[i][0].ToString() + " "
+ dt.Rows[i][1].ToString() + " " + dt.Rows[i][2].ToString());
                }
                cmbSeller.SelectedIndex = 0;
            }
            cmbCar.SelectedIndex = 0;
            cmbCategory.SelectedIndex = 0;
            cmbCondition.SelectedIndex = 0;
            cmbFloorPlan.SelectedIndex = 0;
            cmbHeating.SelectedIndex = 0;
            cmbInsite.SelectedIndex = 0;
            cmbLocation.SelectedIndex = 0;
            cmbSec.SelectedIndex = 0;
            cmbSport.SelectedIndex = 0;
            cmbSwim.SelectedIndex = 0;

       }

        private void btnSave_Click(object sender, EventArgs e)
        {
            DBAccess dba = new DBAccess();
            object result = 0;
            try
            {
                result = dba.NewBuilding(UserID,
int.Parse(cmbSeller.SelectedItem.ToString().Split(' ')[0]),
cmbCategory.SelectedItem.ToString(),
                       txtCity.Text.ToUpper(),
cmbLocation.SelectedItem.ToString(), txtStreet.Text, txtRoad.Text,
int.Parse(txtRoomNum.Text),
                       int.Parse(txtFloor.Text),
cmbFloorPlan.SelectedItem.ToString(), txtApName.Text, txtZip.Text,
                       txtAddrDetail.Text, int.Parse(txtSize.Text),
int.Parse(txtCost.Text), cmbCondition.SelectedItem.ToString(),
                       cmbHeating.SelectedItem.ToString(),
cmbSec.SelectedItem.ToString(), cmbInsite.SelectedItem.ToString(),
                       cmbSwim.SelectedItem.ToString(),
cmbCar.SelectedItem.ToString(), cmbSport.SelectedItem.ToString());

            }
            catch { }
            if (int.Parse(result.ToString()) > 0)
            {
                if (lblAddedImg.Text != "")
                {
                    string[] img = lblAddedImg.Text.Split(';');
                    for (int i = 0; i < img.Length; i++)
                    {
                        FileInfo fi = new FileInfo(img[i]);
                        if (!Directory.Exists(Application.StartupPath
+ "\\images"))


                                   - 47 -
                           {

Directory.CreateDirectory(Application.StartupPath + "\\images");
                        }
                        File.Copy(img[0], Application.StartupPath +
"\\images\\" + result.ToString() + "_" + i.ToString() + fi.Extension);
                    }

                   }
                   lblErrors.Text = "New Building is inserted
succesfully!";
            }
            else
            {
                lblErrors.Text = "New Building coud not be inserted.
Fill all mandatory fields !";
            }
            lblErrors.Visible = true;
        }

          private void btnBrowse_Click(object sender, EventArgs e)
          {
              OpenFileDialog fdlg = new OpenFileDialog();
              fdlg.Title = "C# Corner Open File Dialog";
              fdlg.InitialDirectory = @"c:\";
              fdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*";
              fdlg.FilterIndex = 2;
              fdlg.RestoreDirectory = true;
              if (fdlg.ShowDialog() == DialogResult.OK)
              {
                  txtImage.Text = fdlg.FileName;
              }

          }

          private void btnImageAdd_Click(object sender, EventArgs e)
          {
              if (lblAddedImg.Text == "")
                   lblAddedImg.Text = txtImage.Text;
              else
                   lblAddedImg.Text += ";" + txtImage.Text;
          }

          private void btnCancel_Click(object sender, EventArgs e)
          {

          }
    }
}


Images
using   System;
using   System.Collections.Generic;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Linq;
using   System.Text;
using   System.Windows.Forms;
using   System.IO;

                                      - 48 -
namespace Real_Estate
{
    public partial class Images : Form
    {
        public static string imgID;
        public static string[] filePaths;
        int imgNum = 0;

        public Images(string img)
        {
            imgID = img;
            InitializeComponent();
        }

        private void Images_Load(object sender, EventArgs e)


        {
               if (Directory.Exists(Application.StartupPath +
"\\images"))
               {
                filePaths = Directory.GetFiles(Application.StartupPath
+ "\\images", imgID+"_*", SearchOption.TopDirectoryOnly);
                if (filePaths.Length > 0)
                {
                    pictureBox1.Image = new Bitmap(filePaths[0]);
                }
            }
        }

        private void btnNext_Click(object sender, EventArgs e)
        {
            if (filePaths.Length-1 > imgNum)
            {
                imgNum += 1;
                pictureBox1.Image = new Bitmap(filePaths[imgNum]);
            }
            //else
            //{
            //     imgNum = 0;
            //     pictureBox1.Image = new Bitmap(filePaths[imgNum]);
            //}
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (imgNum!=0)
            {
                imgNum -= 1;
                pictureBox1.Image = new Bitmap(filePaths[imgNum]);
            }
        }
    }
}


Search User
using System;
using System.Collections.Generic;
using System.ComponentModel;

                                      - 49 -
using   System.Data;
using   System.Drawing;
using   System.Linq;
using   System.Text;
using   System.Windows.Forms;

namespace Real_Estate
{
    public partial class SearchUser : Form
    {
        public SearchUser()
        {
            InitializeComponent();
        }

        private void lnkPwd_LinkClicked(object sender,
LinkLabelLinkClickedEventArgs e)
        {
            panel1.Visible = true;
        }

          private void btnSave_Click(object sender, EventArgs e)
          {
              DBAccess dba = new DBAccess();

            if (panel1.Visible == true && (txtOld.Text != "") &&
(txtPwd.Text == txtConfPwd.Text))
            {
                if (dba.CheckUser(cmbUID.SelectedItem.ToString(),
txtOld.Text) != null)
                {
                    int result = dba.UpdateUser(txtName.Text,
txtPwd.Text,cmbUID.SelectedItem.ToString());
                    if (result > 0)
                    {
                        lblError.Text = "User is updated
successfully!";

                            }
                            else
                            {
                                   lblError.Text = "User could not be updated!";

                            }
                     }
                     else
                     {
                            lblError.Text = "Wrong Old Password!";

                     }
              }
              else
              {
                int result = dba.UpdateUserName(txtName.Text,
cmbUID.SelectedItem.ToString());
                if (result > 0)
                {
                    lblError.Text = "User is updated successfully!";

                     }
                     else


                                              - 50 -
                {
                    lblError.Text = "User could not be updated!";

                }
            }
            panel1.Visible = false;
            txtOld.Text = "";
            txtPwd.Text = "";
            txtConfPwd.Text = "";
            cmbUID.Items.Clear();
            FillUsers();
        }

        private void SearchUser_Load(object sender, EventArgs e)
        {
            cmbUID.Items.Clear();
            FillUsers();
        }

        private void FillUsers()
        {
            DBAccess dba = new DBAccess();
            DataTable dt = new DataTable();
            dba.GetAllUser(dt);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    cmbUID.Items.Add(dt.Rows[i]["UID"].ToString());
                }
                cmbUID.SelectedIndex = 0;
                txtName.Text = dt.Rows[0]["TITLE"].ToString();
            }
        }

        private void cmbUID_SelectedIndexChanged(object sender,
EventArgs e)
        {
             DBAccess dba = new DBAccess();
             DataTable dt = new DataTable();
             dba.GetUserByID(dt,cmbUID.SelectedItem.ToString());
             txtName.Text = dt.Rows[0]["TITLE"].ToString();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            cmbUID.Items.Clear();
            FillUsers();
            panel1.Visible = false;

        }

        private void button1_Click(object sender, EventArgs e)
        {

        }
    }
}




                                      - 51 -
Search Customer
using   System;
using   System.Collections.Generic;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Linq;
using   System.Text;
using   System.Windows.Forms;

namespace Real_Estate
{
    public partial class searchCustomer : Form
    {
        static DataTable dt = new DataTable();
        public bool isSearch = false;

         static string UserID = "";

         public searchCustomer(string uid)
         {
             InitializeComponent();
             UserID = uid;
         }


         private void searchCustomer_Load(object sender, EventArgs e)
         {
             DBAccess dba = new DBAccess();
             dba.GetAllCustomer(dt,UserID);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    cmbID.Items.Add(dt.Rows[i][0].ToString());
                    cmbName.Items.Add(dt.Rows[i][1]+"
"+dt.Rows[i][2]);
                }
                isSearch = true;
                cmbID.SelectedIndex = 0;
                cmbName.SelectedIndex = 0;
                txtPhone.Text = dt.Rows[0][3].ToString();
                txtCell.Text = dt.Rows[0][4].ToString();
                txtEmail.Text = dt.Rows[0][5].ToString();
                txtAddress.Text = dt.Rows[0][6].ToString();
                isSearch = false;
                DataTable dt2 = new DataTable();
                dba.GetAllCustomBui(dt2,
int.Parse(cmbID.SelectedItem.ToString()), UserID);
                dgwResult.DataSource = dt2;
                dgwResult.Visible = true;
                dgwResult.Refresh();
            }
          }

        private void cmbID_SelectedIndexChanged(object sender,
EventArgs e)
        {
             if (!isSearch)
             {

                                      - 52 -
                isSearch = true;
                DBAccess dba = new DBAccess();
                DataTable dt1 = new DataTable();
                dba.SearchCustomerByID(dt1,
int.Parse(cmbID.SelectedItem.ToString()));
                cmbName.Text = dt1.Rows[0][1].ToString() + " " +
dt1.Rows[0][2].ToString();
                txtPhone.Text = dt1.Rows[0][3].ToString();
                txtCell.Text = dt1.Rows[0][4].ToString();
                txtEmail.Text = dt1.Rows[0][5].ToString();
                txtAddress.Text = dt1.Rows[0][6].ToString();
                isSearch = false;
                DataTable dt2 = new DataTable();

dba.GetAllCustomBui(dt2,int.Parse(cmbID.SelectedItem.ToString()),UserI
D);
                dgwResult.DataSource = dt2;
                dgwResult.Refresh();

           }

       }

        private void cmbName_SelectedIndexChanged(object sender,
EventArgs e)
        {
             if (!isSearch)
             {
                 isSearch = true;
                 DBAccess dba = new DBAccess();
                 DataTable dt1 = new DataTable();
                 dba.SearchCustomerByName(dt1,
cmbName.SelectedItem.ToString());
                 cmbID.Text = dt1.Rows[0][0].ToString();
                 txtPhone.Text = dt1.Rows[0][3].ToString();
                 txtCell.Text = dt1.Rows[0][4].ToString();
                 txtEmail.Text = dt1.Rows[0][5].ToString();
                 txtAddress.Text = dt1.Rows[0][6].ToString();
                 isSearch = false;
                 DataTable dt2 = new DataTable();
                 dba.GetAllCustomBui(dt2,
int.Parse(cmbID.SelectedItem.ToString()), UserID);
                 dgwResult.DataSource = dt2;
                 dgwResult.Refresh();
             }

       }

       private void btnUpdate_Click(object sender, EventArgs e)
       {
           DBAccess dba = new DBAccess();

dba.UpdateCustomer(int.Parse(cmbID.SelectedItem.ToString()),
cmbName.Text.ToString().Split(' ')[0],
                                     cmbName.Text.ToString().Split('
')[1],
                                     txtPhone.Text,txtCell.Text,
txtEmail.Text, txtAddress.Text);
        }




                                   - 53 -
    }
}


Search Building
using   System;
using   System.Collections.Generic;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Linq;
using   System.Text;
using   System.Windows.Forms;

namespace Real_Estate
{
    public partial class searchBuilding : Form
    {
        static string UserID = "";
        static int rowInd = 0;
        public searchBuilding(string uid)
        {
            InitializeComponent();
            UserID = uid;
        }


          private void btnSearch_Click(object sender, EventArgs e)
          {
              lblErrors.Visible = false;

              #region CATEGORY
              string Category = "";
              if (rbBuyBui.Checked)
              {
                   Category="CATEGORY='BUY BUILDING'";
              }
              else if (rbRentBui.Checked)
              {
                   Category = "CATEGORY='RENT BUILDING'";
              }
              else if (rbRentOff.Checked)
              {
                   Category = "CATEGORY='RENT OFFICE'";
              }
              else if (rbBuyOff.Checked)
              {
                   Category = "CATEGORY='BUY OFFICE'";
              }
              else
              {
                   lblErrors.Text = "Choose Category type.";
                   lblErrors.Visible = true;
                   return;
              }

              #endregion

              #region LOCATION
              string Location = "";
              if (chkEtiler.Checked)

                                       - 54 -
{
    Location = "LOCATION='ETILER'";
}
if (chkLevent.Checked)
{
    if (Location == "")
         Location = "LOCATION='LEVENT'";
    else
         Location += " OR LOCATION='LEVENT'";
}
if (chkUlus.Checked)
{
    if (Location == "")
         Location = "LOCATION='ULUS'";
    else
         Location += " OR LOCATION='ULUS'";
}
if (chkBebek.Checked)
{
    if (Location == "")
         Location = "LOCATION='BEBEK'";
    else
         Location += " OR LOCATION='BEBEK'";
}


#endregion

#region CONDITION
string Condition = "";
if (chk1Hand.Checked)
{
    Condition = "CONDITION='1st HAND'";
}
if (chk2Hand.Checked)
{
    if (Condition == "")
         Condition = "CONDITION='2nd HAND'";
    else
         Condition += " OR CONDITION='2nd HAND'";
}
if (chkConstuct.Checked)
{
    if (Condition == "")
         Condition = "CONDITION='ON CONSTRUCT'";
    else
         Condition += " OR CONDITION='ON CONSTRUCT'";
}

#endregion

#region FLOORPLANE
string Floorplane = "";

if (chkBase.Checked)
    Floorplane = "FLOORPLAN='BASEMAND'";

if(chkGround.Checked)
{
    if(Floorplane=="")
        Floorplane="FLOORPLAN='GROUNDFLOOR'";


                          - 55 -
       else
              Floorplane+=" OR FLOORPLAN='GROUNDFLOOR'";
}

if(chkInter.Checked)
{
    if(Floorplane=="")
         Floorplane="FLOORPLAN='INTERSTAGE'";
    else
         Floorplane += " OR FLOORPLAN='INTERSTAGE'";
}

    if(chkGarret.Checked)
{
       if(Floorplane=="")
            Floorplane = "FLOORPLAN='GARRET'";
       else
            Floorplane += " OR FLOORPLAN='GARRET'";
}

#endregion

#region HEATING
string Heating = "";

if (chkCentral.Checked)
      Heating = "HETAING='CENTRAL HEATING'";
if(chkCombi.Checked)
{
     if (Heating=="")
          Heating = "HETAING='COMBI'";
     else
          Heating += " OR HETAING='COMBI'";
}
  if(chkNeutral.Checked)
{
     if (Heating=="")
          Heating = "HETAING='NEUTRAL GAZ'";
     else
          Heating += " OR HETAING='NEUTRAL GAZ'";
}
  if(chkRadiator.Checked)
{
     if (Heating=="")
          Heating = "HETAING='RADIATOR'";
     else
          Heating += " OR HETAING='RADIATOR'";
}

#endregion

#region ADDITIONAL

string    Security = "";
string    Swim = "";
string    Carpark = "";
string    Insite = "";
string    Sporcenter = "";

if(chkSecurity.Checked)
    Security="SECURITY='YES'";


                             - 56 -
            //else
            //     Security="SECURITY='NO'";

            if(chkInsite.Checked)
                Insite="INSITE='YES'";
            //else
            //     Insite="INSITE='NO'";

            if(chkCar.Checked)
                Carpark="CARPARK='YES'";
            //else
            //     Carpark="CARPARK='NO'";

            if(chkSpor.Checked)
                Sporcenter="SPORTCENTER='YES'";
            //else
            //     Sporcenter="SPORTCENTER='NO'";

            if(chkSwim.Checked)
                Swim="SWIMPOOL='YES'";
            //else
            //     Swim="SWIMPOOL='NO'";

            #endregion

            #region OTHER
            string roomNum = "";
            string cost = "";
            string size = "";


            if(txtCost1.Text!= ""&&txtCost1.Text== "")
                cost="COST="+int.Parse(txtCost1.Text);
            else if(txtCost1.Text!= ""&&txtCost1.Text!= "")
                cost = "COST>=" + int.Parse(txtCost1.Text) + " AND
COST<=" + int.Parse(txtCost2.Text);

            if (txtRoomNum1.Text != "" && txtRoomNum2.Text == "")
                roomNum = "ROOMNUM=" + int.Parse(txtRoomNum1.Text);
            else if (txtRoomNum1.Text != "" && txtRoomNum2.Text != "")
                roomNum = "ROOMNUM>=" + int.Parse(txtRoomNum1.Text) +
" AND ROOMNUM<= " + int.Parse(txtRoomNum2.Text);

            if (txtSize1.Text != "" && txtSize2.Text == "")
                size = "SIZE=" + int.Parse(txtSize1.Text);
            else if (txtSize1.Text != "" && txtSize2.Text != "")
                size = "SIZE>=" + int.Parse(txtSize1.Text) + " AND
SIZE<=" + int.Parse(txtSize2.Text);
            #endregion

            DataTable dt = new DataTable();
            DBAccess dba = new DBAccess();

dba.GetBuildings(dt,Category,Location,Condition,Floorplane,Heating,Sec
urity,

Swim,Carpark,Sporcenter,Insite,roomNum,cost,size,UserID);

            if (dt.Rows.Count > 0)
            {
                dgwResult.DataSource = dt;


                                    - 57 -
                     dgwResult.Visible = true;
                     lblErrors.Visible = false;
              }
              else
              {
                     lblErrors.Text = "No result was found. Change search
criteria.";
                     lblErrors.Visible = true;
                     dgwResult.Visible = false;
              }

        }

        private void dgwResult_CellContentClick(object sender,
DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 1)
            {
                Images img = new
Images(dgwResult.Rows[e.RowIndex].Cells["BID"].Value.ToString());
                img.Show();
            }
        }

        private void dgwResult_CellEndEdit(object sender,
DataGridViewCellEventArgs e)
        {
            int choose = 0;
            rowInd = e.RowIndex;
            try
            {
                for (int i = 0; i < dgwResult.RowCount; i++)
                {
                    if ((bool)dgwResult.Rows[i].Cells[0].Value)
                        choose++;
                }
            }
            catch { }
            if (choose == 5)
            {
                dgwResult.Rows[e.RowIndex].Cells[0].Value = false;
                return;
            }
        }

        private void btnHP_Click(object sender, EventArgs e)
        {
            dgwResult.Rows[rowInd].Cells[0].Value = true;
            int choose = 0;
            List<int> myList = new List<int>();
            try
            {
                for (int i = 0; i < dgwResult.RowCount; i++)
                {
                    if ((bool)dgwResult.Rows[i].Cells[0].Value)
                    {
                        choose++;

myList.Add(int.Parse(dgwResult.Rows[i].Cells["BID"].Value.ToString()))
;
                    }


                                        - 58 -
                   }
              }
              catch { }
              if (choose < 3)
              {
                   lblErrors.Text = "Select at least three buildings.";
                   lblErrors.Visible = true;
                   return;
              }
              else
              {
                   lblErrors.Visible = false;
                   HP calc = new HP(myList,UserID);
                   calc.Show();

              }
          }

          private void searchBuilding_Load(object sender, EventArgs e)
          {

          }
    }
}


AHP
using   System;
using   System.Collections.Generic;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Linq;
using   System.Text;
using   System.Windows.Forms;

namespace Real_Estate
{

    public partial class HP : Form
    {

          static public List<int> BIDs;
          public static string UserID;
          public static DataTable dt = new DataTable();


          double   m_sum1, m_sum2, m_sum3, m_sum4; // main
          double   m_building1, m_building2, m_building3, m_building4;
          double   m_heating1, m_heating2, m_heating3, m_heating4;
          double   m_price1, m_price2, m_price3, m_price4;
          double   m_outdoor1, m_outdoor2, m_outdoor3, m_outdoor4;
          double   m_avarage1, m_avarage2, m_avarage3, m_avarage4;
          double   m_wsum1, m_wsum2, m_wsum3, m_wsum4;
          double   m_div1, m_div2, m_div3, m_div4;
          double   m_tsum, m_lamda, m_CI, m_CR; // main


          double b_sum1, b_sum2; // building structure
          double b_floor1, b_floor2;
          double b_condition1, b_condition2;

                                       - 59 -
        double   b_avarage1, b_avarage2;
        double   b_wsum1, b_wsum2;
        double   b_div1, b_div2;
        double   b_tsum, b_lamda, b_CI, b_CR; // building structure

        double   h_sum1, h_sum2, h_sum3, h_sum4; // heating type
        double   h_radiator1, h_radiator2, h_radiator3, h_radiator4;
        double   h_natural1, h_natural2, h_natural3, h_natural4;
        double   h_combi1, h_combi2, h_combi3, h_combi4;
        double   h_central1, h_central2, h_central3, h_central4;
        double   h_avarage1, h_avarage2, h_avarage3, h_avarage4;
        double   h_wsum1, h_wsum2, h_wsum3, h_wsum4;
        double   h_div1, h_div2, h_div3, h_div4;
        double   h_tsum, h_lamda, h_CI, h_CR; // heating type


        double o_sum1, o_sum2, o_sum3, o_sum4, o_sum5; // outdoor
attributes
        double o_security1, o_security2, o_security3, o_security4,
o_security5;
        double o_insite1, o_insite2, o_insite3, o_insite4, o_insite5;
        double o_sportcenter1, o_sportcenter2, o_sportcenter3,
o_sportcenter4, o_sportcenter5;
        double o_carparking1, o_carparking2, o_carparking3,
o_carparking4, o_carparking5;
        double o_swimmingpool1, o_swimmingpool2, o_swimmingpool3,
o_swimmingpool4, o_swimmingpool5;
        double o_avarage1, o_avarage2, o_avarage3, o_avarage4,
o_avarage5;
        double o_wsum1, o_wsum2, o_wsum3, o_wsum4, o_wsum5;
        double o_div1, o_div2, o_div3, o_div4, o_div5;
        double o_tsum, o_lamda, o_CI, o_CR; // outdoor attributes

        double   p_sum1, p_sum2, p_sum3, p_sum4, p_sum5; // price
        double   p_ALT11, p_ALT12, p_ALT13, p_ALT14, p_ALT15;
        double   p_ALT21, p_ALT22, p_ALT23, p_ALT24, p_ALT25;
        double   p_ALT31, p_ALT32, p_ALT33, p_ALT34, p_ALT35;
        double   p_ALT41, p_ALT42, p_ALT43, p_ALT44, p_ALT45;
        double   p_ALT51, p_ALT52, p_ALT53, p_ALT54, p_ALT55;
        double   p_avarage1, p_avarage2, p_avarage3, p_avarage4,
p_avarage5;
        double   p_wsum1, p_wsum2, p_wsum3, p_wsum4, p_wsum5;
        double   p_div1, p_div2, p_div3, p_div4, p_div5;
        double   p_tsum, p_lamda, p_CI, p_CR; // price

        double   f_sum1, f_sum2, f_sum3, f_sum4, f_sum5; // floor plan
        double   f_ALT11, f_ALT12, f_ALT13, f_ALT14, f_ALT15;
        double   f_ALT21, f_ALT22, f_ALT23, f_ALT24, f_ALT25;
        double   f_ALT31, f_ALT32, f_ALT33, f_ALT34, f_ALT35;
        double   f_ALT41, f_ALT42, f_ALT43, f_ALT44, f_ALT45;
        double   f_ALT51, f_ALT52, f_ALT53, f_ALT54, f_ALT55;
        double   f_avarage1, f_avarage2, f_avarage3, f_avarage4,
f_avarage5;
        double   f_wsum1, f_wsum2, f_wsum3, f_wsum4, f_wsum5;
        double   f_div1, f_div2, f_div3, f_div4, f_div5;
        double   f_tsum, f_lamda, f_CI, f_CR; // floor plan

        double    c_sum1,    c_sum2,     c_sum3,   c_sum4,   c_sum5; //
condition
        double    c_ALT11,    c_ALT12,     c_ALT13,   c_ALT14,   c_ALT15;
        double    c_ALT21,    c_ALT22,     c_ALT23,   c_ALT24,   c_ALT25;


                                          - 60 -
        double c_ALT31, c_ALT32, c_ALT33, c_ALT34, c_ALT35;
        double c_ALT41, c_ALT42, c_ALT43, c_ALT44, c_ALT45;
        double c_ALT51, c_ALT52, c_ALT53, c_ALT54, c_ALT55;
        double c_avarage1, c_avarage2, c_avarage3, c_avarage4,
c_avarage5;
        double c_wsum1, c_wsum2, c_wsum3, c_wsum4, c_wsum5;
        double c_div1, c_div2, c_div3, c_div4, c_div5;
        double c_tsum, c_lamda, c_CI, c_CR; // condition

        double    r_sum1, r_sum2, r_sum3, r_sum4, r_sum5; // radiator
        double    r_ALT11, r_ALT12, r_ALT13, r_ALT14, r_ALT15;
        double    r_ALT21, r_ALT22, r_ALT23, r_ALT24, r_ALT25;
        double    r_ALT31, r_ALT32, r_ALT33, r_ALT34, r_ALT35;
        double    r_ALT41, r_ALT42, r_ALT43, r_ALT44, r_ALT45;
        double    r_ALT51, r_ALT52, r_ALT53, r_ALT54, r_ALT55;
        double    r_avarage1, r_avarage2, r_avarage3, r_avarage4,
r_avarage5;
        double    r_wsum1, r_wsum2, r_wsum3, r_wsum4, r_wsum5;
        double    r_div1, r_div2, r_div3, r_div4, r_div5;
        double    r_tsum, r_lamda, r_CI, r_CR; // radiator

        double    n_sum1, n_sum2, n_sum3, n_sum4, n_sum5; // natural gas
        double    n_ALT11, n_ALT12, n_ALT13, n_ALT14, n_ALT15;
        double    n_ALT21, n_ALT22, n_ALT23, n_ALT24, n_ALT25;
        double    n_ALT31, n_ALT32, n_ALT33, n_ALT34, n_ALT35;
        double    n_ALT41, n_ALT42, n_ALT43, n_ALT44, n_ALT45;
        double    n_ALT51, n_ALT52, n_ALT53, n_ALT54, n_ALT55;
        double    n_avarage1, n_avarage2, n_avarage3, n_avarage4,
n_avarage5;
        double    n_wsum1, n_wsum2, n_wsum3, n_wsum4, n_wsum5;
        double    n_div1, n_div2, n_div3, n_div4, n_div5;
        double    n_tsum, n_lamda, n_CI, n_CR; // natural gas

        double    co_sum1, co_sum2, co_sum3, co_sum4, co_sum5; // combi
        double    co_ALT11, co_ALT12, co_ALT13, co_ALT14, co_ALT15;
        double    co_ALT21, co_ALT22, co_ALT23, co_ALT24, co_ALT25;
        double    co_ALT31, co_ALT32, co_ALT33, co_ALT34, co_ALT35;
        double    co_ALT41, co_ALT42, co_ALT43, co_ALT44, co_ALT45;
        double    co_ALT51, co_ALT52, co_ALT53, co_ALT54, co_ALT55;
        double    co_avarage1, co_avarage2, co_avarage3, co_avarage4,
co_avarage5;
        double    co_wsum1, co_wsum2, co_wsum3, co_wsum4, co_wsum5;
        double    co_div1, co_div2, co_div3, co_div4, co_div5;
        double    co_tsum, co_lamda, co_CI, co_CR; // combi

           double ch_sum1, ch_sum2, ch_sum3, ch_sum4, ch_sum5; // central
heating
        double    ch_ALT11, ch_ALT12, ch_ALT13, ch_ALT14, ch_ALT15;
        double    ch_ALT21, ch_ALT22, ch_ALT23, ch_ALT24, ch_ALT25;
        double    ch_ALT31, ch_ALT32, ch_ALT33, ch_ALT34, ch_ALT35;
        double    ch_ALT41, ch_ALT42, ch_ALT43, ch_ALT44, ch_ALT45;
        double    ch_ALT51, ch_ALT52, ch_ALT53, ch_ALT54, ch_ALT55;
        double    ch_avarage1, ch_avarage2, ch_avarage3, ch_avarage4,
ch_avarage5;
        double    ch_wsum1, ch_wsum2, ch_wsum3, ch_wsum4, ch_wsum5;
        double    ch_div1, ch_div2, ch_div3, ch_div4, ch_div5;
        double    ch_tsum, ch_lamda, ch_CI, ch_CR; // central heating

           double se_sum1, se_sum2, se_sum3, se_sum4, se_sum5; //
security
           double se_ALT11, se_ALT12, se_ALT13, se_ALT14, se_ALT15;


                                      - 61 -
        double   se_ALT21, se_ALT22, se_ALT23, se_ALT24, se_ALT25;
        double   se_ALT31, se_ALT32, se_ALT33, se_ALT34, se_ALT35;
        double   se_ALT41, se_ALT42, se_ALT43, se_ALT44, se_ALT45;
        double   se_ALT51, se_ALT52, se_ALT53, se_ALT54, se_ALT55;
        double   se_avarage1, se_avarage2, se_avarage3, se_avarage4,
se_avarage5;
        double   se_wsum1, se_wsum2, se_wsum3, se_wsum4, se_wsum5;
        double   se_div1, se_div2, se_div3, se_div4, se_div5;
        double   se_tsum, se_lamda, se_CI, se_CR; // security

        double   i_sum1, i_sum2, i_sum3, i_sum4, i_sum5; // insite
        double   i_ALT11, i_ALT12, i_ALT13, i_ALT14, i_ALT15;
        double   i_ALT21, i_ALT22, i_ALT23, i_ALT24, i_ALT25;
        double   i_ALT31, i_ALT32, i_ALT33, i_ALT34, i_ALT35;
        double   i_ALT41, i_ALT42, i_ALT43, i_ALT44, i_ALT45;
        double   i_ALT51, i_ALT52, i_ALT53, i_ALT54, i_ALT55;
        double   i_avarage1, i_avarage2, i_avarage3, i_avarage4,
i_avarage5;
        double   i_wsum1, i_wsum2, i_wsum3, i_wsum4, i_wsum5;
        double   i_div1, i_div2, i_div3, i_div4, i_div5;
        double   i_tsum, i_lamda, i_CI, i_CR; // insite

        double   sc_sum1, sc_sum2, sc_sum3, sc_sum4, sc_sum5; //
sportcenter
        double   sc_ALT11, sc_ALT12, sc_ALT13, sc_ALT14, sc_ALT15;
        double   sc_ALT21, sc_ALT22, sc_ALT23, sc_ALT24, sc_ALT25;
        double   sc_ALT31, sc_ALT32, sc_ALT33, sc_ALT34, sc_ALT35;
        double   sc_ALT41, sc_ALT42, sc_ALT43, sc_ALT44, sc_ALT45;
        double   sc_ALT51, sc_ALT52, sc_ALT53, sc_ALT54, sc_ALT55;
        double   sc_avarage1, sc_avarage2, sc_avarage3, sc_avarage4,
sc_avarage5;
        double   sc_wsum1, sc_wsum2, sc_wsum3, sc_wsum4, sc_wsum5;
        double   sc_div1, sc_div2, sc_div3, sc_div4, sc_div5;
        double   sc_tsum, sc_lamda, sc_CI, sc_CR; // sportcenter

        double   cp_sum1, cp_sum2, cp_sum3, cp_sum4, cp_sum5; //
carparking
        double   cp_ALT11, cp_ALT12, cp_ALT13, cp_ALT14, cp_ALT15;
        double   cp_ALT21, cp_ALT22, cp_ALT23, cp_ALT24, cp_ALT25;
        double   cp_ALT31, cp_ALT32, cp_ALT33, cp_ALT34, cp_ALT35;
        double   cp_ALT41, cp_ALT42, cp_ALT43, cp_ALT44, cp_ALT45;
        double   cp_ALT51, cp_ALT52, cp_ALT53, cp_ALT54, cp_ALT55;
        double   cp_avarage1, cp_avarage2, cp_avarage3, cp_avarage4,
cp_avarage5;
        double   cp_wsum1, cp_wsum2, cp_wsum3, cp_wsum4, cp_wsum5;
        double   cp_div1, cp_div2, cp_div3, cp_div4, cp_div5;
        double   cp_tsum, cp_lamda, cp_CI, cp_CR; // carparking

        double   sw_sum1, sw_sum2, sw_sum3, sw_sum4, sw_sum5; //
swimmingpool
        double   sw_ALT11, sw_ALT12, sw_ALT13, sw_ALT14, sw_ALT15;
        double   sw_ALT21, sw_ALT22, sw_ALT23, sw_ALT24, sw_ALT25;
        double   sw_ALT31, sw_ALT32, sw_ALT33, sw_ALT34, sw_ALT35;
        double   sw_ALT41, sw_ALT42, sw_ALT43, sw_ALT44, sw_ALT45;
        double   sw_ALT51, sw_ALT52, sw_ALT53, sw_ALT54, sw_ALT55;
        double   sw_avarage1, sw_avarage2, sw_avarage3, sw_avarage4,
sw_avarage5;
        double   sw_wsum1, sw_wsum2, sw_wsum3, sw_wsum4, sw_wsum5;
        double   sw_div1, sw_div2, sw_div3, sw_div4, sw_div5;
        double   sw_tsum, sw_lamda, sw_CI, sw_CR; // swimmingpool



                                     - 62 -
            double   l298   ;
            double   l299   ;
            double   l300   ;
            double   l301   ;
            double   l302   ;

            string   l307   ;
            string   l306   ;
            string   l305   ;
            string   l304   ;
            string   l303   ;

        public HP(List<int>MyList,string uid)
        {
            BIDs = MyList;
            InitializeComponent();

            UserID = uid;
            DBAccess dba = new DBAccess();
            dt.Clear();
            dba.GetBuilByID(dt,MyList.ToArray());


        }

        private void HP_Load(object sender, EventArgs e)
        {
            //treeComparison.SelectedNode = nodeMain;
            treeComparison.ExpandAll();
            //treeComparison.Nodes[1].ForeColor = Color.Black;
            //treeComparison.Nodes[2].ForeColor = Color.Black;
            //treeComparison.Nodes[3].ForeColor = Color.Black;
            //treeComparison.Nodes[4].ForeColor = Color.Black;
            //treeComparison.Nodes[5].ForeColor = Color.Black;
            //treeComparison.Nodes[6].ForeColor = Color.Black;
            dgwResult.DataSource = dt;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                 dgwResult.Rows[i].Cells[1].Value = "Alternative " + (i
+ 1).ToString();
            }
            dgwResult.Columns[2].Visible = false;
            dgwResult.Columns[3].Visible = false;
            dgwResult.Columns[4].Visible = false;
            dgwResult.Columns[5].Visible = false;


            int count = BIDs.Count;
            if ( count==3)
            {
                textBox119.Enabled =   false; // price
                textBox118.Enabled =   false;
                textBox115.Enabled =   false;
                textBox113.Enabled =   false;
                textBox107.Enabled =   false;
                textBox106.Enabled =   false;
                textBox105.Enabled =   false;
                textBox104.Enabled =   false;
                textBox103.Enabled =   false;
                comboBox45.Enabled =   false;
                textBox109.Enabled =   false;


                                    - 63 -
                textBox108.Enabled   =   false;
                comboBox51.Enabled   =   false;
                comboBox50.Enabled   =   false;
                comboBox49.Enabled   =   false;
                comboBox48.Enabled   =   false;
                comboBox47.Enabled   =   false;
                comboBox46.Enabled   =   false;// price
           }
           else if (count==4)
           {
                textBox107.Enabled   =   false; // price
                textBox106.Enabled   =   false;
                textBox105.Enabled   =   false;
                textBox104.Enabled   =   false;
                textBox103.Enabled   =   false;
                textBox108.Enabled   =   false;
                comboBox48.Enabled   =   false;
                comboBox47.Enabled   =   false;
                comboBox46.Enabled   =   false;// price
           }
           else
           {
           }
       }

        private void button1_Click(object sender, EventArgs e) //
evaluation 1 - calculate
        {



       }

        private void button2_Click(object sender, EventArgs e) //
evaluation 1 - clear
        {


  }

        private void button3_Click(object sender, EventArgs e) //
evaluation 1 - next
        {

       }

        private void button5_Click(object sender, EventArgs e) //
evaluation 2 - next
        {



       }

        private void button6_Click(object sender, EventArgs e) //
evaluation 2 - calculation
        {



       }


                                     - 64 -
        private void button7_Click(object sender, EventArgs e) //
evaluation 2 - clear
        {

       }

        private void button4_Click(object sender, EventArgs e) //
evaluation 2 - previous
        {

       }

        private void button10_Click(object sender, EventArgs e)     //
evaluation 3 - calculate
        {

       }

        private void button9_Click(object sender, EventArgs e) //
evaluation 3 - clear
        {

       }

        private void button8_Click(object sender, EventArgs e) //
evaluation 3 - next
        {

       }

        private void button11_Click(object sender, EventArgs e) //
evaluation 3 -previous
        {

       }

        private void button15_Click(object sender, EventArgs e) //
evaluation 4- calculate
        {

       }

        private void button13_Click(object sender, EventArgs e) //
evaluation 4 - next
        {

       }

       private void label40_Click(object sender, EventArgs e)
       {

       }

       private void groupBox10_Enter(object sender, EventArgs e)
       {

       }

        private void button16_Click(object sender, EventArgs e) //
evaluation 5 - previous


                                   - 65 -
       {

       }

        private void button19_Click(object sender, EventArgs e) //
evaluate 5 - calculate
        {

       }

        private void button18_Click(object sender, EventArgs e) //
evaluate 5 - clear
        {

       }

        private void button17_Click(object sender, EventArgs e) //
evaluate 5 - next
        {

       }

        private void button14_Click(object sender, EventArgs e) //
evaluation 4 - clear
        {

       }

        private void button12_Click(object sender, EventArgs e) //
evaluation 4 - previous
        {

       }

        private void button31_Click(object sender, EventArgs e) //
price calculate
        {
            int count = BIDs.Count;
            if (count == 5)
            {
                textBox120.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox53.SelectedItem))));
                textBox117.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox52.SelectedItem))));
                textBox118.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox50.SelectedItem))));
                textBox119.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox51.SelectedItem))));
                textBox115.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox49.SelectedItem))));
                textBox121.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox54.SelectedItem))));
                textBox107.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox48.SelectedItem))));
                textBox106.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox47.SelectedItem))));
                textBox105.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox46.SelectedItem))));
                textBox104.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox45.SelectedItem))));



                                   - 66 -
                p_sum1 = Convert.ToDouble(textBox122.Text) +
Convert.ToDouble(textBox121.Text) + Convert.ToDouble(textBox120.Text)
+ Convert.ToDouble(textBox119.Text) +
Convert.ToDouble(textBox107.Text);
                p_sum2 = Convert.ToDouble(textBox106.Text) +
Convert.ToDouble(textBox118.Text) + Convert.ToDouble(textBox117.Text)
+ Convert.ToDouble(comboBox54.SelectedItem) +
Convert.ToDouble(textBox116.Text);
                p_sum3 = Convert.ToDouble(textBox105.Text) +
Convert.ToDouble(textBox115.Text) +
Convert.ToDouble(comboBox52.SelectedItem) +
Convert.ToDouble(comboBox53.SelectedItem) +
Convert.ToDouble(textBox114.Text);
                p_sum4 = Convert.ToDouble(textBox104.Text) +
Convert.ToDouble(comboBox50.SelectedItem) +
Convert.ToDouble(comboBox49.SelectedItem) +
Convert.ToDouble(comboBox51.SelectedItem) +
Convert.ToDouble(textBox113.Text);
                p_sum5 = Convert.ToDouble(textBox103.Text) +
Convert.ToDouble(comboBox48.SelectedItem) +
Convert.ToDouble(comboBox47.SelectedItem) +
Convert.ToDouble(comboBox46.SelectedItem) +
Convert.ToDouble(comboBox45.SelectedItem);


                p_ALT11   =   Convert.ToDouble(textBox122.Text)   /   p_sum1;
                p_ALT12   =   Convert.ToDouble(textBox121.Text)   /   p_sum1;
                p_ALT13   =   Convert.ToDouble(textBox120.Text)   /   p_sum1;
                p_ALT14   =   Convert.ToDouble(textBox119.Text)   /   p_sum1;
                p_ALT15   =   Convert.ToDouble(textBox107.Text)   /   p_sum1;

                p_ALT21 = Convert.ToDouble(comboBox54.SelectedItem) /
p_sum2;
                p_ALT22   =   Convert.ToDouble(textBox116.Text)   /   p_sum2;
                p_ALT23   =   Convert.ToDouble(textBox117.Text)   /   p_sum2;
                p_ALT24   =   Convert.ToDouble(textBox118.Text)   /   p_sum2;
                p_ALT25   =   Convert.ToDouble(textBox106.Text)   /   p_sum2;

                p_ALT31 = Convert.ToDouble(comboBox53.SelectedItem) /
p_sum3;
                p_ALT32 = Convert.ToDouble(comboBox52.SelectedItem) /
p_sum3;
                p_ALT33 = Convert.ToDouble(textBox114.Text) / p_sum3;
                p_ALT34 = Convert.ToDouble(textBox115.Text) / p_sum3;
                p_ALT35 = Convert.ToDouble(textBox105.Text) / p_sum3;

                p_ALT41 = Convert.ToDouble(comboBox51.SelectedItem) /
p_sum4;
                p_ALT42 = Convert.ToDouble(comboBox50.SelectedItem) /
p_sum4;
                p_ALT43 = Convert.ToDouble(comboBox49.SelectedItem) /
p_sum4;
                p_ALT44 = Convert.ToDouble(textBox113.Text) / p_sum4;
                p_ALT45 = Convert.ToDouble(textBox104.Text) / p_sum4;

                p_ALT51 = Convert.ToDouble(comboBox48.SelectedItem) /
p_sum5;
                p_ALT52 = Convert.ToDouble(comboBox47.SelectedItem) /
p_sum5;
                p_ALT53 = Convert.ToDouble(comboBox46.SelectedItem) /
p_sum5;


                                       - 67 -
                p_ALT54 = Convert.ToDouble(comboBox45.SelectedItem) /
p_sum5;
                p_ALT55 = Convert.ToDouble(textBox103.Text) / p_sum5;

                p_avarage1 = (p_ALT11 + p_ALT21 + p_ALT31 + p_ALT41 +
p_ALT51) / 5;
                p_avarage2 = (p_ALT12 + p_ALT22 + p_ALT32 + p_ALT42 +
p_ALT52) / 5;
                p_avarage3 = (p_ALT13 + p_ALT23 + p_ALT33 + p_ALT43 +
p_ALT53) / 5;
                p_avarage4 = (p_ALT14 + p_ALT24 + p_ALT34 + p_ALT44 +
p_ALT54) / 5;
                p_avarage5 = (p_ALT15 + p_ALT25 + p_ALT35 + p_ALT45 +
p_ALT55) / 5;

                p_tsum = p_avarage1 + p_avarage2 + p_avarage3 +
p_avarage4 + p_avarage5;

                p_wsum1 = (Convert.ToDouble(textBox122.Text) *
p_avarage1) + (Convert.ToDouble(comboBox54.SelectedItem) * p_avarage2)
+ (Convert.ToDouble(comboBox53.SelectedItem) * p_avarage3) +
(Convert.ToDouble(comboBox51.SelectedItem) * p_avarage4) +
(Convert.ToDouble(comboBox48.SelectedItem) * p_avarage5);
                p_wsum2 = (Convert.ToDouble(textBox121.Text) *
p_avarage1) + (Convert.ToDouble(textBox116.Text) * p_avarage2) +
(Convert.ToDouble(comboBox52.SelectedItem) * p_avarage3) +
(Convert.ToDouble(comboBox50.SelectedItem) * p_avarage4) +
(Convert.ToDouble(comboBox47.SelectedItem) * p_avarage5);
                p_wsum3 = (Convert.ToDouble(textBox120.Text) *
p_avarage1) + (Convert.ToDouble(textBox117.Text) * p_avarage2) +
(Convert.ToDouble(textBox114.Text) * p_avarage3) +
(Convert.ToDouble(comboBox49.SelectedItem) * p_avarage4) +
(Convert.ToDouble(comboBox46.SelectedItem) * p_avarage5);
                p_wsum4 = (Convert.ToDouble(textBox119.Text) *
p_avarage1) + (Convert.ToDouble(textBox118.Text) * p_avarage2) +
(Convert.ToDouble(textBox115.Text) * p_avarage3) +
(Convert.ToDouble(textBox113.Text) * p_avarage4) +
(Convert.ToDouble(comboBox45.SelectedItem) * p_avarage5);
                p_wsum5 = (Convert.ToDouble(textBox107.Text) *
p_avarage1) + (Convert.ToDouble(textBox106.Text) * p_avarage2) +
(Convert.ToDouble(textBox105.Text) * p_avarage3) +
(Convert.ToDouble(textBox104.Text) * p_avarage4) +
(Convert.ToDouble(textBox103.Text) * p_avarage5);

                p_div1   =   p_wsum1       /   p_avarage1;
                p_div2   =   p_wsum2       /   p_avarage2;
                p_div3   =   p_wsum3       /   p_avarage3;
                p_div4   =   p_wsum4       /   p_avarage4;
                p_div5   =   p_wsum5       /   p_avarage5;

                p_lamda = (p_div1 + p_div2 + p_div3 + p_div4 + p_div5)
/ 5;
                p_CI = (p_lamda - 5) / (5 - 1);
                p_CR = (p_CI / 1.12);


                textBox112.Text        =       Convert.ToString(p_avarage1);
                textBox111.Text        =       Convert.ToString(p_avarage2);
                textBox110.Text        =       Convert.ToString(p_avarage3);
                textBox109.Text        =       Convert.ToString(p_avarage4);
                textBox108.Text        =       Convert.ToString(p_avarage5);


                                                - 68 -
                button29.Enabled = true;

                if (p_CR > 0.1)
                {

                     MessageBox.Show("Inconsistency, Please change
entered numbers");
                     textBox121.Clear();
                     textBox120.Clear();
                     textBox119.Clear();
                     textBox107.Clear();
                     textBox117.Clear();
                     textBox118.Clear();
                     textBox106.Clear();
                     textBox115.Clear();
                     textBox105.Clear();
                     textBox104.Clear();
                     textBox46.Clear();
                     textBox45.Clear();
                     textBox44.Clear();
                     textBox43.Clear();
                     textBox50.Clear();
                     button29.Enabled = false;

                }

            }   // count 5
            else if (count == 4)
            {
                textBox120.Text = Convert.ToString((1   /
(Convert.ToDouble(comboBox53.SelectedItem))));
                textBox117.Text = Convert.ToString((1   /
(Convert.ToDouble(comboBox52.SelectedItem))));
                textBox118.Text = Convert.ToString((1   /
(Convert.ToDouble(comboBox50.SelectedItem))));
                textBox119.Text = Convert.ToString((1   /
(Convert.ToDouble(comboBox51.SelectedItem))));
                textBox115.Text = Convert.ToString((1   /
(Convert.ToDouble(comboBox49.SelectedItem))));
                textBox121.Text = Convert.ToString((1   /
(Convert.ToDouble(comboBox54.SelectedItem))));
                textBox105.Text = Convert.ToString((1   /
(Convert.ToDouble(comboBox46.SelectedItem))));
                textBox104.Text = Convert.ToString((1   /
(Convert.ToDouble(comboBox45.SelectedItem))));

                p_sum1 = Convert.ToDouble(textBox122.Text) +
Convert.ToDouble(textBox121.Text) + Convert.ToDouble(textBox120.Text)
+ Convert.ToDouble(textBox119.Text) ;
                p_sum2 = Convert.ToDouble(textBox118.Text) +
Convert.ToDouble(textBox117.Text) +
Convert.ToDouble(comboBox54.SelectedItem) +
Convert.ToDouble(textBox116.Text);
                p_sum3 = Convert.ToDouble(textBox105.Text) +
Convert.ToDouble(textBox115.Text) +
Convert.ToDouble(comboBox52.SelectedItem) +
Convert.ToDouble(comboBox53.SelectedItem) +
Convert.ToDouble(textBox114.Text);
                p_sum4 = Convert.ToDouble(textBox104.Text) +
Convert.ToDouble(comboBox50.SelectedItem) +


                                    - 69 -
Convert.ToDouble(comboBox49.SelectedItem) +
Convert.ToDouble(comboBox51.SelectedItem) +
Convert.ToDouble(textBox113.Text);
                p_sum5 = Convert.ToDouble(textBox103.Text) +
Convert.ToDouble(comboBox48.SelectedItem) +
Convert.ToDouble(comboBox47.SelectedItem) +
Convert.ToDouble(comboBox46.SelectedItem) +
Convert.ToDouble(comboBox45.SelectedItem);


                p_ALT11   =   Convert.ToDouble(textBox122.Text)   /   p_sum1;
                p_ALT12   =   Convert.ToDouble(textBox121.Text)   /   p_sum1;
                p_ALT13   =   Convert.ToDouble(textBox120.Text)   /   p_sum1;
                p_ALT14   =   Convert.ToDouble(textBox119.Text)   /   p_sum1;

                p_ALT21 = Convert.ToDouble(comboBox54.SelectedItem) /
p_sum2;
                p_ALT22 = Convert.ToDouble(textBox116.Text) / p_sum2;
                p_ALT23 = Convert.ToDouble(textBox117.Text) / p_sum2;
                p_ALT24 = Convert.ToDouble(textBox118.Text) / p_sum2;

                p_ALT31 = Convert.ToDouble(comboBox53.SelectedItem) /
p_sum3;
                p_ALT32 = Convert.ToDouble(comboBox52.SelectedItem) /
p_sum3;
                p_ALT33 = Convert.ToDouble(textBox114.Text) / p_sum3;
                p_ALT34 = Convert.ToDouble(textBox115.Text) / p_sum3;
                p_ALT35 = Convert.ToDouble(textBox105.Text) / p_sum3;

                p_ALT41 = Convert.ToDouble(comboBox51.SelectedItem) /
p_sum4;
                p_ALT42 = Convert.ToDouble(comboBox50.SelectedItem) /
p_sum4;
                p_ALT43 = Convert.ToDouble(comboBox49.SelectedItem) /
p_sum4;
                p_ALT44 = Convert.ToDouble(textBox113.Text) / p_sum4;
                p_ALT45 = Convert.ToDouble(textBox104.Text) / p_sum4;

                p_ALT51 = Convert.ToDouble(comboBox48.SelectedItem) /
p_sum5;
                p_ALT52 = Convert.ToDouble(comboBox47.SelectedItem) /
p_sum5;
                p_ALT53 = Convert.ToDouble(comboBox46.SelectedItem) /
p_sum5;
                p_ALT54 = Convert.ToDouble(comboBox45.SelectedItem) /
p_sum5;
                p_ALT55 = Convert.ToDouble(textBox103.Text) / p_sum5;

                p_avarage1 = (p_ALT11 + p_ALT21 + p_ALT31 + p_ALT41 +
p_ALT51) / 5;
                p_avarage2 = (p_ALT12 + p_ALT22 + p_ALT32 + p_ALT42 +
p_ALT52) / 5;
                p_avarage3 = (p_ALT13 + p_ALT23 + p_ALT33 + p_ALT43 +
p_ALT53) / 5;
                p_avarage4 = (p_ALT14 + p_ALT24 + p_ALT34 + p_ALT44 +
p_ALT54) / 5;
                p_avarage5 = (p_ALT15 + p_ALT25 + p_ALT35 + p_ALT45 +
p_ALT55) / 5;

                p_tsum = p_avarage1 + p_avarage2 + p_avarage3 +
p_avarage4 + p_avarage5;


                                       - 70 -
                p_wsum1 = (Convert.ToDouble(textBox122.Text) *
p_avarage1) + (Convert.ToDouble(comboBox54.SelectedItem) * p_avarage2)
+ (Convert.ToDouble(comboBox53.SelectedItem) * p_avarage3) +
(Convert.ToDouble(comboBox51.SelectedItem) * p_avarage4) +
(Convert.ToDouble(comboBox48.SelectedItem) * p_avarage5);
                p_wsum2 = (Convert.ToDouble(textBox121.Text) *
p_avarage1) + (Convert.ToDouble(textBox116.Text) * p_avarage2) +
(Convert.ToDouble(comboBox52.SelectedItem) * p_avarage3) +
(Convert.ToDouble(comboBox50.SelectedItem) * p_avarage4) +
(Convert.ToDouble(comboBox47.SelectedItem) * p_avarage5);
                p_wsum3 = (Convert.ToDouble(textBox120.Text) *
p_avarage1) + (Convert.ToDouble(textBox117.Text) * p_avarage2) +
(Convert.ToDouble(textBox114.Text) * p_avarage3) +
(Convert.ToDouble(comboBox49.SelectedItem) * p_avarage4) +
(Convert.ToDouble(comboBox46.SelectedItem) * p_avarage5);
                p_wsum4 = (Convert.ToDouble(textBox119.Text) *
p_avarage1) + (Convert.ToDouble(textBox118.Text) * p_avarage2) +
(Convert.ToDouble(textBox115.Text) * p_avarage3) +
(Convert.ToDouble(textBox113.Text) * p_avarage4) +
(Convert.ToDouble(comboBox45.SelectedItem) * p_avarage5);

                p_div1   =   p_wsum1       /   p_avarage1;
                p_div2   =   p_wsum2       /   p_avarage2;
                p_div3   =   p_wsum3       /   p_avarage3;
                p_div4   =   p_wsum4       /   p_avarage4;
                p_div5   =   p_wsum5       /   p_avarage5;

                p_lamda = (p_div1 + p_div2 + p_div3 + p_div4 + p_div5)
/ 5;
                p_CI = (p_lamda - 5) / (5 - 1);
                p_CR = (p_CI / 1.12);

                textBox112.Text        =       Convert.ToString(p_avarage1);
                textBox111.Text        =       Convert.ToString(p_avarage2);
                textBox110.Text        =       Convert.ToString(p_avarage3);
                textBox109.Text        =       Convert.ToString(p_avarage4);
                textBox108.Text        =       Convert.ToString(p_avarage5);

                button29.Enabled = true;

                if (p_CR > 0.1)
                {

                     MessageBox.Show("Inconsistency, Please change
entered numbers");
                     textBox121.Clear();
                     textBox120.Clear();
                     textBox119.Clear();
                     textBox117.Clear();
                     textBox118.Clear();
                     textBox115.Clear();
                     textBox105.Clear();
                     textBox104.Clear();
                     textBox46.Clear();
                     textBox45.Clear();
                     textBox44.Clear();
                     textBox43.Clear();
                     textBox50.Clear();
                     button29.Enabled = false;



                                                - 71 -
                }
           } // count 4
           else
           {
           }
       }

        private void button23_Click(object sender, EventArgs e) //
floor calculate
        {
            textBox80.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox33.SelectedItem))));
            textBox77.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox32.SelectedItem))));
            textBox78.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox30.SelectedItem))));
            textBox79.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox31.SelectedItem))));
            textBox75.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox29.SelectedItem))));
            textBox81.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox34.SelectedItem))));
            textBox67.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox28.SelectedItem))));
            textBox66.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox27.SelectedItem))));
            textBox65.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox26.SelectedItem))));
            textBox64.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox25.SelectedItem))));

             f_sum1 = Convert.ToDouble(textBox82.Text) +
Convert.ToDouble(textBox81.Text) + Convert.ToDouble(textBox80.Text) +
Convert.ToDouble(textBox79.Text) + Convert.ToDouble(textBox67.Text);
             f_sum2 = Convert.ToDouble(textBox66.Text) +
Convert.ToDouble(textBox78.Text) + Convert.ToDouble(textBox77.Text) +
Convert.ToDouble(comboBox34.SelectedItem) +
Convert.ToDouble(textBox76.Text);
             f_sum3 = Convert.ToDouble(textBox65.Text) +
Convert.ToDouble(textBox75.Text) +
Convert.ToDouble(comboBox32.SelectedItem) +
Convert.ToDouble(comboBox33.SelectedItem) +
Convert.ToDouble(textBox74.Text);
             f_sum4 = Convert.ToDouble(textBox64.Text) +
Convert.ToDouble(comboBox30.SelectedItem) +
Convert.ToDouble(comboBox29.SelectedItem) +
Convert.ToDouble(comboBox31.SelectedItem) +
Convert.ToDouble(textBox73.Text);
             f_sum5 = Convert.ToDouble(textBox63.Text) +
Convert.ToDouble(comboBox28.SelectedItem) +
Convert.ToDouble(comboBox27.SelectedItem) +
Convert.ToDouble(comboBox26.SelectedItem) +
Convert.ToDouble(comboBox25.SelectedItem);


             f_ALT11   =   Convert.ToDouble(textBox82.Text)   /   f_sum1;
             f_ALT12   =   Convert.ToDouble(textBox81.Text)   /   f_sum1;
             f_ALT13   =   Convert.ToDouble(textBox80.Text)   /   f_sum1;
             f_ALT14   =   Convert.ToDouble(textBox79.Text)   /   f_sum1;
             f_ALT15   =   Convert.ToDouble(textBox67.Text)   /   f_sum1;



                                       - 72 -
                f_ALT21 = Convert.ToDouble(comboBox34.SelectedItem) /
f_sum2;
                f_ALT22   =   Convert.ToDouble(textBox76.Text)   /   f_sum2;
                f_ALT23   =   Convert.ToDouble(textBox77.Text)   /   f_sum2;
                f_ALT24   =   Convert.ToDouble(textBox78.Text)   /   f_sum2;
                f_ALT25   =   Convert.ToDouble(textBox66.Text)   /   f_sum2;

                f_ALT31 = Convert.ToDouble(comboBox33.SelectedItem) /
f_sum3;
                f_ALT32 = Convert.ToDouble(comboBox32.SelectedItem) /
f_sum3;
                f_ALT33 = Convert.ToDouble(textBox74.Text) / f_sum3;
                f_ALT34 = Convert.ToDouble(textBox75.Text) / f_sum3;
                f_ALT35 = Convert.ToDouble(textBox65.Text) / f_sum3;

                f_ALT41 = Convert.ToDouble(comboBox31.SelectedItem) /
f_sum4;
                f_ALT42 = Convert.ToDouble(comboBox30.SelectedItem) /
f_sum4;
                f_ALT43 = Convert.ToDouble(comboBox29.SelectedItem) /
f_sum4;
                f_ALT44 = Convert.ToDouble(textBox73.Text) / f_sum4;
                f_ALT45 = Convert.ToDouble(textBox64.Text) / f_sum4;

                f_ALT51 = Convert.ToDouble(comboBox28.SelectedItem) /
f_sum5;
                f_ALT52 = Convert.ToDouble(comboBox27.SelectedItem) /
f_sum5;
                f_ALT53 = Convert.ToDouble(comboBox26.SelectedItem) /
f_sum5;
                f_ALT54 = Convert.ToDouble(comboBox25.SelectedItem) /
f_sum5;
                f_ALT55 = Convert.ToDouble(textBox63.Text) / f_sum5;

                f_avarage1 = (f_ALT11 + f_ALT21 + f_ALT31 + f_ALT41 +
f_ALT51) / 5;
                f_avarage2 = (f_ALT12 + f_ALT22 + f_ALT32 + f_ALT42 +
f_ALT52) / 5;
                f_avarage3 = (f_ALT13 + f_ALT23 + f_ALT33 + f_ALT43 +
f_ALT53) / 5;
                f_avarage4 = (f_ALT14 + f_ALT24 + f_ALT34 + f_ALT44 +
f_ALT54) / 5;
                f_avarage5 = (f_ALT15 + f_ALT25 + f_ALT35 + f_ALT45 +
f_ALT55) / 5;

             f_tsum = f_avarage1 + f_avarage2 + f_avarage3 +
f_avarage4 + f_avarage5;

             f_wsum1 = (Convert.ToDouble(textBox82.Text) *           f_avarage1)
+ (Convert.ToDouble(comboBox34.SelectedItem) * f_avarage2)           +
(Convert.ToDouble(comboBox33.SelectedItem) * f_avarage3) +
(Convert.ToDouble(comboBox31.SelectedItem) * f_avarage4) +
(Convert.ToDouble(comboBox28.SelectedItem) * f_avarage5);
             f_wsum2 = (Convert.ToDouble(textBox81.Text) *           f_avarage1)
+ (Convert.ToDouble(textBox76.Text) * f_avarage2) +
(Convert.ToDouble(comboBox32.SelectedItem) * f_avarage3) +
(Convert.ToDouble(comboBox30.SelectedItem) * f_avarage4) +
(Convert.ToDouble(comboBox27.SelectedItem) * f_avarage5);
             f_wsum3 = (Convert.ToDouble(textBox80.Text) *            f_avarage1)
+ (Convert.ToDouble(textBox77.Text) * f_avarage2) +
(Convert.ToDouble(textBox74.Text) * f_avarage3) +


                                          - 73 -
(Convert.ToDouble(comboBox29.SelectedItem) * f_avarage4) +
(Convert.ToDouble(comboBox26.SelectedItem) * f_avarage5);
             f_wsum4 = (Convert.ToDouble(textBox79.Text) * f_avarage1)
+ (Convert.ToDouble(textBox78.Text) * f_avarage2) +
(Convert.ToDouble(textBox75.Text) * f_avarage3) +
(Convert.ToDouble(textBox73.Text) * f_avarage4) +
(Convert.ToDouble(comboBox25.SelectedItem) * f_avarage5);
             f_wsum5 = (Convert.ToDouble(textBox67.Text) * f_avarage1)
+ (Convert.ToDouble(textBox66.Text) * f_avarage2) +
(Convert.ToDouble(textBox65.Text) * f_avarage3) +
(Convert.ToDouble(textBox64.Text) * f_avarage4) +
(Convert.ToDouble(textBox63.Text) * f_avarage5);


              f_div1   =   f_wsum1   /   f_avarage1;
              f_div2   =   f_wsum2   /   f_avarage2;
              f_div3   =   f_wsum3   /   f_avarage3;
              f_div4   =   f_wsum4   /   f_avarage4;
              f_div5   =   f_wsum5   /   f_avarage5;

              f_lamda = (f_div1 + f_div2 + f_div3 + f_div4 + f_div5) /
5;
              f_CI = (f_lamda - 5) / (5 - 1);
              f_CR = (f_CI / 1.12);


             textBox72.Text    =     Convert.ToString(f_avarage1);
             textBox71.Text    =     Convert.ToString(f_avarage2);
             textBox70.Text    =     Convert.ToString(f_avarage3);
             textBox69.Text    =     Convert.ToString(f_avarage4);
             textBox68.Text    =     Convert.ToString(f_avarage5);



             button21.Enabled = true;

             if (f_CR > 0.1)
             {

                 MessageBox.Show("Inconsistency, Please change entered
numbers");
                 textBox81.Clear();

                 textBox80.Clear();
                 textBox79.Clear();
                 textBox67.Clear();

                 textBox77.Clear();
                 textBox78.Clear();
                 textBox66.Clear();

                 textBox75.Clear();
                 textBox65.Clear();
                 textBox64.Clear();

                 textBox46.Clear();
                 textBox45.Clear();
                 textBox44.Clear();
                 textBox43.Clear();
                 textBox50.Clear();



                                            - 74 -
                textBox72.Clear();
                textBox71.Clear();
                textBox70.Clear();
                textBox69.Clear();
                textBox68.Clear();

                button21.Enabled = false;

            }

            //int total1 = Convert.ToUInt32(textBox1.Text) +
Convert.ToUInt32(textBox2.Text) + Convert.ToUInt32(textBox3.Text) +
Convert.ToUInt32(textBox4.Text);
            //int oneone =
        }

        private void button15_Click_1(object sender, EventArgs e) //
heating calculate
        {
            textBox41.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox14.SelectedItem))));
            textBox40.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox13.SelectedItem))));
            textBox39.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox11.SelectedItem))));
            textBox37.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox12.SelectedItem))));
            textBox38.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox10.SelectedItem))));
            textBox35.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox9.SelectedItem))));

            h_sum1 = Convert.ToDouble(textBox42.Text) +
Convert.ToDouble(textBox41.Text) + Convert.ToDouble(textBox40.Text) +
Convert.ToDouble(textBox39.Text);
            h_sum2 = Convert.ToDouble(textBox36.Text) +
Convert.ToDouble(textBox37.Text) + Convert.ToDouble(textBox38.Text) +
Convert.ToDouble(comboBox14.SelectedItem);
            h_sum3 = Convert.ToDouble(textBox34.Text) +
Convert.ToDouble(textBox35.Text) +
Convert.ToDouble(comboBox13.SelectedItem) +
Convert.ToDouble(comboBox12.SelectedItem);
            h_sum4 = Convert.ToDouble(textBox33.Text) +
Convert.ToDouble(comboBox11.SelectedItem) +
Convert.ToDouble(comboBox10.SelectedItem) +
Convert.ToDouble(comboBox9.SelectedItem);

            h_radiator1   =   Convert.ToDouble(textBox42.Text)   /   h_sum1;
            h_radiator2   =   Convert.ToDouble(textBox41.Text)   /   h_sum1;
            h_radiator3   =   Convert.ToDouble(textBox40.Text)   /   h_sum1;
            h_radiator4   =   Convert.ToDouble(textBox39.Text)   /   h_sum1;

            h_natural1 = Convert.ToDouble(comboBox14.SelectedItem) /
h_sum2;
            h_natural2 = Convert.ToDouble(textBox36.Text) / h_sum2;
            h_natural3 = Convert.ToDouble(textBox37.Text) / h_sum2;
            h_natural4 = Convert.ToDouble(textBox38.Text) / h_sum2;

            h_combi1 = Convert.ToDouble(comboBox13.SelectedItem) /
h_sum3;



                                       - 75 -
              h_combi2 = Convert.ToDouble(comboBox12.SelectedItem) /
h_sum3;
              h_combi3 = Convert.ToDouble(textBox34.Text) / h_sum3;
              h_combi4 = Convert.ToDouble(textBox35.Text) / h_sum3;

              h_central1 = Convert.ToDouble(comboBox11.SelectedItem) /
h_sum4;
              h_central2 = Convert.ToDouble(comboBox10.SelectedItem) /
h_sum4;
              h_central3 = Convert.ToDouble(comboBox9.SelectedItem) /
h_sum4;
              h_central4 = Convert.ToDouble(textBox33.Text) / h_sum4;

            h_avarage1       = (h_radiator1 + h_natural1 + h_combi1 +
h_central1) / 4;
            h_avarage2       = (h_radiator2 + h_natural2 + h_combi2 +
h_central2) / 4;
            h_avarage3       = (h_radiator3 + h_natural3 + h_combi3 +
h_central3) / 4;
            h_avarage4       = (h_radiator4 + h_natural4 + h_combi4 +
h_central4) / 4;

              h_tsum = h_avarage1 + h_avarage2 + h_avarage3 +
h_avarage4;


            h_wsum1 = (Convert.ToDouble(textBox42.Text) * h_avarage1)
+ (Convert.ToDouble(comboBox14.SelectedItem) * h_avarage2) +
(Convert.ToDouble(comboBox13.SelectedItem) * h_avarage3) +
(Convert.ToDouble(comboBox11.SelectedItem) * h_avarage4);
            h_wsum2 = (Convert.ToDouble(textBox41.Text) * h_avarage1)
+ (Convert.ToDouble(textBox36.Text) * h_avarage2) +
(Convert.ToDouble(comboBox12.SelectedItem) * h_avarage3) +
(Convert.ToDouble(comboBox10.SelectedItem) * h_avarage4);
            h_wsum3 = (Convert.ToDouble(textBox40.Text) * h_avarage1)
+ (Convert.ToDouble(textBox37.Text) * h_avarage2) +
(Convert.ToDouble(textBox34.Text) * h_avarage3) +
(Convert.ToDouble(comboBox9.SelectedItem) * h_avarage4);
            h_wsum4 = (Convert.ToDouble(textBox39.Text) * h_avarage1)
+ (Convert.ToDouble(textBox38.Text) * h_avarage2) +
(Convert.ToDouble(textBox35.Text) * h_avarage3) +
(Convert.ToDouble(textBox33.Text) * h_avarage4);



              h_div1   =   h_wsum1   /   h_avarage1;
              h_div2   =   h_wsum2   /   h_avarage2;
              h_div3   =   h_wsum3   /   h_avarage3;
              h_div4   =   h_wsum4   /   h_avarage4;

              h_lamda = (h_div1 + h_div2 + h_div3 + h_div4) / 4;
              h_CI = (h_lamda - 4) / (4 - 1);
              h_CR = h_CI / 0.9;


              textBox32.Text     =   Convert.ToString(h_avarage1);
              textBox31.Text     =   Convert.ToString(h_avarage2);
              textBox30.Text     =   Convert.ToString(h_avarage3);
              textBox29.Text     =   Convert.ToString(h_avarage4);

              button13.Enabled = true;


                                             - 76 -
             if (h_CR > 0.1)
             {

                 MessageBox.Show("Inconsistency, Please change entered
numbers");
                 textBox35.Clear();
                 textBox41.Clear();
                 textBox40.Clear();
                 textBox39.Clear();
                 textBox37.Clear();
                 textBox38.Clear();

                 textBox32.Clear();
                 textBox31.Clear();
                 textBox30.Clear();
                 textBox29.Clear();

                 button13.Enabled = false;

             }



            //int total1 = Convert.ToUInt32(textBox1.Text) +
Convert.ToUInt32(textBox2.Text) + Convert.ToUInt32(textBox3.Text) +
Convert.ToUInt32(textBox4.Text);
            //int oneone =
        }

        private void button1_Click_1(object sender, EventArgs e) //
main calculate
        {
            textBox2.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox1.SelectedItem))));
            textBox3.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox2.SelectedItem))));
            textBox4.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox4.SelectedItem))));
            textBox7.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox3.SelectedItem))));
            textBox8.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox5.SelectedItem))));
            textBox12.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox6.SelectedItem))));

            m_sum1 = Convert.ToDouble(textBox1.Text) +
Convert.ToDouble(textBox2.Text) + Convert.ToDouble(textBox3.Text) +
Convert.ToDouble(textBox4.Text);
            m_sum2 = Convert.ToDouble(textBox6.Text) +
Convert.ToDouble(textBox7.Text) + Convert.ToDouble(textBox8.Text) +
Convert.ToDouble(comboBox1.SelectedItem);
            m_sum3 = Convert.ToDouble(textBox11.Text) +
Convert.ToDouble(textBox12.Text) +
Convert.ToDouble(comboBox2.SelectedItem) +
Convert.ToDouble(comboBox3.SelectedItem);
            m_sum4 = Convert.ToDouble(textBox16.Text) +
Convert.ToDouble(comboBox4.SelectedItem) +
Convert.ToDouble(comboBox5.SelectedItem) +
Convert.ToDouble(comboBox6.SelectedItem);



                                      - 77 -
              m_building1    =   Convert.ToDouble(textBox1.Text)   /   m_sum1;
              m_building2    =   Convert.ToDouble(textBox2.Text)   /   m_sum1;
              m_building3    =   Convert.ToDouble(textBox3.Text)   /   m_sum1;
              m_building4    =   Convert.ToDouble(textBox4.Text)   /   m_sum1;

              m_heating1 = Convert.ToDouble(comboBox1.SelectedItem) /
m_sum2;
              m_heating2 = Convert.ToDouble(textBox6.Text) / m_sum2;
              m_heating3 = Convert.ToDouble(textBox7.Text) / m_sum2;
              m_heating4 = Convert.ToDouble(textBox8.Text) / m_sum2;

              m_price1 = Convert.ToDouble(comboBox2.SelectedItem) /
m_sum3;
              m_price2 = Convert.ToDouble(comboBox3.SelectedItem) /
m_sum3;
              m_price3 = Convert.ToDouble(textBox11.Text) / m_sum3;
              m_price4 = Convert.ToDouble(textBox12.Text) / m_sum3;

              m_outdoor1 = Convert.ToDouble(comboBox4.SelectedItem) /
m_sum4;
              m_outdoor2 = Convert.ToDouble(comboBox5.SelectedItem) /
m_sum4;
              m_outdoor3 = Convert.ToDouble(comboBox6.SelectedItem) /
m_sum4;
              m_outdoor4 = Convert.ToDouble(textBox16.Text) / m_sum4;

            m_avarage1      = (m_building1 + m_heating1 + m_price1 +
m_outdoor1) / 4;
            m_avarage2      = (m_building2 + m_heating2 + m_price2 +
m_outdoor2) / 4;
            m_avarage3      = (m_building3 + m_heating3 + m_price3 +
m_outdoor3) / 4;
            m_avarage4      = (m_building4 + m_heating4 + m_price4 +
m_outdoor4) / 4;

              m_tsum = m_avarage1 + m_avarage2 + m_avarage3 +
m_avarage4;


            m_wsum1 = (Convert.ToDouble(textBox1.Text) * m_avarage1)             +
(Convert.ToDouble(comboBox1.SelectedItem) * m_avarage2) +
(Convert.ToDouble(comboBox2.SelectedItem) * m_avarage3) +
(Convert.ToDouble(comboBox4.SelectedItem) * m_avarage4);
            m_wsum2 = (Convert.ToDouble(textBox2.Text) * m_avarage1)             +
(Convert.ToDouble(textBox6.Text) * m_avarage2) +
(Convert.ToDouble(comboBox3.SelectedItem) * m_avarage3) +
(Convert.ToDouble(comboBox5.SelectedItem) * m_avarage4);
            m_wsum3 = (Convert.ToDouble(textBox3.Text) * m_avarage1)             +
(Convert.ToDouble(textBox7.Text) * m_avarage2) +
(Convert.ToDouble(textBox11.Text) * m_avarage3) +
(Convert.ToDouble(comboBox6.SelectedItem) * m_avarage4);
            m_wsum4 = (Convert.ToDouble(textBox4.Text) * m_avarage1)             +
(Convert.ToDouble(textBox8.Text) * m_avarage2) +
(Convert.ToDouble(textBox12.Text) * m_avarage3) +
(Convert.ToDouble(textBox16.Text) * m_avarage4);



              m_div1 = m_wsum1 / m_avarage1;
              m_div2 = m_wsum2 / m_avarage2;
              m_div3 = m_wsum3 / m_avarage3;


                                          - 78 -
             m_div4 = m_wsum4 / m_avarage4;

             m_lamda = (m_div1 + m_div2 + m_div3 + m_div4) / 4;
             m_CI = (m_lamda - 4) / (4 - 1);
             m_CR = m_CI / 0.9;


             textBox5.Text = Convert.ToString(m_avarage1);
             textBox9.Text = Convert.ToString(m_avarage2);
             textBox10.Text = Convert.ToString(m_avarage3);
             textBox14.Text = Convert.ToString(m_avarage4);

             button3.Enabled = true;

             if (m_CR > 0.1)
             {

                 MessageBox.Show("Inconsistency, Please change entered
numbers");
                 textBox12.Clear();
                 textBox2.Clear();
                 textBox3.Clear();
                 textBox4.Clear();
                 textBox7.Clear();
                 textBox8.Clear();

                 textBox5.Clear();
                 textBox9.Clear();
                 textBox10.Clear();
                 textBox14.Clear();
                 button3.Enabled = false;

             }



        }

        private void button2_Click_1(object sender, EventArgs e) //
main clear
        {
            textBox12.Clear();

             textBox2.Clear();
             textBox3.Clear();
             textBox4.Clear();

             textBox7.Clear();
             textBox8.Clear();

             textBox5.Clear();
             textBox9.Clear();
             textBox10.Clear();
             textBox14.Clear();

             button3.Enabled = false;
        }

        private void button3_Click_1(object sender, EventArgs e) //
main next
        {


                                       - 79 -
              tabControl1.SelectedTab = tbpBS;
          }

        private void button10_Click_1(object sender, EventArgs e) //
building next
        {
            tabControl1.SelectedTab = tbpHT;
        }

        private void button9_Click_1(object sender, EventArgs e) //
building calculate
        {
            textBox26.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox8.SelectedItem))));

            b_sum1 = Convert.ToDouble(textBox28.Text) +
Convert.ToDouble(textBox26.Text);
            b_sum2 = Convert.ToDouble(comboBox8.SelectedItem) +
Convert.ToDouble(textBox27.Text);

                  b_floor1 = Convert.ToDouble(textBox28.Text) / b_sum1;
                  b_floor2 = Convert.ToDouble(textBox26.Text) / b_sum1;

              b_condition1 = Convert.ToDouble(comboBox8.SelectedItem) /
b_sum2;
              b_condition2 = Convert.ToDouble(textBox27.Text) / b_sum2;

              b_avarage1 = (b_floor1 + b_condition1) / 2;
              b_avarage2 = (b_floor2 + b_condition2) / 2;

              b_tsum = b_avarage1 + b_avarage2;

            b_wsum1 = (Convert.ToDouble(textBox13.Text) * b_avarage1)
+ (Convert.ToDouble(comboBox7.SelectedItem) * b_avarage2);
            b_wsum2 = (Convert.ToDouble(textBox26.Text) * b_avarage1)
+ (Convert.ToDouble(textBox27.Text) * b_avarage2);

              b_div1 = b_wsum1 / b_avarage1;
              b_div2 = b_wsum2 / b_avarage2;

              b_lamda = (b_div1 + b_div2) / 2;
              b_CI = (b_lamda - 2) / (2 - 1);
              b_CR = (b_CI / 0);

              textBox21.Text = Convert.ToString(b_avarage1);
              textBox20.Text = Convert.ToString(b_avarage2);


              button10.Enabled = true;

              if (b_CR > 0.1)
              {

                     MessageBox.Show("Inconsistency, Please change entered
numbers");
                     textBox21.Clear();
                     textBox20.Clear();
                     textBox26.Clear();
                     button10.Enabled = true;

              }


                                        - 80 -
       }

        private void button8_Click_1(object sender, EventArgs e)
//building clear
        {
            textBox17.Clear();
            textBox20.Clear();
            textBox21.Clear();
            button10.Enabled = true;
        }

        private void button11_Click_1(object sender, EventArgs e) //
building previous
        {
            tabControl1.SelectedTab = tbpM;
        }

        private void button14_Click_1(object sender, EventArgs e) //
heating clear
        {

           textBox26.Clear();

           textBox20.Clear();
           textBox21.Clear();

           button8.Enabled = false;
       }

        private void button13_Click_1(object sender, EventArgs e) //
heating next
        {
             tabControl1.SelectedTab = tbpOA;
        }

        private void button12_Click_1(object sender, EventArgs e) //
heating previous
        {
            tabControl1.SelectedTab = tbpBS;
        }

        private void button19_Click_1(object sender, EventArgs e) //
outdoor calculate
        {
            textBox60.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox19.SelectedItem))));
            textBox57.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox18.SelectedItem))));
            textBox58.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox16.SelectedItem))));
            textBox59.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox17.SelectedItem))));
            textBox49.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox15.SelectedItem))));
            textBox61.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox24.SelectedItem))));
            textBox54.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox22.SelectedItem))));
            textBox53.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox21.SelectedItem))));



                                   - 81 -
            textBox52.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox20.SelectedItem))));
            textBox51.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox23.SelectedItem))));

            o_sum1 = Convert.ToDouble(textBox62.Text) +
Convert.ToDouble(textBox61.Text) + Convert.ToDouble(textBox60.Text) +
Convert.ToDouble(textBox59.Text) + Convert.ToDouble(textBox54.Text);
            o_sum2 = Convert.ToDouble(textBox53.Text) +
Convert.ToDouble(textBox58.Text) + Convert.ToDouble(textBox57.Text) +
Convert.ToDouble(comboBox24.SelectedItem) +
Convert.ToDouble(textBox56.Text);
            o_sum3 = Convert.ToDouble(textBox52.Text) +
Convert.ToDouble(textBox49.Text) +
Convert.ToDouble(comboBox18.SelectedItem) +
Convert.ToDouble(comboBox19.SelectedItem) +
Convert.ToDouble(textBox48.Text);
            o_sum4 = Convert.ToDouble(textBox51.Text) +
Convert.ToDouble(comboBox16.SelectedItem) +
Convert.ToDouble(comboBox15.SelectedItem) +
Convert.ToDouble(comboBox17.SelectedItem) +
Convert.ToDouble(textBox47.Text);
            o_sum5 = Convert.ToDouble(textBox55.Text) +
Convert.ToDouble(comboBox22.SelectedItem) +
Convert.ToDouble(comboBox21.SelectedItem) +
Convert.ToDouble(comboBox20.SelectedItem) +
Convert.ToDouble(comboBox23.SelectedItem);


            o_security1     =   Convert.ToDouble(textBox62.Text)   /   o_sum1;
            o_security2     =   Convert.ToDouble(textBox61.Text)   /   o_sum1;
            o_security3     =   Convert.ToDouble(textBox60.Text)   /   o_sum1;
            o_security4     =   Convert.ToDouble(textBox59.Text)   /   o_sum1;
            o_security5     =   Convert.ToDouble(textBox54.Text)   /   o_sum1;

            o_insite1 = Convert.ToDouble(comboBox24.SelectedItem) /
o_sum2;
            o_insite2   =   Convert.ToDouble(textBox56.Text)   /   o_sum2;
            o_insite3   =   Convert.ToDouble(textBox57.Text)   /   o_sum2;
            o_insite4   =   Convert.ToDouble(textBox58.Text)   /   o_sum2;
            o_insite5   =   Convert.ToDouble(textBox53.Text)   /   o_sum2;

            o_sportcenter1 = Convert.ToDouble(comboBox19.SelectedItem)
/ o_sum3;
            o_sportcenter2 = Convert.ToDouble(comboBox18.SelectedItem)
/ o_sum3;
            o_sportcenter3 = Convert.ToDouble(textBox48.Text) /
o_sum3;
            o_sportcenter4 = Convert.ToDouble(textBox49.Text) /
o_sum3;
            o_sportcenter5 = Convert.ToDouble(textBox52.Text) /
o_sum3;

            o_carparking1 = Convert.ToDouble(comboBox17.SelectedItem)
/ o_sum4;
            o_carparking2 = Convert.ToDouble(comboBox16.SelectedItem)
/ o_sum4;
            o_carparking3 = Convert.ToDouble(comboBox15.SelectedItem)
/ o_sum4;
            o_carparking4 = Convert.ToDouble(textBox47.Text) / o_sum4;
            o_carparking5 = Convert.ToDouble(textBox51.Text) / o_sum4;


                                         - 82 -
            o_swimmingpool1 =
Convert.ToDouble(comboBox22.SelectedItem) / o_sum5;
            o_swimmingpool2 =
Convert.ToDouble(comboBox21.SelectedItem) / o_sum5;
            o_swimmingpool3 =
Convert.ToDouble(comboBox20.SelectedItem) / o_sum5;
            o_swimmingpool4 =
Convert.ToDouble(comboBox23.SelectedItem) / o_sum5;
            o_swimmingpool5 = Convert.ToDouble(textBox55.Text) /
o_sum5;

            o_avarage1 = (o_security1         + o_insite1 + o_sportcenter1 +
o_carparking1 + o_swimmingpool1) / 5;
            o_avarage2 = (o_security2         + o_insite2 + o_sportcenter2 +
o_carparking2 + o_swimmingpool2) / 5;
            o_avarage3 = (o_security3         + o_insite3 + o_sportcenter3 +
o_carparking3 + o_swimmingpool3) / 5;
            o_avarage4 = (o_security4         + o_insite4 + o_sportcenter4 +
o_carparking4 + o_swimmingpool4) / 5;
            o_avarage5 = (o_security5         + o_insite5 + o_sportcenter5 +
o_carparking5 + o_swimmingpool5) / 5;

            o_tsum = o_avarage1 + o_avarage2 + o_avarage3 + o_avarage4
+ o_avarage5;

            o_wsum1 = (Convert.ToDouble(textBox62.Text) * o_avarage1)
+ (Convert.ToDouble(comboBox24.SelectedItem) * o_avarage2) +
(Convert.ToDouble(comboBox19.SelectedItem) * o_avarage3) +
(Convert.ToDouble(comboBox17.SelectedItem) * o_avarage4) +
(Convert.ToDouble(comboBox22.SelectedItem) * o_avarage5);
            o_wsum2 = (Convert.ToDouble(textBox61.Text) * o_avarage1)
+ (Convert.ToDouble(textBox56.Text) * o_avarage2) +
(Convert.ToDouble(comboBox18.SelectedItem) * o_avarage3) +
(Convert.ToDouble(comboBox16.SelectedItem) * o_avarage4) +
(Convert.ToDouble(comboBox21.SelectedItem) * o_avarage5);
            o_wsum3 = (Convert.ToDouble(textBox60.Text) * o_avarage1)
+ (Convert.ToDouble(textBox57.Text) * o_avarage2) +
(Convert.ToDouble(textBox48.Text) * o_avarage3) +
(Convert.ToDouble(comboBox15.SelectedItem) * o_avarage4) +
(Convert.ToDouble(comboBox20.SelectedItem) * o_avarage5);
            o_wsum4 = (Convert.ToDouble(textBox59.Text) * o_avarage1)
+ (Convert.ToDouble(textBox58.Text) * o_avarage2) +
(Convert.ToDouble(textBox49.Text) * o_avarage3) +
(Convert.ToDouble(textBox47.Text) * o_avarage4) +
(Convert.ToDouble(comboBox23.SelectedItem) * o_avarage5);
            o_wsum5 = (Convert.ToDouble(textBox54.Text) * o_avarage1)
+ (Convert.ToDouble(textBox53.Text) * o_avarage2) +
(Convert.ToDouble(textBox52.Text) * o_avarage3) +
(Convert.ToDouble(textBox51.Text) * o_avarage4) +
(Convert.ToDouble(textBox55.Text) * o_avarage5);


            o_div1   =   o_wsum1   /   o_avarage1;
            o_div2   =   o_wsum2   /   o_avarage2;
            o_div3   =   o_wsum3   /   o_avarage3;
            o_div4   =   o_wsum4   /   o_avarage4;
            o_div5   =   o_wsum5   /   o_avarage5;

            o_lamda = (o_div1 + o_div2 + o_div3 + o_div4 + o_div5) /
5;


                                           - 83 -
             o_CI = (o_lamda - 5) / (5 - 1);
             o_CR = (o_CI / 1.12);


             textBox46.Text   =   Convert.ToString(o_avarage1);
             textBox45.Text   =   Convert.ToString(o_avarage2);
             textBox44.Text   =   Convert.ToString(o_avarage3);
             textBox43.Text   =   Convert.ToString(o_avarage4);
             textBox50.Text   =   Convert.ToString(o_avarage5);

             button17.Enabled = true;

             if (o_CR > 0.1)
             {

                 MessageBox.Show("Inconsistency, Please change entered
numbers");
                 textBox61.Clear();

                 textBox60.Clear();
                 textBox59.Clear();
                 textBox54.Clear();

                 textBox57.Clear();
                 textBox58.Clear();
                 textBox53.Clear();

                 textBox49.Clear();
                 textBox52.Clear();
                 textBox51.Clear();

                 textBox46.Clear();
                 textBox45.Clear();
                 textBox44.Clear();
                 textBox43.Clear();
                 textBox50.Clear();

                 button17.Enabled = false;

             }



        }

        private void button17_Click_1(object sender, EventArgs e) //
outdoor next
        {
             tabControl1.SelectedTab = tbpP;
        }

        private void button20_Click(object sender, EventArgs e) //
floor previous
        {
            tabControl1.SelectedTab = tbpP;
        }

        private void button22_Click(object sender, EventArgs e) //
floor clear
        {
            textBox81.Clear();


                                        - 84 -
           textBox80.Clear();
           textBox79.Clear();
           textBox67.Clear();

           textBox77.Clear();
           textBox78.Clear();
           textBox66.Clear();

           textBox75.Clear();
           textBox65.Clear();
           textBox64.Clear();

           textBox46.Clear();
           textBox45.Clear();
           textBox44.Clear();
           textBox43.Clear();
           textBox50.Clear();

           textBox72.Clear();
           textBox71.Clear();
           textBox70.Clear();
           textBox69.Clear();
           textBox68.Clear();

           button21.Enabled = false;
       }

        private void button21_Click(object sender, EventArgs e) //
floor next
        {
            tabControl1.SelectedTab = tbpC;
        }

        private void button18_Click_1(object sender, EventArgs e) //
outdoor clear
        {
            textBox48.Clear();

           textBox47.Clear();
           textBox46.Clear();
           textBox54.Clear();

           textBox44.Clear();
           textBox45.Clear();
           textBox53.Clear();

           textBox42.Clear();
           textBox51.Clear();
           textBox52.Clear();

           textBox46.Clear();
           textBox45.Clear();
           textBox44.Clear();
           textBox43.Clear();
           textBox50.Clear();

           button17.Enabled = false;
       }




                                   - 85 -
        private void button16_Click_1(object sender, EventArgs e) //
outdoor previous
        {
            tabControl1.SelectedTab = tbpHT;
        }

        private void button29_Click(object sender, EventArgs e) //
price next
        {
            tabControl1.SelectedTab = tbpFP;
        }

       private void button25_Click(object sender, EventArgs e)
       {
           tabControl1.SelectedTab = tbpR;
       }

        private void button30_Click(object sender, EventArgs e) //
price clear
        {
            textBox121.Clear();

           textBox120.Clear();
           textBox119.Clear();
           textBox107.Clear();

           textBox117.Clear();
           textBox118.Clear();
           textBox106.Clear();

           textBox115.Clear();
           textBox105.Clear();
           textBox113.Clear();
           textBox104.Clear();
           textBox103.Clear();

           textBox112.Clear();
           textBox111.Clear();
           textBox110.Clear();
           textBox109.Clear();
           textBox108.Clear();

           button29.Enabled = false;
       }

        private void button28_Click(object sender, EventArgs e) //
pirice previous
        {
            tabControl1.SelectedTab = tbpOA;
        }

        private void button27_Click(object sender, EventArgs e) //
condition calculation
        {
            textBox100.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox43.SelectedItem))));
            textBox97.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox42.SelectedItem))));
            textBox98.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox40.SelectedItem))));



                                   - 86 -
            textBox99.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox41.SelectedItem))));
            textBox95.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox39.SelectedItem))));
            textBox101.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox44.SelectedItem))));
            textBox87.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox38.SelectedItem))));
            textBox86.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox37.SelectedItem))));
            textBox85.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox36.SelectedItem))));
            textBox84.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox35.SelectedItem))));

              c_sum1 = Convert.ToDouble(textBox102.Text) +
Convert.ToDouble(textBox101.Text) + Convert.ToDouble(textBox100.Text)
+ Convert.ToDouble(textBox99.Text) + Convert.ToDouble(textBox87.Text);
              c_sum2 = Convert.ToDouble(textBox86.Text) +
Convert.ToDouble(textBox98.Text) + Convert.ToDouble(textBox97.Text) +
Convert.ToDouble(comboBox44.SelectedItem) +
Convert.ToDouble(textBox96.Text);
              c_sum3 = Convert.ToDouble(textBox85.Text) +
Convert.ToDouble(textBox95.Text) +
Convert.ToDouble(comboBox42.SelectedItem) +
Convert.ToDouble(comboBox43.SelectedItem) +
Convert.ToDouble(textBox94.Text);
              c_sum4 = Convert.ToDouble(textBox84.Text) +
Convert.ToDouble(comboBox40.SelectedItem) +
Convert.ToDouble(comboBox39.SelectedItem) +
Convert.ToDouble(comboBox41.SelectedItem) +
Convert.ToDouble(textBox93.Text);
              c_sum5 = Convert.ToDouble(textBox83.Text) +
Convert.ToDouble(comboBox38.SelectedItem) +
Convert.ToDouble(comboBox37.SelectedItem) +
Convert.ToDouble(comboBox36.SelectedItem) +
Convert.ToDouble(comboBox35.SelectedItem);


              c_ALT11   =   Convert.ToDouble(textBox102.Text) / c_sum1;
              c_ALT12   =   Convert.ToDouble(textBox101.Text) / c_sum1;
              c_ALT13   =   Convert.ToDouble(textBox100.Text) / c_sum1;
              c_ALT14   =   Convert.ToDouble(textBox99.Text) / c_sum1;
              c_ALT15   =   Convert.ToDouble(textBox87.Text) / c_sum1;

              c_ALT21 = Convert.ToDouble(comboBox44.SelectedItem) /
c_sum2;
              c_ALT22   =   Convert.ToDouble(textBox96.Text)   /   c_sum2;
              c_ALT23   =   Convert.ToDouble(textBox97.Text)   /   c_sum2;
              c_ALT24   =   Convert.ToDouble(textBox98.Text)   /   c_sum2;
              c_ALT25   =   Convert.ToDouble(textBox86.Text)   /   c_sum2;

              c_ALT31 = Convert.ToDouble(comboBox43.SelectedItem) /
c_sum3;
              c_ALT32 = Convert.ToDouble(comboBox42.SelectedItem) /
c_sum3;
              c_ALT33 = Convert.ToDouble(textBox94.Text) / c_sum3;
              c_ALT34 = Convert.ToDouble(textBox95.Text) / c_sum3;
              c_ALT35 = Convert.ToDouble(textBox85.Text) / c_sum3;




                                       - 87 -
                c_ALT41 = Convert.ToDouble(comboBox41.SelectedItem) /
c_sum4;
                c_ALT42 = Convert.ToDouble(comboBox40.SelectedItem) /
c_sum4;
                c_ALT43 = Convert.ToDouble(comboBox39.SelectedItem) /
c_sum4;
                c_ALT44 = Convert.ToDouble(textBox93.Text) / c_sum4;
                c_ALT45 = Convert.ToDouble(textBox84.Text) / c_sum4;

                c_ALT51 = Convert.ToDouble(comboBox38.SelectedItem) /
c_sum5;
                c_ALT52 = Convert.ToDouble(comboBox37.SelectedItem) /
c_sum5;
                c_ALT53 = Convert.ToDouble(comboBox36.SelectedItem) /
c_sum5;
                c_ALT54 = Convert.ToDouble(comboBox35.SelectedItem) /
c_sum5;
                c_ALT55 = Convert.ToDouble(textBox83.Text) / c_sum5;

                c_avarage1 = (c_ALT11 + c_ALT21 + c_ALT31 + c_ALT41 +
c_ALT51) / 5;
                c_avarage2 = (c_ALT12 + c_ALT22 + c_ALT32 + c_ALT42 +
c_ALT52) / 5;
                c_avarage3 = (c_ALT13 + c_ALT23 + c_ALT33 + c_ALT43 +
c_ALT53) / 5;
                c_avarage4 = (c_ALT14 + c_ALT24 + c_ALT34 + c_ALT44 +
c_ALT54) / 5;
                c_avarage5 = (c_ALT15 + c_ALT25 + c_ALT35 + c_ALT45 +
c_ALT55) / 5;

              c_tsum = c_avarage1 + c_avarage2 + c_avarage3 +
c_avarage4 + c_avarage5;

              c_wsum1 = (Convert.ToDouble(textBox102.Text) *
c_avarage1) + (Convert.ToDouble(comboBox44.SelectedItem) * c_avarage2)
+ (Convert.ToDouble(comboBox43.SelectedItem) * c_avarage3) +
(Convert.ToDouble(comboBox41.SelectedItem) * c_avarage4) +
(Convert.ToDouble(comboBox38.SelectedItem) * c_avarage5);
              c_wsum2 = (Convert.ToDouble(textBox101.Text) *
c_avarage1) + (Convert.ToDouble(textBox96.Text) * c_avarage2) +
(Convert.ToDouble(comboBox42.SelectedItem) * c_avarage3) +
(Convert.ToDouble(comboBox40.SelectedItem) * c_avarage4) +
(Convert.ToDouble(comboBox37.SelectedItem) * c_avarage5);
              c_wsum3 = (Convert.ToDouble(textBox100.Text) *
c_avarage1) + (Convert.ToDouble(textBox97.Text) * c_avarage2) +
(Convert.ToDouble(textBox94.Text) * c_avarage3) +
(Convert.ToDouble(comboBox39.SelectedItem) * c_avarage4) +
(Convert.ToDouble(comboBox36.SelectedItem) * c_avarage5);
              c_wsum4 = (Convert.ToDouble(textBox99.Text) *
c_avarage1) + (Convert.ToDouble(textBox98.Text) * c_avarage2) +
(Convert.ToDouble(textBox95.Text) * c_avarage3) +
(Convert.ToDouble(textBox93.Text) * c_avarage4) +
(Convert.ToDouble(comboBox35.SelectedItem) * c_avarage5);
              c_wsum5 = (Convert.ToDouble(textBox87.Text) *
c_avarage1) + (Convert.ToDouble(textBox86.Text) * c_avarage2) +
(Convert.ToDouble(textBox85.Text) * c_avarage3) +
(Convert.ToDouble(textBox84.Text) * c_avarage4) +
(Convert.ToDouble(textBox83.Text) * c_avarage5);


                c_div1 = c_wsum1 / c_avarage1;


                                     - 88 -
                 c_div2   =   c_wsum2   /   c_avarage2;
                 c_div3   =   c_wsum3   /   c_avarage3;
                 c_div4   =   c_wsum4   /   c_avarage4;
                 c_div5   =   c_wsum5   /   c_avarage5;

                 c_lamda = (c_div1 + c_div2 + c_div3 + c_div4 + c_div5) /
5;
                 c_CI = (c_lamda - 5) / (5 - 1);
                 c_CR = (c_CI / 1.12);


             textBox92.Text      =   Convert.ToString(c_avarage1);
             textBox91.Text      =   Convert.ToString(c_avarage2);
             textBox90.Text      =   Convert.ToString(c_avarage3);
             textBox89.Text      =   Convert.ToString(c_avarage4);
             textBox88.Text      =   Convert.ToString(c_avarage5);


             button25.Enabled = true;

             if (c_CR > 0.1)
             {

                   MessageBox.Show("Inconsistency, Please change entered
numbers");
                   textBox101.Clear();

                   textBox100.Clear();
                   textBox99.Clear();
                   textBox87.Clear();

                   textBox97.Clear();
                   textBox98.Clear();
                   textBox86.Clear();

                   textBox95.Clear();
                   textBox85.Clear();
                   textBox84.Clear();

                   textBox46.Clear();
                   textBox45.Clear();
                   textBox44.Clear();
                   textBox43.Clear();
                   textBox50.Clear();

                   textBox92.Clear();
                   textBox91.Clear();
                   textBox90.Clear();
                   textBox89.Clear();
                   textBox88.Clear();

                   button25.Enabled = false;

             }

        }

        private void button26_Click(object sender, EventArgs e) //
condition clear
        {
            textBox101.Clear();


                                              - 89 -
           textBox100.Clear();
           textBox99.Clear();
           textBox87.Clear();

           textBox97.Clear();
           textBox98.Clear();
           textBox86.Clear();

           textBox95.Clear();
           textBox85.Clear();
           textBox84.Clear();

           textBox46.Clear();
           textBox45.Clear();
           textBox44.Clear();
           textBox43.Clear();
           textBox50.Clear();

           textBox92.Clear();
           textBox91.Clear();
           textBox90.Clear();
           textBox89.Clear();
           textBox88.Clear();

           button25.Enabled = false;

       }

        private void button39_Click(object sender, EventArgs e) //
radiator calculation
        {
            textBox160.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox73.SelectedItem))));
            textBox157.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox72.SelectedItem))));
            textBox158.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox70.SelectedItem))));
            textBox159.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox71.SelectedItem))));
            textBox155.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox69.SelectedItem))));
            textBox161.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox74.SelectedItem))));
            textBox147.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox68.SelectedItem))));
            textBox146.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox67.SelectedItem))));
            textBox145.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox66.SelectedItem))));
            textBox144.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox65.SelectedItem))));

             r_sum1 = Convert.ToDouble(textBox162.Text) +
Convert.ToDouble(textBox161.Text) + Convert.ToDouble(textBox160.Text)
+ Convert.ToDouble(textBox159.Text) +
Convert.ToDouble(textBox147.Text);
             r_sum2 = Convert.ToDouble(textBox146.Text) +
Convert.ToDouble(textBox158.Text) + Convert.ToDouble(textBox157.Text)
+ Convert.ToDouble(comboBox74.SelectedItem) +
Convert.ToDouble(textBox156.Text);


                                   - 90 -
             r_sum3 = Convert.ToDouble(textBox145.Text) +
Convert.ToDouble(textBox155.Text) +
Convert.ToDouble(comboBox72.SelectedItem) +
Convert.ToDouble(comboBox73.SelectedItem) +
Convert.ToDouble(textBox154.Text);
             r_sum4 = Convert.ToDouble(textBox144.Text) +
Convert.ToDouble(comboBox70.SelectedItem) +
Convert.ToDouble(comboBox69.SelectedItem) +
Convert.ToDouble(comboBox71.SelectedItem) +
Convert.ToDouble(textBox153.Text);
             r_sum5 = Convert.ToDouble(textBox143.Text) +
Convert.ToDouble(comboBox68.SelectedItem) +
Convert.ToDouble(comboBox67.SelectedItem) +
Convert.ToDouble(comboBox66.SelectedItem) +
Convert.ToDouble(comboBox65.SelectedItem);


                r_ALT11   =   Convert.ToDouble(textBox162.Text)   /   r_sum1;
                r_ALT12   =   Convert.ToDouble(textBox161.Text)   /   r_sum1;
                r_ALT13   =   Convert.ToDouble(textBox160.Text)   /   r_sum1;
                r_ALT14   =   Convert.ToDouble(textBox159.Text)   /   r_sum1;
                r_ALT15   =   Convert.ToDouble(textBox147.Text)   /   r_sum1;

                r_ALT21 = Convert.ToDouble(comboBox74.SelectedItem) /
r_sum2;
                r_ALT22   =   Convert.ToDouble(textBox156.Text)   /   r_sum2;
                r_ALT23   =   Convert.ToDouble(textBox157.Text)   /   r_sum2;
                r_ALT24   =   Convert.ToDouble(textBox158.Text)   /   r_sum2;
                r_ALT25   =   Convert.ToDouble(textBox146.Text)   /   r_sum2;

                r_ALT31 = Convert.ToDouble(comboBox73.SelectedItem) /
r_sum3;
                r_ALT32 = Convert.ToDouble(comboBox72.SelectedItem) /
r_sum3;
                r_ALT33 = Convert.ToDouble(textBox154.Text) / r_sum3;
                r_ALT34 = Convert.ToDouble(textBox155.Text) / r_sum3;
                r_ALT35 = Convert.ToDouble(textBox145.Text) / r_sum3;

                r_ALT41 = Convert.ToDouble(comboBox71.SelectedItem) /
r_sum4;
                r_ALT42 = Convert.ToDouble(comboBox70.SelectedItem) /
r_sum4;
                r_ALT43 = Convert.ToDouble(comboBox69.SelectedItem) /
r_sum4;
                r_ALT44 = Convert.ToDouble(textBox153.Text) / r_sum4;
                r_ALT45 = Convert.ToDouble(textBox144.Text) / r_sum4;

                r_ALT51 = Convert.ToDouble(comboBox68.SelectedItem) /
r_sum5;
                r_ALT52 = Convert.ToDouble(comboBox67.SelectedItem) /
r_sum5;
                r_ALT53 = Convert.ToDouble(comboBox66.SelectedItem) /
r_sum5;
                r_ALT54 = Convert.ToDouble(comboBox65.SelectedItem) /
r_sum5;
                r_ALT55 = Convert.ToDouble(textBox143.Text) / r_sum5;

                r_avarage1 = (r_ALT11 + r_ALT21 + r_ALT31 + r_ALT41 +
r_ALT51) / 5;
                r_avarage2 = (r_ALT12 + r_ALT22 + r_ALT32 + r_ALT42 +
r_ALT52) / 5;


                                          - 91 -
                r_avarage3 = (r_ALT13 + r_ALT23 + r_ALT33 + r_ALT43 +
r_ALT53) / 5;
                r_avarage4 = (r_ALT14 + r_ALT24 + r_ALT34 + r_ALT44 +
r_ALT54) / 5;
                r_avarage5 = (r_ALT15 + r_ALT25 + r_ALT35 + r_ALT45 +
r_ALT55) / 5;

             r_tsum = r_avarage1 + r_avarage2 + r_avarage3 +
r_avarage4 + r_avarage5;

             r_wsum1 = (Convert.ToDouble(textBox162.Text) *
r_avarage1) + (Convert.ToDouble(comboBox74.SelectedItem) * r_avarage2)
+ (Convert.ToDouble(comboBox73.SelectedItem) * r_avarage3) +
(Convert.ToDouble(comboBox71.SelectedItem) * r_avarage4) +
(Convert.ToDouble(comboBox68.SelectedItem) * r_avarage5);
             r_wsum2 = (Convert.ToDouble(textBox161.Text) *
r_avarage1) + (Convert.ToDouble(textBox156.Text) * r_avarage2) +
(Convert.ToDouble(comboBox72.SelectedItem) * r_avarage3) +
(Convert.ToDouble(comboBox70.SelectedItem) * r_avarage4) +
(Convert.ToDouble(comboBox67.SelectedItem) * r_avarage5);
             r_wsum3 = (Convert.ToDouble(textBox160.Text) *
r_avarage1) + (Convert.ToDouble(textBox157.Text) * r_avarage2) +
(Convert.ToDouble(textBox154.Text) * r_avarage3) +
(Convert.ToDouble(comboBox69.SelectedItem) * r_avarage4) +
(Convert.ToDouble(comboBox66.SelectedItem) * r_avarage5);
             r_wsum4 = (Convert.ToDouble(textBox159.Text) *
r_avarage1) + (Convert.ToDouble(textBox158.Text) * r_avarage2) +
(Convert.ToDouble(textBox155.Text) * r_avarage3) +
(Convert.ToDouble(textBox153.Text) * r_avarage4) +
(Convert.ToDouble(comboBox65.SelectedItem) * r_avarage5);
             r_wsum5 = (Convert.ToDouble(textBox147.Text) *
r_avarage1) + (Convert.ToDouble(textBox146.Text) * r_avarage2) +
(Convert.ToDouble(textBox145.Text) * r_avarage3) +
(Convert.ToDouble(textBox144.Text) * r_avarage4) +
(Convert.ToDouble(textBox143.Text) * r_avarage5);


                r_div1   =   r_wsum1   /   r_avarage1;
                r_div2   =   r_wsum2   /   r_avarage2;
                r_div3   =   r_wsum3   /   r_avarage3;
                r_div4   =   r_wsum4   /   r_avarage4;
                r_div5   =   r_wsum5   /   r_avarage5;

                r_lamda = (r_div1 + r_div2 + r_div3 + r_div4 + r_div5) /
5;
                r_CI = (r_lamda - 5) / (5 - 1);
                r_CR = (r_CI / 1.12);


            textBox152.Text       =    Convert.ToString(r_avarage1);
            textBox151.Text       =    Convert.ToString(r_avarage2);
            textBox150.Text       =    Convert.ToString(r_avarage3);
            textBox149.Text       =    Convert.ToString(r_avarage4);
            textBox148.Text       =    Convert.ToString(r_avarage5);


            button37.Enabled = true;

            if (r_CR > 0.1)
            {



                                              - 92 -
                 MessageBox.Show("Inconsistency, Please change entered
numbers");
                 textBox161.Clear();

                 textBox160.Clear();
                 textBox159.Clear();
                 textBox147.Clear();

                 textBox157.Clear();
                 textBox158.Clear();
                 textBox146.Clear();

                 textBox155.Clear();
                 textBox145.Clear();
                 textBox144.Clear();

                 textBox46.Clear();
                 textBox45.Clear();
                 textBox44.Clear();
                 textBox43.Clear();
                 textBox50.Clear();

                 textBox152.Clear();
                 textBox151.Clear();
                 textBox150.Clear();
                 textBox149.Clear();
                 textBox148.Clear();

                 button37.Enabled = false;

             }
        }

        private void button38_Click(object sender, EventArgs e) //
radiator clear
        {
                textBox161.Clear();

                 textBox160.Clear();
                 textBox159.Clear();
                 textBox147.Clear();

                 textBox157.Clear();
                 textBox158.Clear();
                 textBox146.Clear();

                 textBox155.Clear();
                 textBox145.Clear();
                 textBox144.Clear();

                 textBox46.Clear();
                 textBox45.Clear();
                 textBox44.Clear();
                 textBox43.Clear();
                 textBox50.Clear();

                 textBox152.Clear();
                 textBox151.Clear();
                 textBox150.Clear();
                 textBox149.Clear();
                 textBox148.Clear();


                                       - 93 -
                 button37.Enabled = false;
          }

        private void button43_Click(object sender, EventArgs e) //
natural gas calculate
        {
            textBox180.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox83.SelectedItem))));
            textBox177.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox82.SelectedItem))));
            textBox178.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox80.SelectedItem))));
            textBox179.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox81.SelectedItem))));
            textBox175.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox79.SelectedItem))));
            textBox181.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox84.SelectedItem))));
            textBox167.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox78.SelectedItem))));
            textBox166.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox77.SelectedItem))));
            textBox165.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox76.SelectedItem))));
            textBox164.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox75.SelectedItem))));

             n_sum1 = Convert.ToDouble(textBox182.Text) +
Convert.ToDouble(textBox181.Text) + Convert.ToDouble(textBox180.Text)
+ Convert.ToDouble(textBox179.Text) +
Convert.ToDouble(textBox167.Text);
             n_sum2 = Convert.ToDouble(textBox166.Text) +
Convert.ToDouble(textBox178.Text) + Convert.ToDouble(textBox177.Text)
+ Convert.ToDouble(comboBox84.SelectedItem) +
Convert.ToDouble(textBox176.Text);
             n_sum3 = Convert.ToDouble(textBox165.Text) +
Convert.ToDouble(textBox175.Text) +
Convert.ToDouble(comboBox82.SelectedItem) +
Convert.ToDouble(comboBox83.SelectedItem) +
Convert.ToDouble(textBox174.Text);
             n_sum4 = Convert.ToDouble(textBox164.Text) +
Convert.ToDouble(comboBox80.SelectedItem) +
Convert.ToDouble(comboBox79.SelectedItem) +
Convert.ToDouble(comboBox81.SelectedItem) +
Convert.ToDouble(textBox173.Text);
             n_sum5 = Convert.ToDouble(textBox163.Text) +
Convert.ToDouble(comboBox78.SelectedItem) +
Convert.ToDouble(comboBox77.SelectedItem) +
Convert.ToDouble(comboBox76.SelectedItem) +
Convert.ToDouble(comboBox75.SelectedItem);


              n_ALT11   =   Convert.ToDouble(textBox182.Text)   /   n_sum1;
              n_ALT12   =   Convert.ToDouble(textBox181.Text)   /   n_sum1;
              n_ALT13   =   Convert.ToDouble(textBox180.Text)   /   n_sum1;
              n_ALT14   =   Convert.ToDouble(textBox179.Text)   /   n_sum1;
              n_ALT15   =   Convert.ToDouble(textBox167.Text)   /   n_sum1;

              n_ALT21 = Convert.ToDouble(comboBox84.SelectedItem) /
n_sum2;


                                        - 94 -
                n_ALT22   =   Convert.ToDouble(textBox176.Text)   /   n_sum2;
                n_ALT23   =   Convert.ToDouble(textBox177.Text)   /   n_sum2;
                n_ALT24   =   Convert.ToDouble(textBox178.Text)   /   n_sum2;
                n_ALT25   =   Convert.ToDouble(textBox166.Text)   /   n_sum2;

                n_ALT31 = Convert.ToDouble(comboBox83.SelectedItem) /
n_sum3;
                n_ALT32 = Convert.ToDouble(comboBox82.SelectedItem) /
n_sum3;
                n_ALT33 = Convert.ToDouble(textBox174.Text) / n_sum3;
                n_ALT34 = Convert.ToDouble(textBox175.Text) / n_sum3;
                n_ALT35 = Convert.ToDouble(textBox165.Text) / n_sum3;

                n_ALT41 = Convert.ToDouble(comboBox81.SelectedItem) /
n_sum4;
                n_ALT42 = Convert.ToDouble(comboBox80.SelectedItem) /
n_sum4;
                n_ALT43 = Convert.ToDouble(comboBox79.SelectedItem) /
n_sum4;
                n_ALT44 = Convert.ToDouble(textBox173.Text) / n_sum4;
                n_ALT45 = Convert.ToDouble(textBox164.Text) / n_sum4;

                n_ALT51 = Convert.ToDouble(comboBox78.SelectedItem) /
n_sum5;
                n_ALT52 = Convert.ToDouble(comboBox77.SelectedItem) /
n_sum5;
                n_ALT53 = Convert.ToDouble(comboBox76.SelectedItem) /
n_sum5;
                n_ALT54 = Convert.ToDouble(comboBox75.SelectedItem) /
n_sum5;
                n_ALT55 = Convert.ToDouble(textBox163.Text) / n_sum5;

                n_avarage1 = (n_ALT11 + n_ALT21 + n_ALT31 + n_ALT41 +
n_ALT51) / 5;
                n_avarage2 = (n_ALT12 + n_ALT22 + n_ALT32 + n_ALT42 +
n_ALT52) / 5;
                n_avarage3 = (n_ALT13 + n_ALT23 + n_ALT33 + n_ALT43 +
n_ALT53) / 5;
                n_avarage4 = (n_ALT14 + n_ALT24 + n_ALT34 + n_ALT44 +
n_ALT54) / 5;
                n_avarage5 = (n_ALT15 + n_ALT25 + n_ALT35 + n_ALT45 +
n_ALT55) / 5;

             n_tsum = n_avarage1 + n_avarage2 + n_avarage3 +
n_avarage4 + n_avarage5;

             n_wsum1 = (Convert.ToDouble(textBox182.Text) *
n_avarage1) + (Convert.ToDouble(comboBox84.SelectedItem) * n_avarage2)
+ (Convert.ToDouble(comboBox83.SelectedItem) * n_avarage3) +
(Convert.ToDouble(comboBox81.SelectedItem) * n_avarage4) +
(Convert.ToDouble(comboBox78.SelectedItem) * n_avarage5);
             n_wsum2 = (Convert.ToDouble(textBox181.Text) *
n_avarage1) + (Convert.ToDouble(textBox176.Text) * n_avarage2) +
(Convert.ToDouble(comboBox82.SelectedItem) * n_avarage3) +
(Convert.ToDouble(comboBox80.SelectedItem) * n_avarage4) +
(Convert.ToDouble(comboBox77.SelectedItem) * n_avarage5);
             n_wsum3 = (Convert.ToDouble(textBox180.Text) *
n_avarage1) + (Convert.ToDouble(textBox177.Text) * n_avarage2) +
(Convert.ToDouble(textBox174.Text) * n_avarage3) +
(Convert.ToDouble(comboBox79.SelectedItem) * n_avarage4) +
(Convert.ToDouble(comboBox76.SelectedItem) * n_avarage5);


                                          - 95 -
             n_wsum4 = (Convert.ToDouble(textBox179.Text) *
n_avarage1) + (Convert.ToDouble(textBox178.Text) * n_avarage2) +
(Convert.ToDouble(textBox175.Text) * n_avarage3) +
(Convert.ToDouble(textBox173.Text) * n_avarage4) +
(Convert.ToDouble(comboBox75.SelectedItem) * n_avarage5);
             n_wsum5 = (Convert.ToDouble(textBox167.Text) *
n_avarage1) + (Convert.ToDouble(textBox166.Text) * n_avarage2) +
(Convert.ToDouble(textBox165.Text) * n_avarage3) +
(Convert.ToDouble(textBox164.Text) * n_avarage4) +
(Convert.ToDouble(textBox163.Text) * n_avarage5);


              n_div1   =   n_wsum1   /   n_avarage1;
              n_div2   =   n_wsum2   /   n_avarage2;
              n_div3   =   n_wsum3   /   n_avarage3;
              n_div4   =   n_wsum4   /   n_avarage4;
              n_div5   =   n_wsum5   /   n_avarage5;

              n_lamda = (n_div1 + n_div2 + n_div3 + n_div4 + n_div5) /
5;
              n_CI = (n_lamda - 5) / (5 - 1);
              n_CR = (n_CI / 1.12);


             textBox172.Text    =    Convert.ToString(n_avarage1);
             textBox171.Text    =    Convert.ToString(n_avarage2);
             textBox170.Text    =    Convert.ToString(n_avarage3);
             textBox169.Text    =    Convert.ToString(n_avarage4);
             textBox168.Text    =    Convert.ToString(n_avarage5);

             button41.Enabled = true;

             if (n_CR > 0.1)
             {

                 MessageBox.Show("Inconsistency, Please change entered
numbers");
                 textBox181.Clear();

                 textBox180.Clear();
                 textBox179.Clear();
                 textBox167.Clear();

                 textBox177.Clear();
                 textBox178.Clear();
                 textBox166.Clear();

                 textBox175.Clear();
                 textBox165.Clear();
                 textBox164.Clear();

                 textBox46.Clear();
                 textBox45.Clear();
                 textBox44.Clear();
                 textBox43.Clear();
                 textBox50.Clear();

                 textBox172.Clear();
                 textBox171.Clear();
                 textBox170.Clear();
                 textBox169.Clear();


                                            - 96 -
                  textBox168.Clear();

                  button41.Enabled = false;

           }
       }

        private void button47_Click(object sender, EventArgs e) //
combi calculation
        {
            textBox200.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox93.SelectedItem))));
            textBox197.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox92.SelectedItem))));
            textBox198.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox90.SelectedItem))));
            textBox199.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox91.SelectedItem))));
            textBox195.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox89.SelectedItem))));
            textBox201.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox94.SelectedItem))));
            textBox187.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox88.SelectedItem))));
            textBox186.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox87.SelectedItem))));
            textBox185.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox86.SelectedItem))));
            textBox184.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox85.SelectedItem))));

             co_sum1 = Convert.ToDouble(textBox202.Text) +
Convert.ToDouble(textBox201.Text) + Convert.ToDouble(textBox200.Text)
+ Convert.ToDouble(textBox199.Text) +
Convert.ToDouble(textBox187.Text);
             co_sum2 = Convert.ToDouble(textBox186.Text) +
Convert.ToDouble(textBox198.Text) + Convert.ToDouble(textBox197.Text)
+ Convert.ToDouble(comboBox94.SelectedItem) +
Convert.ToDouble(textBox196.Text);
             co_sum3 = Convert.ToDouble(textBox185.Text) +
Convert.ToDouble(textBox195.Text) +
Convert.ToDouble(comboBox92.SelectedItem) +
Convert.ToDouble(comboBox93.SelectedItem) +
Convert.ToDouble(textBox194.Text);
             co_sum4 = Convert.ToDouble(textBox184.Text) +
Convert.ToDouble(comboBox90.SelectedItem) +
Convert.ToDouble(comboBox89.SelectedItem) +
Convert.ToDouble(comboBox91.SelectedItem) +
Convert.ToDouble(textBox193.Text);
             co_sum5 = Convert.ToDouble(textBox183.Text) +
Convert.ToDouble(comboBox88.SelectedItem) +
Convert.ToDouble(comboBox87.SelectedItem) +
Convert.ToDouble(comboBox86.SelectedItem) +
Convert.ToDouble(comboBox85.SelectedItem);


               co_ALT11   =   Convert.ToDouble(textBox202.Text)   /   co_sum1;
               co_ALT12   =   Convert.ToDouble(textBox201.Text)   /   co_sum1;
               co_ALT13   =   Convert.ToDouble(textBox200.Text)   /   co_sum1;
               co_ALT14   =   Convert.ToDouble(textBox199.Text)   /   co_sum1;
               co_ALT15   =   Convert.ToDouble(textBox187.Text)   /   co_sum1;


                                         - 97 -
             co_ALT21 = Convert.ToDouble(comboBox94.SelectedItem) /
co_sum2;
             co_ALT22   =   Convert.ToDouble(textBox196.Text)   /   co_sum2;
             co_ALT23   =   Convert.ToDouble(textBox197.Text)   /   co_sum2;
             co_ALT24   =   Convert.ToDouble(textBox198.Text)   /   co_sum2;
             co_ALT25   =   Convert.ToDouble(textBox186.Text)   /   co_sum2;

             co_ALT31 = Convert.ToDouble(comboBox93.SelectedItem) /
co_sum3;
             co_ALT32 = Convert.ToDouble(comboBox92.SelectedItem) /
co_sum3;
             co_ALT33 = Convert.ToDouble(textBox194.Text) / co_sum3;
             co_ALT34 = Convert.ToDouble(textBox195.Text) / co_sum3;
             co_ALT35 = Convert.ToDouble(textBox185.Text) / co_sum3;

             co_ALT41 = Convert.ToDouble(comboBox91.SelectedItem) /
co_sum4;
             co_ALT42 = Convert.ToDouble(comboBox90.SelectedItem) /
co_sum4;
             co_ALT43 = Convert.ToDouble(comboBox89.SelectedItem) /
co_sum4;
             co_ALT44 = Convert.ToDouble(textBox193.Text) / co_sum4;
             co_ALT45 = Convert.ToDouble(textBox184.Text) / co_sum4;

             co_ALT51 = Convert.ToDouble(comboBox88.SelectedItem) /
co_sum5;
             co_ALT52 = Convert.ToDouble(comboBox87.SelectedItem) /
co_sum5;
             co_ALT53 = Convert.ToDouble(comboBox86.SelectedItem) /
co_sum5;
             co_ALT54 = Convert.ToDouble(comboBox85.SelectedItem) /
co_sum5;
             co_ALT55 = Convert.ToDouble(textBox183.Text) / co_sum5;

             co_avarage1     = (co_ALT11 + co_ALT21 + co_ALT31 + co_ALT41
+ co_ALT51) / 5;
             co_avarage2     = (co_ALT12 + co_ALT22 + co_ALT32 + co_ALT42
+ co_ALT52) / 5;
             co_avarage3     = (co_ALT13 + co_ALT23 + co_ALT33 + co_ALT43
+ co_ALT53) / 5;
             co_avarage4     = (co_ALT14 + co_ALT24 + co_ALT34 + co_ALT44
+ co_ALT54) / 5;
             co_avarage5     = (co_ALT15 + co_ALT25 + co_ALT35 + co_ALT45
+ co_ALT55) / 5;

             co_tsum = co_avarage1 + co_avarage2 + co_avarage3 +
co_avarage4 + co_avarage5;

              co_wsum1 = (Convert.ToDouble(textBox202.Text) *
co_avarage1) + (Convert.ToDouble(comboBox94.SelectedItem) *
co_avarage2) + (Convert.ToDouble(comboBox93.SelectedItem) *
co_avarage3) + (Convert.ToDouble(comboBox91.SelectedItem) *
co_avarage4) + (Convert.ToDouble(comboBox88.SelectedItem) *
co_avarage5);
              co_wsum2 = (Convert.ToDouble(textBox201.Text) *
co_avarage1) + (Convert.ToDouble(textBox196.Text) * co_avarage2) +
(Convert.ToDouble(comboBox92.SelectedItem) * co_avarage3) +
(Convert.ToDouble(comboBox90.SelectedItem) * co_avarage4) +
(Convert.ToDouble(comboBox87.SelectedItem) * co_avarage5);



                                       - 98 -
             co_wsum3 = (Convert.ToDouble(textBox200.Text) *
co_avarage1) + (Convert.ToDouble(textBox197.Text) * co_avarage2) +
(Convert.ToDouble(textBox194.Text) * co_avarage3) +
(Convert.ToDouble(comboBox89.SelectedItem) * co_avarage4) +
(Convert.ToDouble(comboBox86.SelectedItem) * co_avarage5);
             co_wsum4 = (Convert.ToDouble(textBox199.Text) *
co_avarage1) + (Convert.ToDouble(textBox198.Text) * co_avarage2) +
(Convert.ToDouble(textBox195.Text) * co_avarage3) +
(Convert.ToDouble(textBox173.Text) * co_avarage4) +
(Convert.ToDouble(comboBox85.SelectedItem) * co_avarage5);
             co_wsum5 = (Convert.ToDouble(textBox187.Text) *
co_avarage1) + (Convert.ToDouble(textBox186.Text) * co_avarage2) +
(Convert.ToDouble(textBox185.Text) * co_avarage3) +
(Convert.ToDouble(textBox184.Text) * co_avarage4) +
(Convert.ToDouble(textBox183.Text) * co_avarage5);


                co_div1   =   co_wsum1   /   co_avarage1;
                co_div2   =   co_wsum2   /   co_avarage2;
                co_div3   =   co_wsum3   /   co_avarage3;
                co_div4   =   co_wsum4   /   co_avarage4;
                co_div5   =   co_wsum5   /   co_avarage5;

                co_lamda = (co_div1 + co_div2 + co_div3 + co_div4 +
co_div5) / 5;
                co_CI = (co_lamda - 5) / (5 - 1);
                co_CR = (co_CI / 1.12);


             textBox192.Text      =   Convert.ToString(co_avarage1);
             textBox191.Text      =   Convert.ToString(co_avarage2);
             textBox190.Text      =   Convert.ToString(co_avarage3);
             textBox189.Text      =   Convert.ToString(co_avarage4);
             textBox188.Text      =   Convert.ToString(co_avarage5);


             button45.Enabled = true;

             if (co_CR > 0.1)
             {

                   MessageBox.Show("Inconsistency, Please change entered
numbers");
                   textBox201.Clear();

                   textBox200.Clear();
                   textBox199.Clear();
                   textBox187.Clear();

                   textBox197.Clear();
                   textBox198.Clear();
                   textBox186.Clear();

                   textBox195.Clear();
                   textBox185.Clear();
                   textBox184.Clear();

                   textBox46.Clear();
                   textBox45.Clear();
                   textBox44.Clear();
                   textBox43.Clear();


                                              - 99 -
                textBox50.Clear();

                textBox192.Clear();
                textBox191.Clear();
                textBox190.Clear();
                textBox189.Clear();
                textBox188.Clear();

                button45.Enabled = false;

           }
       }

        private void button46_Click(object sender, EventArgs e) //
combi clear
        {
            textBox201.Clear();

           textBox200.Clear();
           textBox199.Clear();
           textBox187.Clear();

           textBox197.Clear();
           textBox198.Clear();
           textBox186.Clear();

           textBox195.Clear();
           textBox185.Clear();
           textBox184.Clear();

           textBox46.Clear();
           textBox45.Clear();
           textBox44.Clear();
           textBox43.Clear();
           textBox50.Clear();

           textBox192.Clear();
           textBox191.Clear();
           textBox190.Clear();
           textBox189.Clear();
           textBox188.Clear();

           button45.Enabled = false;
       }

        private void button51_Click(object sender, EventArgs e) //
central heating calculate
        {
            textBox220.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox103.SelectedItem))));
            textBox217.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox102.SelectedItem))));
            textBox218.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox100.SelectedItem))));
            textBox219.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox101.SelectedItem))));
            textBox215.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox99.SelectedItem))));
            textBox221.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox104.SelectedItem))));



                                      - 100 -
            textBox207.Text = Convert.ToString((1     /
(Convert.ToDouble(comboBox98.SelectedItem))));
            textBox206.Text = Convert.ToString((1     /
(Convert.ToDouble(comboBox97.SelectedItem))));
            textBox205.Text = Convert.ToString((1     /
(Convert.ToDouble(comboBox96.SelectedItem))));
            textBox204.Text = Convert.ToString((1     /
(Convert.ToDouble(comboBox95.SelectedItem))));

             ch_sum1 = Convert.ToDouble(textBox222.Text) +
Convert.ToDouble(textBox221.Text) + Convert.ToDouble(textBox220.Text)
+ Convert.ToDouble(textBox219.Text) +
Convert.ToDouble(textBox207.Text);
             ch_sum2 = Convert.ToDouble(textBox206.Text) +
Convert.ToDouble(textBox218.Text) + Convert.ToDouble(textBox217.Text)
+ Convert.ToDouble(comboBox104.SelectedItem) +
Convert.ToDouble(textBox216.Text);
             ch_sum3 = Convert.ToDouble(textBox205.Text) +
Convert.ToDouble(textBox215.Text) +
Convert.ToDouble(comboBox102.SelectedItem) +
Convert.ToDouble(comboBox103.SelectedItem) +
Convert.ToDouble(textBox214.Text);
             ch_sum4 = Convert.ToDouble(textBox204.Text) +
Convert.ToDouble(comboBox100.SelectedItem) +
Convert.ToDouble(comboBox99.SelectedItem) +
Convert.ToDouble(comboBox101.SelectedItem) +
Convert.ToDouble(textBox213.Text);
             ch_sum5 = Convert.ToDouble(textBox203.Text) +
Convert.ToDouble(comboBox98.SelectedItem) +
Convert.ToDouble(comboBox97.SelectedItem) +
Convert.ToDouble(comboBox96.SelectedItem) +
Convert.ToDouble(comboBox95.SelectedItem);


             ch_ALT11   =   Convert.ToDouble(textBox222.Text)   /   ch_sum1;
             ch_ALT12   =   Convert.ToDouble(textBox221.Text)   /   ch_sum1;
             ch_ALT13   =   Convert.ToDouble(textBox220.Text)   /   ch_sum1;
             ch_ALT14   =   Convert.ToDouble(textBox219.Text)   /   ch_sum1;
             ch_ALT15   =   Convert.ToDouble(textBox207.Text)   /   ch_sum1;

             ch_ALT21 = Convert.ToDouble(comboBox104.SelectedItem) /
ch_sum2;
             ch_ALT22   =   Convert.ToDouble(textBox216.Text)   /   ch_sum2;
             ch_ALT23   =   Convert.ToDouble(textBox217.Text)   /   ch_sum2;
             ch_ALT24   =   Convert.ToDouble(textBox218.Text)   /   ch_sum2;
             ch_ALT25   =   Convert.ToDouble(textBox206.Text)   /   ch_sum2;

             ch_ALT31 = Convert.ToDouble(comboBox103.SelectedItem) /
ch_sum3;
             ch_ALT32 = Convert.ToDouble(comboBox102.SelectedItem) /
ch_sum3;
             ch_ALT33 = Convert.ToDouble(textBox214.Text) / ch_sum3;
             ch_ALT34 = Convert.ToDouble(textBox215.Text) / ch_sum3;
             ch_ALT35 = Convert.ToDouble(textBox205.Text) / ch_sum3;

             ch_ALT41 = Convert.ToDouble(comboBox101.SelectedItem) /
ch_sum4;
             ch_ALT42 = Convert.ToDouble(comboBox100.SelectedItem) /
ch_sum4;
             ch_ALT43 = Convert.ToDouble(comboBox99.SelectedItem) /
ch_sum4;


                                       - 101 -
             ch_ALT44 = Convert.ToDouble(textBox213.Text) / ch_sum4;
             ch_ALT45 = Convert.ToDouble(textBox204.Text) / ch_sum4;

             ch_ALT51 = Convert.ToDouble(comboBox98.SelectedItem) /
ch_sum5;
             ch_ALT52 = Convert.ToDouble(comboBox97.SelectedItem) /
ch_sum5;
             ch_ALT53 = Convert.ToDouble(comboBox96.SelectedItem) /
ch_sum5;
             ch_ALT54 = Convert.ToDouble(comboBox95.SelectedItem) /
ch_sum5;
             ch_ALT55 = Convert.ToDouble(textBox203.Text) / ch_sum5;

             ch_avarage1     = (ch_ALT11 + ch_ALT21 + ch_ALT31 + ch_ALT41
+ ch_ALT51) / 5;
             ch_avarage2     = (ch_ALT12 + ch_ALT22 + ch_ALT32 + ch_ALT42
+ ch_ALT52) / 5;
             ch_avarage3     = (ch_ALT13 + ch_ALT23 + ch_ALT33 + ch_ALT43
+ ch_ALT53) / 5;
             ch_avarage4     = (ch_ALT14 + ch_ALT24 + ch_ALT34 + ch_ALT44
+ ch_ALT54) / 5;
             ch_avarage5     = (ch_ALT15 + ch_ALT25 + ch_ALT35 + ch_ALT45
+ ch_ALT55) / 5;

             ch_tsum = ch_avarage1 + ch_avarage2 + ch_avarage3 +
ch_avarage4 + ch_avarage5;

              ch_wsum1 = (Convert.ToDouble(textBox222.Text) *
ch_avarage1) + (Convert.ToDouble(comboBox104.SelectedItem) *
ch_avarage2) + (Convert.ToDouble(comboBox103.SelectedItem) *
ch_avarage3) + (Convert.ToDouble(comboBox101.SelectedItem) *
ch_avarage4) + (Convert.ToDouble(comboBox98.SelectedItem) *
ch_avarage5);
              ch_wsum2 = (Convert.ToDouble(textBox221.Text) *
ch_avarage1) + (Convert.ToDouble(textBox216.Text) * ch_avarage2)     +
(Convert.ToDouble(comboBox102.SelectedItem) * ch_avarage3) +
(Convert.ToDouble(comboBox100.SelectedItem) * ch_avarage4) +
(Convert.ToDouble(comboBox97.SelectedItem) * ch_avarage5);
              ch_wsum3 = (Convert.ToDouble(textBox220.Text) *
ch_avarage1) + (Convert.ToDouble(textBox217.Text) * ch_avarage2)     +
(Convert.ToDouble(textBox214.Text) * ch_avarage3) +
(Convert.ToDouble(comboBox99.SelectedItem) * ch_avarage4) +
(Convert.ToDouble(comboBox96.SelectedItem) * ch_avarage5);
              ch_wsum4 = (Convert.ToDouble(textBox219.Text) *
ch_avarage1) + (Convert.ToDouble(textBox218.Text) * ch_avarage2)     +
(Convert.ToDouble(textBox215.Text) * ch_avarage3) +
(Convert.ToDouble(textBox173.Text) * ch_avarage4) +
(Convert.ToDouble(comboBox95.SelectedItem) * ch_avarage5);
              ch_wsum5 = (Convert.ToDouble(textBox207.Text) *
ch_avarage1) + (Convert.ToDouble(textBox206.Text) * ch_avarage2)     +
(Convert.ToDouble(textBox205.Text) * ch_avarage3) +
(Convert.ToDouble(textBox204.Text) * ch_avarage4) +
(Convert.ToDouble(textBox203.Text) * ch_avarage5);


             ch_div1   =   ch_wsum1   /   ch_avarage1;
             ch_div2   =   ch_wsum2   /   ch_avarage2;
             ch_div3   =   ch_wsum3   /   ch_avarage3;
             ch_div4   =   ch_wsum4   /   ch_avarage4;
             ch_div5   =   ch_wsum5   /   ch_avarage5;



                                           - 102 -
                 ch_lamda = (ch_div1 + ch_div2 + ch_div3 + ch_div4 +
ch_div5) / 5;
                 ch_CI = (ch_lamda - 5) / (5 - 1);
                 ch_CR = (ch_CI / 1.12);


             textBox212.Text   =   Convert.ToString(ch_avarage1);
             textBox211.Text   =   Convert.ToString(ch_avarage2);
             textBox210.Text   =   Convert.ToString(ch_avarage3);
             textBox209.Text   =   Convert.ToString(ch_avarage4);
             textBox208.Text   =   Convert.ToString(ch_avarage5);


             button49.Enabled = true;

             if (ch_CR > 0.1)
             {

                    MessageBox.Show("Inconsistency, Please change entered
numbers");
                    textBox221.Clear();

                    textBox220.Clear();
                    textBox219.Clear();
                    textBox207.Clear();

                    textBox217.Clear();
                    textBox218.Clear();
                    textBox206.Clear();

                    textBox215.Clear();
                    textBox205.Clear();
                    textBox204.Clear();

                    textBox46.Clear();
                    textBox45.Clear();
                    textBox44.Clear();
                    textBox43.Clear();
                    textBox50.Clear();

                    textBox212.Clear();
                    textBox211.Clear();
                    textBox210.Clear();
                    textBox209.Clear();
                    textBox208.Clear();

                    button49.Enabled = false;

             }
        }

        private void button50_Click(object sender, EventArgs e) //
central heating clear
        {
            textBox221.Clear();

             textBox220.Clear();
             textBox219.Clear();
             textBox207.Clear();

             textBox217.Clear();


                                          - 103 -
           textBox218.Clear();
           textBox206.Clear();

           textBox215.Clear();
           textBox205.Clear();
           textBox204.Clear();

           textBox46.Clear();
           textBox45.Clear();
           textBox44.Clear();
           textBox43.Clear();
           textBox50.Clear();

           textBox212.Clear();
           textBox211.Clear();
           textBox210.Clear();
           textBox209.Clear();
           textBox208.Clear();

           button49.Enabled = false;
       }

        private void button55_Click(object sender, EventArgs e) //
security calculation
        {
            textBox240.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox113.SelectedItem))));
            textBox237.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox112.SelectedItem))));
            textBox238.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox110.SelectedItem))));
            textBox239.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox111.SelectedItem))));
            textBox235.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox109.SelectedItem))));
            textBox241.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox114.SelectedItem))));
            textBox227.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox108.SelectedItem))));
            textBox226.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox107.SelectedItem))));
            textBox225.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox106.SelectedItem))));
            textBox224.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox105.SelectedItem))));

             se_sum1 = Convert.ToDouble(textBox242.Text) +
Convert.ToDouble(textBox241.Text) + Convert.ToDouble(textBox240.Text)
+ Convert.ToDouble(textBox239.Text) +
Convert.ToDouble(textBox227.Text);
             se_sum2 = Convert.ToDouble(textBox226.Text) +
Convert.ToDouble(textBox238.Text) + Convert.ToDouble(textBox237.Text)
+ Convert.ToDouble(comboBox114.SelectedItem) +
Convert.ToDouble(textBox236.Text);
             se_sum3 = Convert.ToDouble(textBox225.Text) +
Convert.ToDouble(textBox235.Text) +
Convert.ToDouble(comboBox112.SelectedItem) +
Convert.ToDouble(comboBox113.SelectedItem) +
Convert.ToDouble(textBox234.Text);
             se_sum4 = Convert.ToDouble(textBox224.Text) +
Convert.ToDouble(comboBox110.SelectedItem) +


                                   - 104 -
Convert.ToDouble(comboBox109.SelectedItem) +
Convert.ToDouble(comboBox111.SelectedItem) +
Convert.ToDouble(textBox233.Text);
             se_sum5 = Convert.ToDouble(textBox223.Text) +
Convert.ToDouble(comboBox108.SelectedItem) +
Convert.ToDouble(comboBox107.SelectedItem) +
Convert.ToDouble(comboBox106.SelectedItem) +
Convert.ToDouble(comboBox105.SelectedItem);


             se_ALT11   =   Convert.ToDouble(textBox242.Text)   /   se_sum1;
             se_ALT12   =   Convert.ToDouble(textBox241.Text)   /   se_sum1;
             se_ALT13   =   Convert.ToDouble(textBox240.Text)   /   se_sum1;
             se_ALT14   =   Convert.ToDouble(textBox239.Text)   /   se_sum1;
             se_ALT15   =   Convert.ToDouble(textBox227.Text)   /   se_sum1;

             se_ALT21 = Convert.ToDouble(comboBox114.SelectedItem) /
se_sum2;
             se_ALT22   =   Convert.ToDouble(textBox236.Text)   /   se_sum2;
             se_ALT23   =   Convert.ToDouble(textBox237.Text)   /   se_sum2;
             se_ALT24   =   Convert.ToDouble(textBox238.Text)   /   se_sum2;
             se_ALT25   =   Convert.ToDouble(textBox226.Text)   /   se_sum2;

             se_ALT31 = Convert.ToDouble(comboBox113.SelectedItem) /
se_sum3;
             se_ALT32 = Convert.ToDouble(comboBox112.SelectedItem) /
se_sum3;
             se_ALT33 = Convert.ToDouble(textBox234.Text) / se_sum3;
             se_ALT34 = Convert.ToDouble(textBox235.Text) / se_sum3;
             se_ALT35 = Convert.ToDouble(textBox225.Text) / se_sum3;

             se_ALT41 = Convert.ToDouble(comboBox111.SelectedItem) /
se_sum4;
             se_ALT42 = Convert.ToDouble(comboBox110.SelectedItem) /
se_sum4;
             se_ALT43 = Convert.ToDouble(comboBox109.SelectedItem) /
se_sum4;
             se_ALT44 = Convert.ToDouble(textBox233.Text) / se_sum4;
             se_ALT45 = Convert.ToDouble(textBox224.Text) / se_sum4;

             se_ALT51 = Convert.ToDouble(comboBox108.SelectedItem) /
se_sum5;
             se_ALT52 = Convert.ToDouble(comboBox107.SelectedItem) /
se_sum5;
             se_ALT53 = Convert.ToDouble(comboBox106.SelectedItem) /
se_sum5;
             se_ALT54 = Convert.ToDouble(comboBox105.SelectedItem) /
se_sum5;
             se_ALT55 = Convert.ToDouble(textBox223.Text) / se_sum5;

             se_avarage1     = (se_ALT11 + se_ALT21 + se_ALT31 + se_ALT41
+ se_ALT51) / 5;
             se_avarage2     = (se_ALT12 + se_ALT22 + se_ALT32 + se_ALT42
+ se_ALT52) / 5;
             se_avarage3     = (se_ALT13 + se_ALT23 + se_ALT33 + se_ALT43
+ se_ALT53) / 5;
             se_avarage4     = (se_ALT14 + se_ALT24 + se_ALT34 + se_ALT44
+ se_ALT54) / 5;
             se_avarage5     = (se_ALT15 + se_ALT25 + se_ALT35 + se_ALT45
+ se_ALT55) / 5;



                                       - 105 -
             se_tsum = se_avarage1 + se_avarage2 + se_avarage3 +
se_avarage4 + se_avarage5;

              se_wsum1 = (Convert.ToDouble(textBox242.Text) *
se_avarage1) + (Convert.ToDouble(comboBox114.SelectedItem) *
se_avarage2) + (Convert.ToDouble(comboBox113.SelectedItem) *
se_avarage3) + (Convert.ToDouble(comboBox111.SelectedItem) *
se_avarage4) + (Convert.ToDouble(comboBox108.SelectedItem) *
se_avarage5);
              se_wsum2 = (Convert.ToDouble(textBox241.Text) *
se_avarage1) + (Convert.ToDouble(textBox236.Text) * se_avarage2)       +
(Convert.ToDouble(comboBox112.SelectedItem) * se_avarage3) +
(Convert.ToDouble(comboBox110.SelectedItem) * se_avarage4) +
(Convert.ToDouble(comboBox107.SelectedItem) * se_avarage5);
              se_wsum3 = (Convert.ToDouble(textBox240.Text) *
se_avarage1) + (Convert.ToDouble(textBox237.Text) * se_avarage2)       +
(Convert.ToDouble(textBox234.Text) * se_avarage3) +
(Convert.ToDouble(comboBox109.SelectedItem) * se_avarage4) +
(Convert.ToDouble(comboBox106.SelectedItem) * se_avarage5);
              se_wsum4 = (Convert.ToDouble(textBox239.Text) *
se_avarage1) + (Convert.ToDouble(textBox238.Text) * se_avarage2)       +
(Convert.ToDouble(textBox235.Text) * se_avarage3) +
(Convert.ToDouble(textBox173.Text) * se_avarage4) +
(Convert.ToDouble(comboBox105.SelectedItem) * se_avarage5);
              se_wsum5 = (Convert.ToDouble(textBox227.Text) *
se_avarage1) + (Convert.ToDouble(textBox226.Text) * se_avarage2)       +
(Convert.ToDouble(textBox225.Text) * se_avarage3) +
(Convert.ToDouble(textBox224.Text) * se_avarage4) +
(Convert.ToDouble(textBox223.Text) * se_avarage5);


                se_div1   =   se_wsum1   /   se_avarage1;
                se_div2   =   se_wsum2   /   se_avarage2;
                se_div3   =   se_wsum3   /   se_avarage3;
                se_div4   =   se_wsum4   /   se_avarage4;
                se_div5   =   se_wsum5   /   se_avarage5;

                se_lamda = (se_div1 + se_div2 + se_div3 + se_div4 +
se_div5) / 5;
                se_CI = (se_lamda - 5) / (5 - 1);
                se_CR = (se_CI / 1.12);


             textBox232.Text      =   Convert.ToString(se_avarage1);
             textBox231.Text      =   Convert.ToString(se_avarage2);
             textBox230.Text      =   Convert.ToString(se_avarage3);
             textBox229.Text      =   Convert.ToString(se_avarage4);
             textBox228.Text      =   Convert.ToString(se_avarage5);


             button53.Enabled = true;

             if (se_CR > 0.1)
             {

                   MessageBox.Show("Inconsistency, Please change entered
numbers");
                   textBox241.Clear();

                   textBox240.Clear();
                   textBox239.Clear();


                                              - 106 -
                textBox227.Clear();

                textBox237.Clear();
                textBox238.Clear();
                textBox226.Clear();

                textBox235.Clear();
                textBox225.Clear();
                textBox224.Clear();

                textBox46.Clear();
                textBox45.Clear();
                textBox44.Clear();
                textBox43.Clear();
                textBox50.Clear();

                textBox232.Clear();
                textBox231.Clear();
                textBox230.Clear();
                textBox229.Clear();
                textBox228.Clear();

                button53.Enabled = false;

           }
       }

        private void button54_Click(object sender, EventArgs e) //
security clear
        {
            textBox241.Clear();

           textBox240.Clear();
           textBox239.Clear();
           textBox227.Clear();

           textBox237.Clear();
           textBox238.Clear();
           textBox226.Clear();

           textBox235.Clear();
           textBox225.Clear();
           textBox224.Clear();

           textBox46.Clear();
           textBox45.Clear();
           textBox44.Clear();
           textBox43.Clear();
           textBox50.Clear();

           textBox232.Clear();
           textBox231.Clear();
           textBox230.Clear();
           textBox229.Clear();
           textBox228.Clear();

           button53.Enabled = false;
       }

       private void tabPage17_Click(object sender, EventArgs e)
       {


                                      - 107 -
       }

       private void tabPage5_Click(object sender, EventArgs e)
       {

       }

        private void button59_Click(object sender, EventArgs e) //
insite calculate
        {
            textBox260.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox123.SelectedItem))));
            textBox257.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox122.SelectedItem))));
            textBox258.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox120.SelectedItem))));
            textBox259.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox121.SelectedItem))));
            textBox255.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox119.SelectedItem))));
            textBox261.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox124.SelectedItem))));
            textBox247.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox118.SelectedItem))));
            textBox246.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox117.SelectedItem))));
            textBox245.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox116.SelectedItem))));
            textBox244.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox115.SelectedItem))));

              i_sum1 = Convert.ToDouble(textBox262.Text) +
Convert.ToDouble(textBox261.Text) + Convert.ToDouble(textBox260.Text)
+ Convert.ToDouble(textBox259.Text) +
Convert.ToDouble(textBox247.Text);
              i_sum2 = Convert.ToDouble(textBox246.Text) +
Convert.ToDouble(textBox258.Text) + Convert.ToDouble(textBox257.Text)
+ Convert.ToDouble(comboBox124.SelectedItem) +
Convert.ToDouble(textBox256.Text);
              i_sum3 = Convert.ToDouble(textBox245.Text) +
Convert.ToDouble(textBox255.Text) +
Convert.ToDouble(comboBox122.SelectedItem) +
Convert.ToDouble(comboBox123.SelectedItem) +
Convert.ToDouble(textBox254.Text);
              i_sum4 = Convert.ToDouble(textBox244.Text) +
Convert.ToDouble(comboBox120.SelectedItem) +
Convert.ToDouble(comboBox119.SelectedItem) +
Convert.ToDouble(comboBox121.SelectedItem) +
Convert.ToDouble(textBox253.Text);
              i_sum5 = Convert.ToDouble(textBox243.Text) +
Convert.ToDouble(comboBox118.SelectedItem) +
Convert.ToDouble(comboBox117.SelectedItem) +
Convert.ToDouble(comboBox116.SelectedItem) +
Convert.ToDouble(comboBox115.SelectedItem);


              i_ALT11   =   Convert.ToDouble(textBox262.Text)   /   i_sum1;
              i_ALT12   =   Convert.ToDouble(textBox261.Text)   /   i_sum1;
              i_ALT13   =   Convert.ToDouble(textBox260.Text)   /   i_sum1;
              i_ALT14   =   Convert.ToDouble(textBox259.Text)   /   i_sum1;


                                       - 108 -
                i_ALT15 = Convert.ToDouble(textBox247.Text) / i_sum1;

                i_ALT21 = Convert.ToDouble(comboBox124.SelectedItem) /
i_sum2;
                i_ALT22   =   Convert.ToDouble(textBox256.Text)   /   i_sum2;
                i_ALT23   =   Convert.ToDouble(textBox257.Text)   /   i_sum2;
                i_ALT24   =   Convert.ToDouble(textBox258.Text)   /   i_sum2;
                i_ALT25   =   Convert.ToDouble(textBox246.Text)   /   i_sum2;

                i_ALT31 = Convert.ToDouble(comboBox123.SelectedItem) /
i_sum3;
                i_ALT32 = Convert.ToDouble(comboBox122.SelectedItem) /
i_sum3;
                i_ALT33 = Convert.ToDouble(textBox254.Text) / i_sum3;
                i_ALT34 = Convert.ToDouble(textBox255.Text) / i_sum3;
                i_ALT35 = Convert.ToDouble(textBox245.Text) / i_sum3;

                i_ALT41 = Convert.ToDouble(comboBox121.SelectedItem) /
i_sum4;
                i_ALT42 = Convert.ToDouble(comboBox120.SelectedItem) /
i_sum4;
                i_ALT43 = Convert.ToDouble(comboBox119.SelectedItem) /
i_sum4;
                i_ALT44 = Convert.ToDouble(textBox253.Text) / i_sum4;
                i_ALT45 = Convert.ToDouble(textBox244.Text) / i_sum4;

                i_ALT51 = Convert.ToDouble(comboBox118.SelectedItem) /
i_sum5;
                i_ALT52 = Convert.ToDouble(comboBox117.SelectedItem) /
i_sum5;
                i_ALT53 = Convert.ToDouble(comboBox116.SelectedItem) /
i_sum5;
                i_ALT54 = Convert.ToDouble(comboBox115.SelectedItem) /
i_sum5;
                i_ALT55 = Convert.ToDouble(textBox243.Text) / i_sum5;

                i_avarage1 = (i_ALT11 + i_ALT21 + i_ALT31 + i_ALT41 +
i_ALT51) / 5;
                i_avarage2 = (i_ALT12 + i_ALT22 + i_ALT32 + i_ALT42 +
i_ALT52) / 5;
                i_avarage3 = (i_ALT13 + i_ALT23 + i_ALT33 + i_ALT43 +
i_ALT53) / 5;
                i_avarage4 = (i_ALT14 + i_ALT24 + i_ALT34 + i_ALT44 +
i_ALT54) / 5;
                i_avarage5 = (i_ALT15 + i_ALT25 + i_ALT35 + i_ALT45 +
i_ALT55) / 5;

              i_tsum = i_avarage1 + i_avarage2 + i_avarage3 +
i_avarage4 + i_avarage5;

                i_wsum1 = (Convert.ToDouble(textBox262.Text) *
i_avarage1) +   (Convert.ToDouble(comboBox124.SelectedItem) *
i_avarage2) +   (Convert.ToDouble(comboBox123.SelectedItem) *
i_avarage3) +   (Convert.ToDouble(comboBox121.SelectedItem) *
i_avarage4) +   (Convert.ToDouble(comboBox118.SelectedItem) *
i_avarage5);
              i_wsum2 = (Convert.ToDouble(textBox261.Text) *
i_avarage1) + (Convert.ToDouble(textBox256.Text) * i_avarage2) +
(Convert.ToDouble(comboBox122.SelectedItem) * i_avarage3) +
(Convert.ToDouble(comboBox120.SelectedItem) * i_avarage4) +
(Convert.ToDouble(comboBox117.SelectedItem) * i_avarage5);


                                         - 109 -
              i_wsum3 = (Convert.ToDouble(textBox260.Text) *
i_avarage1) + (Convert.ToDouble(textBox257.Text) * i_avarage2) +
(Convert.ToDouble(textBox254.Text) * i_avarage3) +
(Convert.ToDouble(comboBox119.SelectedItem) * i_avarage4) +
(Convert.ToDouble(comboBox116.SelectedItem) * i_avarage5);
              i_wsum4 = (Convert.ToDouble(textBox259.Text) *
i_avarage1) + (Convert.ToDouble(textBox258.Text) * i_avarage2) +
(Convert.ToDouble(textBox255.Text) * i_avarage3) +
(Convert.ToDouble(textBox173.Text) * i_avarage4) +
(Convert.ToDouble(comboBox115.SelectedItem) * i_avarage5);
              i_wsum5 = (Convert.ToDouble(textBox247.Text) *
i_avarage1) + (Convert.ToDouble(textBox246.Text) * i_avarage2) +
(Convert.ToDouble(textBox245.Text) * i_avarage3) +
(Convert.ToDouble(textBox244.Text) * i_avarage4) +
(Convert.ToDouble(textBox243.Text) * i_avarage5);


               i_div1   =   i_wsum1    /   i_avarage1;
               i_div2   =   i_wsum2    /   i_avarage2;
               i_div3   =   i_wsum3    /   i_avarage3;
               i_div4   =   i_wsum4    /   i_avarage4;
               i_div5   =   i_wsum5    /   i_avarage5;

               i_lamda = (i_div1 + i_div2 + i_div3 + i_div4 + i_div5) /
5;
               i_CI = (i_lamda - 5) / (5 - 1);
               i_CR = (i_CI / 1.12);


             textBox252.Text    =     Convert.ToString(i_avarage1);
             textBox251.Text    =     Convert.ToString(i_avarage2);
             textBox250.Text    =     Convert.ToString(i_avarage3);
             textBox249.Text    =     Convert.ToString(i_avarage4);
             textBox248.Text    =     Convert.ToString(i_avarage5);


             button57.Enabled = true;

             if (i_CR > 0.1)
             {

                 MessageBox.Show("Inconsistency, Please change entered
numbers");
                 textBox261.Clear();

                 textBox260.Clear();
                 textBox259.Clear();
                 textBox247.Clear();

                 textBox257.Clear();
                 textBox258.Clear();
                 textBox246.Clear();

                 textBox255.Clear();
                 textBox245.Clear();
                 textBox244.Clear();

                 textBox46.Clear();
                 textBox45.Clear();
                 textBox44.Clear();
                 textBox43.Clear();


                                             - 110 -
                textBox50.Clear();

                textBox252.Clear();
                textBox251.Clear();
                textBox250.Clear();
                textBox249.Clear();
                textBox248.Clear();

                button57.Enabled = false;

           }
       }

        private void button58_Click(object sender, EventArgs e) //
insite clear
        {
             textBox261.Clear();

           textBox260.Clear();
           textBox259.Clear();
           textBox247.Clear();

           textBox257.Clear();
           textBox258.Clear();
           textBox246.Clear();

           textBox255.Clear();
           textBox245.Clear();
           textBox244.Clear();

           textBox46.Clear();
           textBox45.Clear();
           textBox44.Clear();
           textBox43.Clear();
           textBox50.Clear();

           textBox252.Clear();
           textBox251.Clear();
           textBox250.Clear();
           textBox249.Clear();
           textBox248.Clear();

           button57.Enabled = false;
       }

        private void button67_Click(object sender, EventArgs e) //
swimmingpool calculates
        {
            textBox300.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox143.SelectedItem))));
            textBox297.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox142.SelectedItem))));
            textBox298.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox140.SelectedItem))));
            textBox299.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox141.SelectedItem))));
            textBox295.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox139.SelectedItem))));
            textBox301.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox144.SelectedItem))));



                                      - 111 -
            textBox287.Text = Convert.ToString((1     /
(Convert.ToDouble(comboBox138.SelectedItem))));
            textBox286.Text = Convert.ToString((1     /
(Convert.ToDouble(comboBox137.SelectedItem))));
            textBox285.Text = Convert.ToString((1     /
(Convert.ToDouble(comboBox136.SelectedItem))));
            textBox284.Text = Convert.ToString((1     /
(Convert.ToDouble(comboBox135.SelectedItem))));

             sw_sum1 = Convert.ToDouble(textBox302.Text) +
Convert.ToDouble(textBox301.Text) + Convert.ToDouble(textBox300.Text)
+ Convert.ToDouble(textBox299.Text) +
Convert.ToDouble(textBox287.Text);
             sw_sum2 = Convert.ToDouble(textBox286.Text) +
Convert.ToDouble(textBox298.Text) + Convert.ToDouble(textBox297.Text)
+ Convert.ToDouble(comboBox144.SelectedItem) +
Convert.ToDouble(textBox296.Text);
             sw_sum3 = Convert.ToDouble(textBox285.Text) +
Convert.ToDouble(textBox295.Text) +
Convert.ToDouble(comboBox142.SelectedItem) +
Convert.ToDouble(comboBox143.SelectedItem) +
Convert.ToDouble(textBox294.Text);
             sw_sum4 = Convert.ToDouble(textBox284.Text) +
Convert.ToDouble(comboBox140.SelectedItem) +
Convert.ToDouble(comboBox139.SelectedItem) +
Convert.ToDouble(comboBox141.SelectedItem) +
Convert.ToDouble(textBox293.Text);
             sw_sum5 = Convert.ToDouble(textBox283.Text) +
Convert.ToDouble(comboBox138.SelectedItem) +
Convert.ToDouble(comboBox137.SelectedItem) +
Convert.ToDouble(comboBox136.SelectedItem) +
Convert.ToDouble(comboBox135.SelectedItem);


             sw_ALT11   =   Convert.ToDouble(textBox302.Text)   /   sw_sum1;
             sw_ALT12   =   Convert.ToDouble(textBox301.Text)   /   sw_sum1;
             sw_ALT13   =   Convert.ToDouble(textBox300.Text)   /   sw_sum1;
             sw_ALT14   =   Convert.ToDouble(textBox299.Text)   /   sw_sum1;
             sw_ALT15   =   Convert.ToDouble(textBox287.Text)   /   sw_sum1;

             sw_ALT21 = Convert.ToDouble(comboBox144.SelectedItem) /
sw_sum2;
             sw_ALT22   =   Convert.ToDouble(textBox296.Text)   /   sw_sum2;
             sw_ALT23   =   Convert.ToDouble(textBox297.Text)   /   sw_sum2;
             sw_ALT24   =   Convert.ToDouble(textBox298.Text)   /   sw_sum2;
             sw_ALT25   =   Convert.ToDouble(textBox286.Text)   /   sw_sum2;

             sw_ALT31 = Convert.ToDouble(comboBox143.SelectedItem) /
sw_sum3;
             sw_ALT32 = Convert.ToDouble(comboBox142.SelectedItem) /
sw_sum3;
             sw_ALT33 = Convert.ToDouble(textBox294.Text) / sw_sum3;
             sw_ALT34 = Convert.ToDouble(textBox295.Text) / sw_sum3;
             sw_ALT35 = Convert.ToDouble(textBox285.Text) / sw_sum3;

             sw_ALT41 = Convert.ToDouble(comboBox141.SelectedItem) /
sw_sum4;
             sw_ALT42 = Convert.ToDouble(comboBox140.SelectedItem) /
sw_sum4;
             sw_ALT43 = Convert.ToDouble(comboBox139.SelectedItem) /
sw_sum4;


                                       - 112 -
             sw_ALT44 = Convert.ToDouble(textBox293.Text) / sw_sum4;
             sw_ALT45 = Convert.ToDouble(textBox284.Text) / sw_sum4;

             sw_ALT51 = Convert.ToDouble(comboBox138.SelectedItem) /
sw_sum5;
             sw_ALT52 = Convert.ToDouble(comboBox137.SelectedItem) /
sw_sum5;
             sw_ALT53 = Convert.ToDouble(comboBox136.SelectedItem) /
sw_sum5;
             sw_ALT54 = Convert.ToDouble(comboBox135.SelectedItem) /
sw_sum5;
             sw_ALT55 = Convert.ToDouble(textBox283.Text) / sw_sum5;

             sw_avarage1     = (sw_ALT11 + sw_ALT21 + sw_ALT31 + sw_ALT41
+ sw_ALT51) / 5;
             sw_avarage2     = (sw_ALT12 + sw_ALT22 + sw_ALT32 + sw_ALT42
+ sw_ALT52) / 5;
             sw_avarage3     = (sw_ALT13 + sw_ALT23 + sw_ALT33 + sw_ALT43
+ sw_ALT53) / 5;
             sw_avarage4     = (sw_ALT14 + sw_ALT24 + sw_ALT34 + sw_ALT44
+ sw_ALT54) / 5;
             sw_avarage5     = (sw_ALT15 + sw_ALT25 + sw_ALT35 + sw_ALT45
+ sw_ALT55) / 5;

             sw_tsum = sw_avarage1 + sw_avarage2 + sw_avarage3 +
sw_avarage4 + sw_avarage5;

              sw_wsum1 = (Convert.ToDouble(textBox302.Text) *
sw_avarage1) + (Convert.ToDouble(comboBox144.SelectedItem) *
sw_avarage2) + (Convert.ToDouble(comboBox143.SelectedItem) *
sw_avarage3) + (Convert.ToDouble(comboBox141.SelectedItem) *
sw_avarage4) + (Convert.ToDouble(comboBox138.SelectedItem) *
sw_avarage5);
              sw_wsum2 = (Convert.ToDouble(textBox301.Text) *
sw_avarage1) + (Convert.ToDouble(textBox296.Text) * sw_avarage2)     +
(Convert.ToDouble(comboBox142.SelectedItem) * sw_avarage3) +
(Convert.ToDouble(comboBox140.SelectedItem) * sw_avarage4) +
(Convert.ToDouble(comboBox137.SelectedItem) * sw_avarage5);
              sw_wsum3 = (Convert.ToDouble(textBox300.Text) *
sw_avarage1) + (Convert.ToDouble(textBox297.Text) * sw_avarage2)     +
(Convert.ToDouble(textBox294.Text) * sw_avarage3) +
(Convert.ToDouble(comboBox139.SelectedItem) * sw_avarage4) +
(Convert.ToDouble(comboBox136.SelectedItem) * sw_avarage5);
              sw_wsum4 = (Convert.ToDouble(textBox299.Text) *
sw_avarage1) + (Convert.ToDouble(textBox298.Text) * sw_avarage2)     +
(Convert.ToDouble(textBox295.Text) * sw_avarage3) +
(Convert.ToDouble(textBox173.Text) * sw_avarage4) +
(Convert.ToDouble(comboBox135.SelectedItem) * sw_avarage5);
              sw_wsum5 = (Convert.ToDouble(textBox287.Text) *
sw_avarage1) + (Convert.ToDouble(textBox286.Text) * sw_avarage2)     +
(Convert.ToDouble(textBox285.Text) * sw_avarage3) +
(Convert.ToDouble(textBox284.Text) * sw_avarage4) +
(Convert.ToDouble(textBox283.Text) * sw_avarage5);


             sw_div1   =   sw_wsum1   /   sw_avarage1;
             sw_div2   =   sw_wsum2   /   sw_avarage2;
             sw_div3   =   sw_wsum3   /   sw_avarage3;
             sw_div4   =   sw_wsum4   /   sw_avarage4;
             sw_div5   =   sw_wsum5   /   sw_avarage5;



                                           - 113 -
                 sw_lamda = (sw_div1 + sw_div2 + sw_div3 + sw_div4 +
sw_div5) / 5;
                 sw_CI = (sw_lamda - 5) / (5 - 1);
                 sw_CR = (sw_CI / 1.12);


             textBox292.Text   =   Convert.ToString(sw_avarage1);
             textBox291.Text   =   Convert.ToString(sw_avarage2);
             textBox290.Text   =   Convert.ToString(sw_avarage3);
             textBox289.Text   =   Convert.ToString(sw_avarage4);
             textBox288.Text   =   Convert.ToString(sw_avarage5);


             button65.Enabled = true;

             if (sw_CR > 0.1)
             {

                    MessageBox.Show("Inconsistency, Please change entered
numbers");
                    textBox301.Clear();

                    textBox300.Clear();
                    textBox299.Clear();
                    textBox287.Clear();

                    textBox297.Clear();
                    textBox298.Clear();
                    textBox286.Clear();

                    textBox295.Clear();
                    textBox285.Clear();
                    textBox284.Clear();

                    textBox46.Clear();
                    textBox45.Clear();
                    textBox44.Clear();
                    textBox43.Clear();
                    textBox50.Clear();

                    textBox292.Clear();
                    textBox291.Clear();
                    textBox250.Clear();
                    textBox289.Clear();
                    textBox288.Clear();

                    button65.Enabled = false;

             }
        }

        private void button66_Click(object sender, EventArgs e)
//swimmingpool clear
        {
            textBox301.Clear();

             textBox300.Clear();
             textBox299.Clear();
             textBox287.Clear();

             textBox297.Clear();


                                          - 114 -
           textBox298.Clear();
           textBox286.Clear();

           textBox295.Clear();
           textBox285.Clear();
           textBox284.Clear();

           textBox46.Clear();
           textBox45.Clear();
           textBox44.Clear();
           textBox43.Clear();
           textBox50.Clear();

           textBox292.Clear();
           textBox291.Clear();
           textBox250.Clear();
           textBox289.Clear();
           textBox288.Clear();

           button65.Enabled = false;
       }

        private void button71_Click(object sender, EventArgs e) //
sportcenter calculate
        {
            textBox320.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox153.SelectedItem))));
            textBox317.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox152.SelectedItem))));
            textBox318.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox150.SelectedItem))));
            textBox319.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox151.SelectedItem))));
            textBox315.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox149.SelectedItem))));
            textBox321.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox154.SelectedItem))));
            textBox307.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox148.SelectedItem))));
            textBox306.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox147.SelectedItem))));
            textBox305.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox146.SelectedItem))));
            textBox304.Text = Convert.ToString((1 /
(Convert.ToDouble(comboBox145.SelectedItem))));

             sc_sum1 = Convert.ToDouble(textBox322.Text) +
Convert.ToDouble(textBox321.Text) + Convert.ToDouble(textBox320.Text)
+ Convert.ToDouble(textBox319.Text) +
Convert.ToDouble(textBox307.Text);
             sc_sum2 = Convert.ToDouble(textBox306.Text) +
Convert.ToDouble(textBox318.Text) + Convert.ToDouble(textBox317.Text)
+ Convert.ToDouble(comboBox154.SelectedItem) +
Convert.ToDouble(textBox316.Text);
             sc_sum3 = Convert.ToDouble(textBox305.Text) +
Convert.ToDouble(textBox315.Text) +
Convert.ToDouble(comboBox152.SelectedItem) +
Convert.ToDouble(comboBox153.SelectedItem) +
Convert.ToDouble(textBox314.Text);
             sc_sum4 = Convert.ToDouble(textBox304.Text) +
Convert.ToDouble(comboBox150.SelectedItem) +


                                   - 115 -
Convert.ToDouble(comboBox149.SelectedItem) +
Convert.ToDouble(comboBox151.SelectedItem) +
Convert.ToDouble(textBox313.Text);
             sc_sum5 = Convert.ToDouble(textBox303.Text) +
Convert.ToDouble(comboBox148.SelectedItem) +
Convert.ToDouble(comboBox147.SelectedItem) +
Convert.ToDouble(comboBox146.SelectedItem) +
Convert.ToDouble(comboBox145.SelectedItem);


             sc_ALT11   =   Convert.ToDouble(textBox322.Text)   /   sc_sum1;
             sc_ALT12   =   Convert.ToDouble(textBox321.Text)   /   sc_sum1;
             sc_ALT13   =   Convert.ToDouble(textBox320.Text)   /   sc_sum1;
             sc_ALT14   =   Convert.ToDouble(textBox319.Text)   /   sc_sum1;
             sc_ALT15   =   Convert.ToDouble(textBox307.Text)   /   sc_sum1;

             sc_ALT21 = Convert.ToDouble(comboBox154.SelectedItem) /
sc_sum2;
             sc_ALT22   =   Convert.ToDouble(textBox316.Text)   /   sc_sum2;
             sc_ALT23   =   Convert.ToDouble(textBox317.Text)   /   sc_sum2;
             sc_ALT24   =   Convert.ToDouble(textBox318.Text)   /   sc_sum2;
             sc_ALT25   =   Convert.ToDouble(textBox306.Text)   /   sc_sum2;

             sc_ALT31 = Convert.ToDouble(comboBox153.SelectedItem) /
sc_sum3;
             sc_ALT32 = Convert.ToDouble(comboBox152.SelectedItem) /
sc_sum3;
             sc_ALT33 = Convert.ToDouble(textBox314.Text) / sc_sum3;
             sc_ALT34 = Convert.ToDouble(textBox315.Text) / sc_sum3;
             sc_ALT35 = Convert.ToDouble(textBox305.Text) / sc_sum3;

             sc_ALT41 = Convert.ToDouble(comboBox151.SelectedItem) /
sc_sum4;
             sc_ALT42 = Convert.ToDouble(comboBox150.SelectedItem) /
sc_sum4;
             sc_ALT43 = Convert.ToDouble(comboBox149.SelectedItem) /
sc_sum4;
             sc_ALT44 = Convert.ToDouble(textBox313.Text) / sc_sum4;
             sc_ALT45 = Convert.ToDouble(textBox304.Text) / sc_sum4;

             sc_ALT51 = Convert.ToDouble(comboBox148.SelectedItem) /
sc_sum5;
             sc_ALT52 = Convert.ToDouble(comboBox147.SelectedItem) /
sc_sum5;
             sc_ALT53 = Convert.ToDouble(comboBox146.SelectedItem) /
sc_sum5;
             sc_ALT54 = Convert.ToDouble(comboBox145.SelectedItem) /
sc_sum5;
             sc_ALT55 = Convert.ToDouble(textBox303.Text) / sc_sum5;

             sc_avarage1     = (sc_ALT11 + sc_ALT21 + sc_ALT31 + sc_ALT41
+ sc_ALT51) / 5;
             sc_avarage2     = (sc_ALT12 + sc_ALT22 + sc_ALT32 + sc_ALT42
+ sc_ALT52) / 5;
             sc_avarage3     = (sc_ALT13 + sc_ALT23 + sc_ALT33 + sc_ALT43
+ sc_ALT53) / 5;
             sc_avarage4     = (sc_ALT14 + sc_ALT24 + sc_ALT34 + sc_ALT44
+ sc_ALT54) / 5;
             sc_avarage5     = (sc_ALT15 + sc_ALT25 + sc_ALT35 + sc_ALT45
+ sc_ALT55) / 5;



                                       - 116 -
             sc_tsum = sc_avarage1 + sc_avarage2 + sc_avarage3 +
sc_avarage4 + sc_avarage5;

              sc_wsum1 = (Convert.ToDouble(textBox322.Text) *
sc_avarage1) + (Convert.ToDouble(comboBox154.SelectedItem) *
sc_avarage2) + (Convert.ToDouble(comboBox153.SelectedItem) *
sc_avarage3) + (Convert.ToDouble(comboBox151.SelectedItem) *
sc_avarage4) + (Convert.ToDouble(comboBox148.SelectedItem) *
sc_avarage5);
              sc_wsum2 = (Convert.ToDouble(textBox321.Text) *
sc_avarage1) + (Convert.ToDouble(textBox316.Text) * sc_avarage2)       +
(Convert.ToDouble(comboBox152.SelectedItem) * sc_avarage3) +
(Convert.ToDouble(comboBox150.SelectedItem) * sc_avarage4) +
(Convert.ToDouble(comboBox147.SelectedItem) * sc_avarage5);
              sc_wsum3 = (Convert.ToDouble(textBox320.Text) *
sc_avarage1) + (Convert.ToDouble(textBox317.Text) * sc_avarage2)       +
(Convert.ToDouble(textBox314.Text) * sc_avarage3) +
(Convert.ToDouble(comboBox149.SelectedItem) * sc_avarage4) +
(Convert.ToDouble(comboBox146.SelectedItem) * sc_avarage5);
              sc_wsum4 = (Convert.ToDouble(textBox319.Text) *
sc_avarage1) + (Convert.ToDouble(textBox318.Text) * sc_avarage2)       +
(Convert.ToDouble(textBox315.Text) * sc_avarage3) +
(Convert.ToDouble(textBox173.Text) * sc_avarage4) +
(Convert.ToDouble(comboBox145.SelectedItem) * sc_avarage5);
              sc_wsum5 = (Convert.ToDouble(textBox307.Text) *
sc_avarage1) + (Convert.ToDouble(textBox306.Text) * sc_avarage2)       +
(Convert.ToDouble(textBox305.Text) * sc_avarage3) +
(Convert.ToDouble(textBox304.Text) * sc_avarage4) +
(Convert.ToDouble(textBox303.Text) * sc_avarage5);


                sc_div1   =   sc_wsum1   /   sc_avarage1;
                sc_div2   =   sc_wsum2   /   sc_avarage2;
                sc_div3   =   sc_wsum3   /   sc_avarage3;
                sc_div4   =   sc_wsum4   /   sc_avarage4;
                sc_div5   =   sc_wsum5   /   sc_avarage5;

                sc_lamda = (sc_div1 + sc_div2 + sc_div3 + sc_div4 +
sc_div5) / 5;
                sc_CI = (sc_lamda - 5) / (5 - 1);
                sc_CR = (sc_CI / 1.12);


             textBox312.Text      =   Convert.ToString(sc_avarage1);
             textBox311.Text      =   Convert.ToString(sc_avarage2);
             textBox310.Text      =   Convert.ToString(sc_avarage3);
             textBox309.Text      =   Convert.ToString(sc_avarage4);
             textBox308.Text      =   Convert.ToString(sc_avarage5);


             button69.Enabled = true;

             if (sc_CR > 0.1)
             {

                   MessageBox.Show("Inconsistency, Please change entered
numbers");
                   textBox321.Clear();

                   textBox320.Clear();
                   textBox319.Clear();


                                              - 117 -
                textBox307.Clear();

                textBox317.Clear();
                textBox318.Clear();
                textBox306.Clear();

                textBox315.Clear();
                textBox305.Clear();
                textBox304.Clear();

                textBox46.Clear();
                textBox45.Clear();
                textBox44.Clear();
                textBox43.Clear();
                textBox50.Clear();

                textBox292.Clear();
                textBox311.Clear();
                textBox250.Clear();
                textBox309.Clear();
                textBox308.Clear();

                button69.Enabled = false;

           }
       }

        private void button70_Click(object sender, EventArgs e) //
sport center clean
        {
            textBox321.Clear();

           textBox320.Clear();
           textBox319.Clear();
           textBox307.Clear();

           textBox317.Clear();
           textBox318.Clear();
           textBox306.Clear();

           textBox315.Clear();
           textBox305.Clear();
           textBox304.Clear();

           textBox46.Clear();
           textBox45.Clear();
           textBox44.Clear();
           textBox43.Clear();
           textBox50.Clear();

           textBox292.Clear();
           textBox311.Clear();
           textBox250.Clear();
           textBox309.Clear();
           textBox308.Clear();

           button69.Enabled = false;
       }

        private void button75_Click(object sender, EventArgs e) //
carparking calculate


                                      - 118 -
           {
            textBox340.Text = Convert.ToString((1       /
(Convert.ToDouble(comboBox163.SelectedItem))));
            textBox337.Text = Convert.ToString((1       /
(Convert.ToDouble(comboBox162.SelectedItem))));
            textBox338.Text = Convert.ToString((1       /
(Convert.ToDouble(comboBox160.SelectedItem))));
            textBox339.Text = Convert.ToString((1       /
(Convert.ToDouble(comboBox161.SelectedItem))));
            textBox335.Text = Convert.ToString((1       /
(Convert.ToDouble(comboBox159.SelectedItem))));
            textBox341.Text = Convert.ToString((1       /
(Convert.ToDouble(comboBox164.SelectedItem))));
            textBox327.Text = Convert.ToString((1       /
(Convert.ToDouble(comboBox158.SelectedItem))));
            textBox326.Text = Convert.ToString((1       /
(Convert.ToDouble(comboBox157.SelectedItem))));
            textBox325.Text = Convert.ToString((1       /
(Convert.ToDouble(comboBox156.SelectedItem))));
            textBox324.Text = Convert.ToString((1       /
(Convert.ToDouble(comboBox155.SelectedItem))));

             cp_sum1 = Convert.ToDouble(textBox342.Text) +
Convert.ToDouble(textBox341.Text) + Convert.ToDouble(textBox340.Text)
+ Convert.ToDouble(textBox339.Text) +
Convert.ToDouble(textBox327.Text);
             cp_sum2 = Convert.ToDouble(textBox326.Text) +
Convert.ToDouble(textBox338.Text) + Convert.ToDouble(textBox337.Text)
+ Convert.ToDouble(comboBox164.SelectedItem) +
Convert.ToDouble(textBox336.Text);
             cp_sum3 = Convert.ToDouble(textBox325.Text) +
Convert.ToDouble(textBox335.Text) +
Convert.ToDouble(comboBox162.SelectedItem) +
Convert.ToDouble(comboBox163.SelectedItem) +
Convert.ToDouble(textBox334.Text);
             cp_sum4 = Convert.ToDouble(textBox324.Text) +
Convert.ToDouble(comboBox160.SelectedItem) +
Convert.ToDouble(comboBox159.SelectedItem) +
Convert.ToDouble(comboBox161.SelectedItem) +
Convert.ToDouble(textBox333.Text);
             cp_sum5 = Convert.ToDouble(textBox323.Text) +
Convert.ToDouble(comboBox158.SelectedItem) +
Convert.ToDouble(comboBox157.SelectedItem) +
Convert.ToDouble(comboBox156.SelectedItem) +
Convert.ToDouble(comboBox155.SelectedItem);


               cp_ALT11   =   Convert.ToDouble(textBox342.Text)   /   cp_sum1;
               cp_ALT12   =   Convert.ToDouble(textBox341.Text)   /   cp_sum1;
               cp_ALT13   =   Convert.ToDouble(textBox340.Text)   /   cp_sum1;
               cp_ALT14   =   Convert.ToDouble(textBox339.Text)   /   cp_sum1;
               cp_ALT15   =   Convert.ToDouble(textBox327.Text)   /   cp_sum1;

               cp_ALT21 = Convert.ToDouble(comboBox164.SelectedItem) /
cp_sum2;
               cp_ALT22   =   Convert.ToDouble(textBox336.Text)   /   cp_sum2;
               cp_ALT23   =   Convert.ToDouble(textBox337.Text)   /   cp_sum2;
               cp_ALT24   =   Convert.ToDouble(textBox338.Text)   /   cp_sum2;
               cp_ALT25   =   Convert.ToDouble(textBox326.Text)   /   cp_sum2;




                                         - 119 -
             cp_ALT31 = Convert.ToDouble(comboBox163.SelectedItem) /
cp_sum3;
             cp_ALT32 = Convert.ToDouble(comboBox162.SelectedItem) /
cp_sum3;
             cp_ALT33 = Convert.ToDouble(textBox334.Text) / cp_sum3;
             cp_ALT34 = Convert.ToDouble(textBox335.Text) / cp_sum3;
             cp_ALT35 = Convert.ToDouble(textBox325.Text) / cp_sum3;

             cp_ALT41 = Convert.ToDouble(comboBox161.SelectedItem) /
cp_sum4;
             cp_ALT42 = Convert.ToDouble(comboBox160.SelectedItem) /
cp_sum4;
             cp_ALT43 = Convert.ToDouble(comboBox159.SelectedItem) /
cp_sum4;
             cp_ALT44 = Convert.ToDouble(textBox333.Text) / cp_sum4;
             cp_ALT45 = Convert.ToDouble(textBox324.Text) / cp_sum4;

             cp_ALT51 = Convert.ToDouble(comboBox158.SelectedItem) /
cp_sum5;
             cp_ALT52 = Convert.ToDouble(comboBox157.SelectedItem) /
cp_sum5;
             cp_ALT53 = Convert.ToDouble(comboBox156.SelectedItem) /
cp_sum5;
             cp_ALT54 = Convert.ToDouble(comboBox155.SelectedItem) /
cp_sum5;
             cp_ALT55 = Convert.ToDouble(textBox323.Text) / cp_sum5;

             cp_avarage1   = (cp_ALT11 + cp_ALT21 + cp_ALT31 + cp_ALT41
+ cp_ALT51) / 5;
             cp_avarage2   = (cp_ALT12 + cp_ALT22 + cp_ALT32 + cp_ALT42
+ cp_ALT52) / 5;
             cp_avarage3   = (cp_ALT13 + cp_ALT23 + cp_ALT33 + cp_ALT43
+ cp_ALT53) / 5;
             cp_avarage4   = (cp_ALT14 + cp_ALT24 + cp_ALT34 + cp_ALT44
+ cp_ALT54) / 5;
             cp_avarage5   = (cp_ALT15 + cp_ALT25 + cp_ALT35 + cp_ALT45
+ cp_ALT55) / 5;



             cp_tsum = cp_avarage1 + cp_avarage2 + cp_avarage3 +
cp_avarage4 + cp_avarage5;


              cp_wsum1 = (Convert.ToDouble(textBox342.Text) *
cp_avarage1) + (Convert.ToDouble(comboBox164.SelectedItem) *
cp_avarage2) + (Convert.ToDouble(comboBox163.SelectedItem) *
cp_avarage3) + (Convert.ToDouble(comboBox161.SelectedItem) *
cp_avarage4) + (Convert.ToDouble(comboBox158.SelectedItem) *
cp_avarage5);
              cp_wsum2 = (Convert.ToDouble(textBox341.Text) *
cp_avarage1) + (Convert.ToDouble(textBox336.Text) * cp_avarage2) +
(Convert.ToDouble(comboBox162.SelectedItem) * cp_avarage3) +
(Convert.ToDouble(comboBox160.SelectedItem) * cp_avarage4) +
(Convert.ToDouble(comboBox157.SelectedItem) * cp_avarage5);
              cp_wsum3 = (Convert.ToDouble(textBox340.Text) *
cp_avarage1) + (Convert.ToDouble(textBox337.Text) * cp_avarage2) +
(Convert.ToDouble(textBox334.Text) * cp_avarage3) +
(Convert.ToDouble(comboBox159.SelectedItem) * cp_avarage4) +
(Convert.ToDouble(comboBox156.SelectedItem) * cp_avarage5);



                                     - 120 -
             cp_wsum4 = (Convert.ToDouble(textBox339.Text) *
cp_avarage1) + (Convert.ToDouble(textBox338.Text) * cp_avarage2) +
(Convert.ToDouble(textBox335.Text) * cp_avarage3) +
(Convert.ToDouble(textBox333.Text) * cp_avarage4) +
(Convert.ToDouble(comboBox155.SelectedItem) * cp_avarage5);
             cp_wsum5 = (Convert.ToDouble(textBox327.Text) *
cp_avarage1) + (Convert.ToDouble(textBox326.Text) * cp_avarage2) +
(Convert.ToDouble(textBox325.Text) * cp_avarage3) +
(Convert.ToDouble(textBox324.Text) * cp_avarage4) +
(Convert.ToDouble(textBox323.Text) * cp_avarage5);



                cp_div1   =   cp_wsum1   /   cp_avarage1;
                cp_div2   =   cp_wsum2   /   cp_avarage2;
                cp_div3   =   cp_wsum3   /   cp_avarage3;
                cp_div4   =   cp_wsum4   /   cp_avarage4;
                cp_div5   =   cp_wsum5   /   cp_avarage5;



                cp_lamda = (cp_div1 + cp_div2 + cp_div3 + cp_div4 +
cp_div5) / 5;
                cp_CI = (cp_lamda - 5) / (5 - 1);
                cp_CR = (cp_CI / 1.12);


             textBox332.Text      =   Convert.ToString(cp_avarage1);
             textBox331.Text      =   Convert.ToString(cp_avarage2);
             textBox330.Text      =   Convert.ToString(cp_avarage3);
             textBox329.Text      =   Convert.ToString(cp_avarage4);
             textBox328.Text      =   Convert.ToString(cp_avarage5);


             button73.Enabled = true;

             if (cp_CR > 0.1)
             {

                   MessageBox.Show("Inconsistency, Please change entered
numbers");
                   textBox341.Clear();

                   textBox340.Clear();
                   textBox339.Clear();
                   textBox327.Clear();

                   textBox337.Clear();
                   textBox338.Clear();
                   textBox326.Clear();

                   textBox335.Clear();
                   textBox325.Clear();
                   textBox324.Clear();

                   textBox46.Clear();
                   textBox45.Clear();
                   textBox44.Clear();
                   textBox43.Clear();
                   textBox50.Clear();



                                              - 121 -
        textBox292.Clear();
        textBox331.Clear();
        textBox250.Clear();
        textBox329.Clear();
        textBox328.Clear();

        button73.Enabled = false;

    }
}

private void button24_Click(object sender, EventArgs e)
{
    tabControl1.SelectedTab = tbpFP;
}

private void button37_Click(object sender, EventArgs e)
{
    tabControl1.SelectedTab = tbpNG;
}

private void button36_Click(object sender, EventArgs e)
{
    tabControl1.SelectedTab = tbpC;
}

private void button41_Click(object sender, EventArgs e)
{
    tabControl1.SelectedTab = tbpCO;
}

private void button40_Click(object sender, EventArgs e)
{
    tabControl1.SelectedTab = tbpR;
}

private void button45_Click(object sender, EventArgs e)
{
    tabControl1.SelectedTab = tbpCH;
}

private void button44_Click(object sender, EventArgs e)
{
    tabControl1.SelectedTab = tbpNG;
}

private void button49_Click(object sender, EventArgs e)
{
    tabControl1.SelectedTab = tbpS;
}

private void button48_Click(object sender, EventArgs e)
{
    tabControl1.SelectedTab = tbpC;
}

private void button53_Click(object sender, EventArgs e)
{
    tabControl1.SelectedTab = tbpIS;
}



                              - 122 -
        private void button52_Click(object sender, EventArgs e)
        {
            tabControl1.SelectedTab = tbpCH;
        }

        private void button57_Click(object sender, EventArgs e)
        {
            tabControl1.SelectedTab = tbpSP;
        }

        private void button56_Click(object sender, EventArgs e)
        {
            tabControl1.SelectedTab = tbpS;
        }

        private void button65_Click(object sender, EventArgs e)
        {
            tabControl1.SelectedTab = tbpSC;
        }

        private void button64_Click(object sender, EventArgs e)
        {
            tabControl1.SelectedTab = tbpIS;
        }

        private void button69_Click(object sender, EventArgs e)
        {
            tabControl1.SelectedTab = tbpCP;
        }

        private void button68_Click(object sender, EventArgs e)
        {
            tabControl1.SelectedTab = tbpSP;
        }

        private void button73_Click(object sender, EventArgs e) // car
parking next
        {
             tabControl1.SelectedTab = tbpSolution;

             label163.Text   = Convert.ToString(f_avarage1 *
b_avarage1*m_avarage1);
             label164.Text   = Convert.ToString(f_avarage2 * b_avarage1 *
m_avarage1);
             label165.Text   = Convert.ToString(f_avarage3 * b_avarage1 *
m_avarage1);
             label166.Text   = Convert.ToString(f_avarage4 * b_avarage1 *
m_avarage1);
             label167.Text   = Convert.ToString(f_avarage5 * b_avarage1 *
m_avarage1);

               label287.Text = Convert.ToString(c_avarage1 * b_avarage2 *
m_avarage1);
               label286.Text = Convert.ToString(c_avarage2 * b_avarage2 *
m_avarage1);
               label285.Text = Convert.ToString(c_avarage3 * b_avarage2 *
m_avarage1);
               label284.Text = Convert.ToString(c_avarage4 * b_avarage2 *
m_avarage1);
               label283.Text = Convert.ToString(c_avarage5 * b_avarage2 *
m_avarage1);


                                      - 123 -
               label174.Text = Convert.ToString(r_avarage1 * h_avarage1 *
m_avarage2);
               label173.Text = Convert.ToString(r_avarage2 * h_avarage1 *
m_avarage2);
               label172.Text = Convert.ToString(r_avarage3 * h_avarage1 *
m_avarage2);
               label171.Text = Convert.ToString(r_avarage4 * h_avarage1 *
m_avarage2);
               label170.Text = Convert.ToString(r_avarage5 * h_avarage1 *
m_avarage2);

               label180.Text = Convert.ToString(n_avarage1 * h_avarage2 *
m_avarage2);
               label179.Text = Convert.ToString(n_avarage2 * h_avarage2 *
m_avarage2);
               label178.Text = Convert.ToString(n_avarage3 * h_avarage2 *
m_avarage2);
               label177.Text = Convert.ToString(n_avarage4 * h_avarage2 *
m_avarage2);
               label176.Text = Convert.ToString(n_avarage5 * h_avarage2 *
m_avarage2);

            label186.Text      = Convert.ToString(co_avarage1 * h_avarage3
* m_avarage2);
            label185.Text      = Convert.ToString(co_avarage2 * h_avarage3
* m_avarage2);
            label184.Text      = Convert.ToString(co_avarage3 * h_avarage3
* m_avarage2);
            label183.Text      = Convert.ToString(co_avarage4 * h_avarage3
* m_avarage2);
            label182.Text      = Convert.ToString(co_avarage5 * h_avarage3
* m_avarage2);

            label192.Text      = Convert.ToString(ch_avarage1 * h_avarage4
* m_avarage2);
            label191.Text      = Convert.ToString(ch_avarage2 * h_avarage4
* m_avarage2);
            label190.Text      = Convert.ToString(ch_avarage3 * h_avarage4
* m_avarage2);
            label189.Text      = Convert.ToString(ch_avarage4 * h_avarage4
* m_avarage2);
            label188.Text      = Convert.ToString(ch_avarage5 * h_avarage4
* m_avarage2);

               label198.Text   =   Convert.ToString(p_avarage1   *   m_avarage3);
               label197.Text   =   Convert.ToString(p_avarage2   *   m_avarage3);
               label196.Text   =   Convert.ToString(p_avarage3   *   m_avarage3);
               label195.Text   =   Convert.ToString(p_avarage4   *   m_avarage3);
               label194.Text   =   Convert.ToString(p_avarage5   *   m_avarage3);

            label204.Text      = Convert.ToString(se_avarage1 * o_avarage1
* m_avarage4);
            label203.Text      = Convert.ToString(se_avarage2 * o_avarage1
* m_avarage4);
            label202.Text      = Convert.ToString(se_avarage3 * o_avarage1
* m_avarage4);
            label201.Text      = Convert.ToString(se_avarage4 * o_avarage1
* m_avarage4);
            label200.Text      = Convert.ToString(se_avarage5 * o_avarage1
* m_avarage4);


                                          - 124 -
               label210.Text = Convert.ToString(i_avarage1 * o_avarage2 *
m_avarage4);
               label209.Text = Convert.ToString(i_avarage2 * o_avarage2 *
m_avarage4);
               label208.Text = Convert.ToString(i_avarage3 * o_avarage2 *
m_avarage4);
               label207.Text = Convert.ToString(i_avarage4 * o_avarage2 *
m_avarage4);
               label206.Text = Convert.ToString(i_avarage5 * o_avarage2 *
m_avarage4);

            label216.Text   = Convert.ToString(sc_avarage1 * o_avarage3
* m_avarage4);
            label215.Text   = Convert.ToString(sc_avarage2 * o_avarage3
* m_avarage4);
            label214.Text   = Convert.ToString(sc_avarage3 * o_avarage3
* m_avarage4);
            label213.Text   = Convert.ToString(sc_avarage4 * o_avarage3
* m_avarage4);
            label212.Text   = Convert.ToString(sc_avarage5 * o_avarage3
* m_avarage4);

            label222.Text   = Convert.ToString(cp_avarage1 * o_avarage4
* m_avarage4);
            label221.Text   = Convert.ToString(cp_avarage2 * o_avarage4
* m_avarage4);
            label220.Text   = Convert.ToString(cp_avarage3 * o_avarage4
* m_avarage4);
            label219.Text   = Convert.ToString(cp_avarage4 * o_avarage4
* m_avarage4);
            label218.Text   = Convert.ToString(cp_avarage5 * o_avarage4
* m_avarage4);

            label228.Text   = Convert.ToString(sw_avarage1 * o_avarage5
* m_avarage4);
            label227.Text   = Convert.ToString(sw_avarage2 * o_avarage5
* m_avarage4);
            label226.Text   = Convert.ToString(sw_avarage3 * o_avarage5
* m_avarage4);
            label225.Text   = Convert.ToString(sw_avarage4 * o_avarage5
* m_avarage4);
            label224.Text   = Convert.ToString(sw_avarage5 * o_avarage5
* m_avarage4);

            label168.Text =
Convert.ToString(Convert.ToDouble(label163.Text) +
Convert.ToDouble(label164.Text) + Convert.ToDouble(label165.Text) +
Convert.ToDouble(label166.Text) + Convert.ToDouble(label167.Text)
                        + Convert.ToDouble(label287.Text) +
Convert.ToDouble(label286.Text) + Convert.ToDouble(label285.Text) +
Convert.ToDouble(label284.Text) + Convert.ToDouble(label283.Text));

            label169.Text =
Convert.ToString(Convert.ToDouble(label174.Text) +
Convert.ToDouble(label173.Text) + Convert.ToDouble(label172.Text) +
Convert.ToDouble(label171.Text) + Convert.ToDouble(label170.Text)
                 + Convert.ToDouble(label180.Text) +
Convert.ToDouble(label179.Text) + Convert.ToDouble(label178.Text) +
Convert.ToDouble(label177.Text) + Convert.ToDouble(label176.Text)



                                      - 125 -
                 + Convert.ToDouble(label186.Text) +
Convert.ToDouble(label185.Text) + Convert.ToDouble(label184.Text) +
Convert.ToDouble(label183.Text) + Convert.ToDouble(label182.Text)
                 + Convert.ToDouble(label192.Text) +
Convert.ToDouble(label191.Text) + Convert.ToDouble(label190.Text) +
Convert.ToDouble(label189.Text) + Convert.ToDouble(label188.Text));

            label193.Text =
Convert.ToString(Convert.ToDouble(label198.Text) +
Convert.ToDouble(label197.Text) + Convert.ToDouble(label196.Text) +
Convert.ToDouble(label195.Text) + Convert.ToDouble(label194.Text));

            label199.Text =
Convert.ToString(Convert.ToDouble(label204.Text) +
Convert.ToDouble(label203.Text) + Convert.ToDouble(label202.Text) +
Convert.ToDouble(label201.Text) + Convert.ToDouble(label200.Text)
                 + Convert.ToDouble(label210.Text) +
Convert.ToDouble(label209.Text) + Convert.ToDouble(label208.Text) +
Convert.ToDouble(label207.Text) + Convert.ToDouble(label206.Text)
                 + Convert.ToDouble(label216.Text) +
Convert.ToDouble(label215.Text) + Convert.ToDouble(label214.Text) +
Convert.ToDouble(label213.Text) + Convert.ToDouble(label212.Text)
                 + Convert.ToDouble(label222.Text) +
Convert.ToDouble(label221.Text) + Convert.ToDouble(label220.Text) +
Convert.ToDouble(label219.Text) + Convert.ToDouble(label218.Text)
                 + Convert.ToDouble(label228.Text) +
Convert.ToDouble(label227.Text) + Convert.ToDouble(label226.Text) +
Convert.ToDouble(label225.Text) + Convert.ToDouble(label224.Text));

            double total1 = (Convert.ToDouble(label198.Text) +
Convert.ToDouble(label197.Text) + Convert.ToDouble(label196.Text) +
Convert.ToDouble(label195.Text) + Convert.ToDouble(label194.Text));

            label234.Text =
Convert.ToString(Convert.ToDouble(label163.Text) +
Convert.ToDouble(label287.Text) + Convert.ToDouble(label174.Text) +
Convert.ToDouble(label180.Text) + Convert.ToDouble(label186.Text)
                            + Convert.ToDouble(label192.Text) +
Convert.ToDouble(label198.Text) + Convert.ToDouble(label204.Text) +
Convert.ToDouble(label210.Text) + Convert.ToDouble(label216.Text)
                            + Convert.ToDouble(label222.Text) +
Convert.ToDouble(label228.Text));

            label233.Text =
Convert.ToString(Convert.ToDouble(label164.Text) +
Convert.ToDouble(label286.Text) + Convert.ToDouble(label173.Text) +
Convert.ToDouble(label179.Text) + Convert.ToDouble(label185.Text)
                + Convert.ToDouble(label191.Text) +
Convert.ToDouble(label197.Text) + Convert.ToDouble(label203.Text) +
Convert.ToDouble(label209.Text) + Convert.ToDouble(label215.Text)
                + Convert.ToDouble(label221.Text) +
Convert.ToDouble(label227.Text));

            label232.Text =
Convert.ToString(Convert.ToDouble(label165.Text) +
Convert.ToDouble(label285.Text) + Convert.ToDouble(label172.Text) +
Convert.ToDouble(label178.Text) + Convert.ToDouble(label184.Text)
                + Convert.ToDouble(label190.Text) +
Convert.ToDouble(label196.Text) + Convert.ToDouble(label202.Text) +
Convert.ToDouble(label208.Text) + Convert.ToDouble(label214.Text)



                                   - 126 -
                + Convert.ToDouble(label220.Text) +
Convert.ToDouble(label226.Text));


            label231.Text =
Convert.ToString(Convert.ToDouble(label166.Text) +
Convert.ToDouble(label284.Text) + Convert.ToDouble(label171.Text) +
Convert.ToDouble(label177.Text) + Convert.ToDouble(label183.Text)
                + Convert.ToDouble(label189.Text) +
Convert.ToDouble(label195.Text) + Convert.ToDouble(label201.Text) +
Convert.ToDouble(label207.Text) + Convert.ToDouble(label213.Text)
                + Convert.ToDouble(label219.Text) +
Convert.ToDouble(label225.Text));

            label230.Text =
Convert.ToString(Convert.ToDouble(label167.Text) +
Convert.ToDouble(label283.Text) + Convert.ToDouble(label170.Text) +
Convert.ToDouble(label176.Text) + Convert.ToDouble(label182.Text)
                + Convert.ToDouble(label188.Text) +
Convert.ToDouble(label194.Text) + Convert.ToDouble(label200.Text) +
Convert.ToDouble(label206.Text) + Convert.ToDouble(label212.Text)
                + Convert.ToDouble(label218.Text) +
Convert.ToDouble(label224.Text));

            double total2 = (Convert.ToDouble(label234.Text) +
Convert.ToDouble(label233.Text) + Convert.ToDouble(label232.Text)+
Convert.ToDouble(label231.Text) + Convert.ToDouble(label230.Text));

           label229.Text = Convert.ToString(total2) ;


       }

       private void button72_Click(object sender, EventArgs e)
       {
           tabControl1.SelectedTab = tbpSC;
       }

       private void button76_Click(object sender, EventArgs e)
       {
           tabControl1.SelectedTab = tbpRanking;

           double[] alt = new double[5];
           string[] rnk = new string[5];

            alt[0] = Convert.ToDouble(label163.Text) +
Convert.ToDouble(label287.Text) + Convert.ToDouble(label174.Text)   +
Convert.ToDouble(label180.Text) + Convert.ToDouble(label186.Text)
                            + Convert.ToDouble(label192.Text) +
Convert.ToDouble(label198.Text) + Convert.ToDouble(label204.Text)   +
Convert.ToDouble(label210.Text) + Convert.ToDouble(label216.Text)
                            + Convert.ToDouble(label222.Text) +
Convert.ToDouble(label228.Text);
            alt[1] = Convert.ToDouble(label164.Text) +
Convert.ToDouble(label286.Text) + Convert.ToDouble(label173.Text)   +
Convert.ToDouble(label179.Text) + Convert.ToDouble(label185.Text)
                            + Convert.ToDouble(label191.Text) +
Convert.ToDouble(label197.Text) + Convert.ToDouble(label203.Text)   +
Convert.ToDouble(label209.Text) + Convert.ToDouble(label215.Text)
                            + Convert.ToDouble(label221.Text) +
Convert.ToDouble(label227.Text);


                                   - 127 -
            alt[2] = Convert.ToDouble(label165.Text) +
Convert.ToDouble(label285.Text) + Convert.ToDouble(label172.Text)   +
Convert.ToDouble(label178.Text) + Convert.ToDouble(label184.Text)
                            + Convert.ToDouble(label190.Text) +
Convert.ToDouble(label196.Text) + Convert.ToDouble(label202.Text)   +
Convert.ToDouble(label208.Text) + Convert.ToDouble(label214.Text)
                            + Convert.ToDouble(label220.Text) +
Convert.ToDouble(label226.Text);
            alt[3] = Convert.ToDouble(label166.Text) +
Convert.ToDouble(label284.Text) + Convert.ToDouble(label171.Text)   +
Convert.ToDouble(label177.Text) + Convert.ToDouble(label183.Text)
                            + Convert.ToDouble(label189.Text) +
Convert.ToDouble(label195.Text) + Convert.ToDouble(label201.Text)   +
Convert.ToDouble(label207.Text) + Convert.ToDouble(label213.Text)
                            + Convert.ToDouble(label219.Text) +
Convert.ToDouble(label225.Text);
            alt[4] = Convert.ToDouble(label167.Text) +
Convert.ToDouble(label283.Text) + Convert.ToDouble(label170.Text)   +
Convert.ToDouble(label176.Text) + Convert.ToDouble(label182.Text)
                            + Convert.ToDouble(label188.Text) +
Convert.ToDouble(label194.Text) + Convert.ToDouble(label200.Text)   +
Convert.ToDouble(label206.Text) + Convert.ToDouble(label212.Text)
                            + Convert.ToDouble(label218.Text) +
Convert.ToDouble(label224.Text);


           rnk[0]     =       "ALT1";
           rnk[1]     =       "ALT2";
           rnk[2]     =       "ALT3";
           rnk[3]     =       "ALT4";
           rnk[4]     =       "ALT5";

           double yedek1;
           string yedek2;

           for (int i = 0; i <= 3; i++)
           {
               for (int j = (i + 1); j <= 4; j++)
               {
                   if (alt[i] < alt[j])
                   {
                       yedek1 = alt[j];
                       alt[j] = alt[i];
                       alt[i] = yedek1;

                                 yedek2 = rnk[j];
                                 rnk[j] = rnk[i];
                                 rnk[i] = yedek2;
                          }
                  }
           }

           l298   =   (alt[0]      *    100);
           l299   =   (alt[1]      *    100);
           l300   =   (alt[2]      *    100);
           l301   =   (alt[3]      *    100);
           l302   =   (alt[4]      *    100);

           label298.Text = Convert.ToString(l298);
           label299.Text = Convert.ToString(l299);
           label300.Text = Convert.ToString(l300);


                                                - 128 -
             label301.Text = Convert.ToString(l301);
             label302.Text = Convert.ToString(l302);

             l307   =   (rnk[0]);
             l306   =   (rnk[1]);
             l305   =   (rnk[2]);
             l304   =   (rnk[3]);
             l303   =   (rnk[4]);

             label307.Text    =   l307;
             label306.Text    =   l306;
             label305.Text    =   l305;
             label304.Text    =   l304;
             label303.Text    =   l303;

             label293.Visible       =   true;
             label294.Visible       =   true;
             label295.Visible       =   true;
             label296.Visible       =   true;
             label297.Visible       =   true;
             label298.Visible       =   true;
             label299.Visible       =   true;
             label300.Visible       =   true;
             label301.Visible       =   true;
             label302.Visible       =   true;
             label303.Visible       =   true;
             label304.Visible       =   true;
             label305.Visible       =   true;
             label306.Visible       =   true;
             label307.Visible       =   true;



        }

        private void tabControl1_SelectedIndexChanged(object sender,
EventArgs e)
        {
             treeComparison.Nodes[0].ExpandAll();
             string selectedTab = tabControl1.SelectedTab.Name;

             for (int i = 0; i < treeComparison.Nodes.Count; i++)
             {
                 treeComparison.Nodes[i].BackColor = Color.White;
                 for (int k = 0; k <
treeComparison.Nodes[i].Nodes.Count; k++)
                 {
                     //treeComparison.Nodes[i].Nodes[k].ForeColor =
Color.Black;
                     treeComparison.Nodes[i].Nodes[k].BackColor =
Color.White;

                    }
             }

             try
             {
                    //treeComparison.Nodes[selectedTab].ForeColor =
Color.Red;
                treeComparison.Nodes[selectedTab].BackColor =
Color.Aquamarine;


                                            - 129 -
             }
             catch
             {
                 for (int i = 0; i < treeComparison.Nodes.Count; i++)
                 {
                     for (int k = 0; k <
treeComparison.Nodes[i].Nodes.Count; k++ )
                     {
                         if (treeComparison.Nodes[i].Nodes[k].Name ==
selectedTab)
                             treeComparison.Nodes[i].Nodes[k].BackColor
= Color.Aquamarine;

//treeComparison.Nodes[i].Nodes[k].ForeColor = Color.Red;
                    }

                }
            }
        }

        private void label169_Click(object sender, EventArgs e)
        {

        }

        private void btnDeal_Click(object sender, EventArgs e)
        {
            int BID =0;
            for (int i = 0; i < dgwResult.RowCount; i++)
            {
                 if
(dgwResult.Rows[i].Cells[0].Value!=null&&(bool)dgwResult.Rows[i].Cells
[0].Value)
                 {
                     BID =
int.Parse(dgwResult.Rows[i].Cells[2].Value.ToString());
                 }
            }
            if (BID == 0)
            {
                 lblErrors.Text = "Make your choice";
                 return;
            }
            else
            {
                 MakeDeal md = new MakeDeal(UserID, BID);
                 md.Show();
            }
        }

        private void tbpM_Click(object sender, EventArgs e)
        {

        }
    }
}




                                   - 130 -
Make Deal

using   System;
using   System.Collections.Generic;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Linq;
using   System.Text;
using   System.Windows.Forms;

namespace Real_Estate
{
    public partial class MakeDeal : Form
    {
        static string USERID;
        static int BID;

          public DataTable dt;

          public MakeDeal(string uid,int bid)
          {
              USERID = uid;
              BID = bid;
              InitializeComponent();
          }

          private void MakeDeal_Load(object sender, EventArgs e)
          {
              dt = new DataTable();
              DBAccess dba = new DBAccess();
              dba.GetAllCustomer(dt, USERID);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++ )
                    comboBox1.Items.Add(dt.Rows[i][1].ToString() + " "
+ dt.Rows[i][2].ToString());
                comboBox1.SelectedIndex = 0;
            }
        }

          private void btnSubmit_Click(object sender, EventArgs e)
          {
              string[] names = comboBox1.SelectedItem.ToString().Split('
');
            int buyer = 0;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                 if (dt.Rows[i][1].ToString() == names[0] &&
dt.Rows[i][2].ToString() == names[1])
                     buyer = int.Parse(dt.Rows[i][0].ToString());
            }
            DBAccess dba = new DBAccess();
            int result=dba.MakeDeal(USERID,BID,buyer);
            dba.UpdateBui(BID,buyer);
            if (result == 1)
            {
                 lblErrors.Text = "Congratulation with new deal!";
            }
            else

                                      - 131 -
                  lblErrors.Text = "Error is occured. Try again!";
          }
    }
}


Deals
using   System;
using   System.Collections.Generic;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Linq;
using   System.Text;
using   System.Windows.Forms;

namespace Real_Estate
{
    public partial class Deals : Form
    {
        static string UserID = "";
        public DataTable dt4;

          public Deals(string uid)
          {
              UserID = uid;
              InitializeComponent();
          }

          private void Deals_Load(object sender, EventArgs e)
          {
              DBAccess dba = new DBAccess();
              dt4 = new DataTable();
              dba.GetAllDeals(dt4,UserID);
              if (dt4.Rows.Count > 0)
              {
                  for (int i = 0; i < dt4.Rows.Count; i++)
                  {
                      cmbSeller.Items.Add(dt4.Rows[i][0].ToString());
                      cmbBuyer.Items.Add(dt4.Rows[i][1].ToString());
                  }
                  cmbBuyer.SelectedIndex = 0;
                  cmbSeller.SelectedIndex = 0;
                  txtDate.Text = dt4.Rows[0][3].ToString();

                int[] IDs = new int[]
{int.Parse(dt4.Rows[0][2].ToString())};
                DataTable dt1 = new DataTable();
                dba.GetBuilByID(dt1, IDs);
                dataGridView1.DataSource = dt1;
                dataGridView1.Columns[0].Visible   =   false;
                dataGridView1.Columns[1].Visible   =   false;
                dataGridView1.Columns[2].Visible   =   false;
                dataGridView1.Columns[3].Visible   =   false;
            }

          }

        private void cmbSeller_SelectedIndexChanged(object sender,
EventArgs e)
        {

                                       - 132 -
            DBAccess dba = new DBAccess();
            DataTable dt = new DataTable();
            dba.GetAllDealsBySeller(dt, UserID,
cmbSeller.SelectedItem.ToString());

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < cmbBuyer.Items.Count; i++)
                {
                    if (cmbBuyer.Items[i].ToString() ==
dt.Rows[0][1].ToString())
                    {
                        cmbBuyer.SelectedIndex = i;
                        txtDate.Text = txtDate.Text =
dt.Rows[0][3].ToString();
                    }
                }
                int[] IDs = new int[]
{int.Parse(dt.Rows[0][2].ToString())};
                DataTable dt1 = new DataTable();
                dba.GetBuilByID(dt1, IDs);
                dataGridView1.DataSource = dt1;
                dataGridView1.Columns[0].Visible = false;
                dataGridView1.Columns[1].Visible = false;
                dataGridView1.Columns[2].Visible = false;
                dataGridView1.Columns[3].Visible = false;
            }
         }

        private void btnUpdate_Click(object sender, EventArgs e)
        {
            label2.Text = "";
            int bid=0;
            try
            {
                for (int i = 0; i < dt4.Rows.Count; i++)
                {
                    if (dt4.Rows[i][0].ToString() ==
cmbSeller.SelectedItem.ToString() &&
                        dt4.Rows[i][1].ToString() ==
cmbBuyer.SelectedItem.ToString() &&
                        dt4.Rows[i][3].ToString() == txtDate.Text)
                        bid = int.Parse(dt4.Rows[i][2].ToString());
                }
                DBAccess dba = new DBAccess();
                dba.UpdateBui(bid, 0);
                label2.Text = " Building is got free!";
            }
            catch
            {

            }
        }
    }
}




                                   - 133 -

								
To top