Boğaziçi University
Boğaziçi University
Department of Management Information Systems
MIS 463 Decision Support Systems for Business
PROJECT FINAL REPORT
CREATE YOUR SMARTPHONE MOSAIC
Project Team No: 3
Zeynep AKIN
Ali İhsan HAVAN
Büşra KOTENOĞLU
Kadir ŞAHİN
Instructor: Aslı Sencer ERDEM
İstanbul - December, 2011
Index
I. INTRODUCTION 3
I.1 The Decision Environment 3
I.2 Mission of Project 5
I.3 Scope of Project 5
I.4 Methodology 6
II. LITERATURE SURVEY 7
II.1.Concept of philosophy of DSS 7
II.ponent of DSS 8
II.3.Types of DSS 10
II.4.Uses and Applications of AHP 11
II.5.Past AHP Examples 11
II.6.Smartphone Literature 12
II.7.Questionnaire and Interviews: 16
III. DEVELOPMENT OF THE DSS 27
III.1. DSS Architecture – Criteria Tree 27
III.1.1 AHP Criteria Calculation 28
III.2. Technical Issues 36
III.3. Model and Algorithms 37
III.3.1Data Source and Flow Mechanisms 42
III.4. User Interface and Reports 43
III.4.1.Welcome Page: 45
III.4.2.Smartphone selection- Filter Screens: 46
III.4.3.General Comparison: 47
III.4.4.Technical Comparison: 48
III.4.5.Multimedia Standard Comparison: 49
III.4.6.Style comparison: 50
III.4.7.Social Networking Options: 51
III.4.8.Operating System Speed Comparison: 52
III.4.9.Application World Richness: 53
III.4.10.Alternative Style Comparison: 54
III.4.11.Result Page: 55
III.5 What-if Analysis 56
III.6 TESTING 57
III.7 ERROR MESSAGES 60
IV. ASSESSMENT 62
V. CONCLUSION 63
VI. MASTER PLAN: 64
VII. REFERENCES 65
Appendix 1: 68
Appendix 2: 70
Appendix 3: 71
Appendix 4: 72
Appendix 5: 80
I. INTRODUCTION
I.1 The Decision Environment
Nowadays, many people use smartphones and benefit from its services and applications. Because of growing demand for smartphones, almost all classical phone manufacturers started to develop smartphones. In the market of smartphones, there are countless brands and models.
In such environment, it is very difficult to choose an appropriate smartphone for personal use. People find themselves in a very complicated market and can not make the right choice. One of the biggest problems is that people choose a smartphone which will not meet their needs because of technical limitations. Another problem is that smartphones may not be appropriate to multimedia usage or gaming. This will now satisfy people who wanted to spent free times playing games in his or her business travels.
There is so much information to compare and decide which smartphone is the most appropriate to users’ needs and many people do not have adequate knowledge about what is going on in mobile technology. For some reasons, they are not supposed to know everything. If they can point out their needs correctly, best solution in the market can be offered.
Within the current environment, customer is supposed to deliver his or her needs correctly to the supplier. He or she must decide which options and features of smartphones are beneficial for his/ her own interest. He or she may decide on brand, color or screen size. Even price range can be a constraint for a user. With the use of such a DSS system, users will be able to point out their constraints and interests, and then system offers the best solution that will meet the constraints and satisfy their needs and interests.
On the other point of view, this system will be beneficial for suppliers by pointing out the customers’ needs and interest. This will give the opportunity of producing, manufacturing or importing of smartphones that is demanded most.
It is very important for both parties to make good choices and make a profitable contract. Because of the nature of smartphones and their prices, replacing the smartphone with the new one costs high. According to the researches, average replacement time for mobile phones is 2.5 or 3 years.[1] Making a bad choice will result in high cost or continues user dissatisfaction.
In this DSS, users will be able to point out their needs to the system, and system will give the best solution for this time period. In addition to this the system will be able to offer smartphones hat will be introduced in near future.
Pointing meaningless, misleading or inappropriate is one of the biggest bottlenecks of the system. If cannot the deliver correct needs, system is vulnerable to offer not the best solution. In addition to this, outdated database of smartphones is another bottleneck. System’s database must be always updated and include latest technologies.
Current level of goal attainment:
Within the current system, users are supposed to search all smartphone models and find the best appropriate one to his or her interests and needs. But it is almost impossible to follow up all new technologies and technical specifications. Even though a person has the knowledge of everything about smartphones, comparing these features and technical specifications will be very time consuming.
The sensitivity of the decision to certain input parameters and risks:
Smartphone market is very competitive in these days. It is very important to make right choice and buy the smartphone that will serve many years. It can be very costly to select the not best one. Replacement costs can be high and user dissatisfaction appears in this situation.
For example, giving the right input parameters like multimedia, social networking, etc. but forgetting to say “e-mail server” will most likely to have problems in the near future. Like in this scenario, deciding on constraints is very important and risky. Also, giving so much information and not offering space to the system in order to be able to offer a product is problematic.
The decision is also very sensitive to price range. Because that most smartphone categorized into different groups, price range will most likely to exclude numerous products. Price range is another very important input parameter for decision.
The significance of the problem and the necessity of a computerized information system for decision support:
With the use of technology, computers are able to support our decisions by taking inputs. In this scenario, people are not able to compare all possible choices by themselves. Even though they have enough knowledge about smartphones, it is almost impossible to have enough time to compare all the technical stuffs.
It can be very helpful for people to compare smartphones according to users’ needs and interest, and then offer some options with the scores. This will reduce the time that is spent on research and money that is spent on wrong choices.
In such a system that offer appropriate smartphones,
• Users are able to eliminate all other options that are not matched with their needs.
• Users can compare the offered products.
• Users can also see trends among their segment (such as age, income, education, etc.)
• Suppliers can do market searches according to usage rates and trends.
I.2 Mission of Project
Mission:
The mission is to provide systematic service to customers in respect of the most appropriate smartphone purchases for personal usage.
Goals:
To integrate a computerized system into the business and respond to the expectations in a better way by:
| | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | |
|[pic] |[pic] |
|[pic] |[pic] |
III.6 TESTING
We tested each page according to their functionalities such as numerical, consistency, progress aspects etc…
|Name |Filter Page |
|Requirement | |
|Preconditions |User have to click Start button from Welcome page |
|Steps |Entering a character into Age Range combo-box |
| |Entering a character into Education Level combo-box |
| |Entering a character into Income Level combo-box |
| |Entering a character into Select Price Range combo-box |
| |Click Done button. |
|Expected Results |Verify that have selected brands more than 7 or less than 3 smartphones |
|Name |Alternative Selection Page that verifying selected brands are between 3 & 7 |
|Requirement | |
|Preconditions |User have to click Done button from Filter page |
|Steps |Select less than 3 smartphones |
| |Select more than 7 smartphones |
| |Click done button |
|Expected Results |1.Verify that have selected brands are between 3 and 7 |
| |2. If selected brands are not between 3 and 7, error message shows |
|Name |Criteria Comparison Page |
|Requirement | |
|Preconditions |User have to click Done button from Alternative Smartphone page |
|Steps |Entering a word or other characters which are not between -9 and 9 |
| |Entering nothing |
| |Click Next button |
|Expected Results |1.Verify that entered values are between -9 and 9 or null |
| |2. If entered values are not between -9 and 9, error message shows |
| |3.Controlling the entered values are consistent or not |
|Name |Technical Specifications Page |
|Requirement | |
|Preconditions |User have to click Next button from Criteria Comparison page |
|Steps |Entering a letter, a mark, punctuation or other characters which are not between -9 and 9 |
| |Entering nothing |
| |Click Next button |
|Expected Results |1.Verify that entered values are between -9 and 9 or null |
| |2. If entered values are not between -9 and 9, error message shows |
| |3.Controlling the entered values are consistent or not |
|Name |Multimedia Standards Page |
|Requirement | |
|Preconditions |User have to click Next button from Technical Specifications page |
|Steps |Entering a letter, a mark, punctuation or other characters which are not between -9 and 9 |
| |Entering nothing |
| |Click Next button |
|Expected Results |1.Verify that entered values are between -9 and 9 or null |
| |2. If entered values are not between -9 and 9, error message shows |
| |3.Controlling the entered values are consistent or not |
|Name |Social Network Options Page |
|Requirement | |
|Preconditions |User have to click Next button from Style page |
|Steps |Entering a letter, a mark, punctuation or other characters which are not between -9 and 9 |
| |Entering nothing |
| |Click Next button |
|Expected Results |1.Verify that entered values are between -9 and 9 or null |
| |2. If entered values are not between -9 and 9, error message shows |
| |3.Controlling the entered values are consistent or not |
|Name |Operating System Speed Page |
|Requirement | |
|Preconditions |User have to click Next button from Social Network Options page |
|Steps |Entering a letter, a mark, punctuation or other characters which are not between -9 and 9 |
| |Entering nothing |
| |Click Next button |
|Expected Results |1.Verify that entered values are between -9 and 9 or null |
| |2. If entered values are not between -9 and 9, error message shows |
| |3.Controlling the entered values are consistent or not |
|Name |Application Network Richness Page |
|Requirement | |
|Preconditions |User have to click Next button from Operating System Speed page |
|Steps |Entering a letter, a mark, punctuation or other characters which are not between -9 and 9 |
| |Entering nothing |
| |Click Continue button |
|Expected Results |1.Verify that entered values are between -9 and 9 or null |
| |2. If entered values are not between -9 and 9, error message shows |
| |3.Controlling the entered values are consistent or not |
|Name |Alternative Style Comparison Page |
|Requirement | |
|Preconditions |User have to click Next button from Application World Richness page |
|Steps |Entering a letter, a mark, punctuation or other characters which are not between -9 and 9 |
| |Entering nothing |
| |Click Calculate button |
|Expected Results |1.Verify that entered values are between -9 and 9 or null |
| |2. If entered values are not between -9 and 9, error message shows |
| |3.Controlling the entered values are consistent or not |
III.7 ERROR MESSAGES
❖ In Alternative Selection page, if user selects less than 3 smartphones, system shows a message to inform user to select more than 3 smartphones.
[pic]
❖ In Alternative Selection page, if user selects more than 7 smartphones, system shows a message to inform user to select less than 7 smartphones.
[pic]
❖ If user enters a letter, a mark, punctuation or other characters which are not between -9 and 9, system shows a message to inform user.
[pic]
❖ Although user enters numbers which are between -9 and 9, given values are inconsistent system shows a message to inform user about inconsistency condition.
[pic]
IV. ASSESSMENT
At the beginning of the project we decided to solve our problem with AHP, we determined the Analytic Hierarchy Process (AHP) as our methodology in computerized system. However we have encouraged each other to obtain very comprehensive model, trying to solve the elements of Smartphone selection concept.
After delivering our project proposal, we have started to work every Saturdays or Sundays in Mecidiyeköy Roberts’ cafe firstly we discussed what our main goals are and made a plan. We achieved our milestones roughly in the following way: we get together, construct a framework and specify important points to complete the task, allocate tasks according to specialization areas of our team members, complete the remaining tasks individually and, at the end, assemble individual works together. This strategy powered our team since everybody was glad to contribute to the project in different times.
To speed up the connection between us and also to save the documents of our project in a shared group we used Facebook social network where we enjoyed the flexibility and availability of reaching data any time we want. We had the technical and modeling aspects to consider at the same time. Because of limited time we could not design our model at the first time in proper. Our scope was very large compared to our last model.
We prepared our project in spite of all limitation and constraints with VBA, AHP calculation to excel and Microsoft SQL Server, putting these on the system. Actually, we faced difficulties but this encouraged us to perform better on every task. We made a division of work and solved the problems one by one. We had a great opportunity of improving Visual Basic, AHP Calculation, Microsoft SQL Servers, Macros, Command Prompt, and especially how these platforms/tools were integrated, and were to be debugged as problems arise.
The best thing about our project team was diversity of our team members’ skills and specialization areas. As (Roosevelt, 2001) states higher levels of diversity lead to higher satisfaction and motivation and thereby to higher quality team output. However, integrating and matching tasks with members was very crucial. We think we succeeded this quite well.
V. CONCLUSION
We have processed on nearly same due time that is on the master plan. Firstly, we started to research about articles that indicates DSS, AHP model, the market of smart phone, user profile and some percentage of smart phone user and some features about smart phones. After collecting articles, we shared in the same portion of the number of articles. In the third step, we made a meeting and wrote the major part of literature review. By the way, we made an online survey that smart phone user and nonuser answered. For the following step, starting to development of the model was selected. We made a comprehensive study about how AHP model made and we drew some diagrams such as context diagram or use case diagram. Addition to these steps, we made our database system and put 48 smart phone models and features on database for now. We drew database diagram after entering the data of smart phones. When we came to the end, we put all of the data, diagrams, models, our literature review and survey results together and we finished the final report of the smart phone selection system. In the final point, we prepared our presentation of the final report.
VI. MASTER PLAN:
| | |MASTER PLAN | | | | |
| | | | | | | |
| | | | | | | | |
| |Project Code |03 | | | | | |
| |Project Title |Create |Your |Smartphone |Mosaic | | |
| |Team Members |Zeynep Akın |Büşra Kotenoğlu |Kadir Şahin |Ali İhsan Havan | | |
| | | | | | | | |
| |Phase |Planned |Actual |Complete% |Problems |
| | |Start |Finish |Start |Finish | | |
| |Team Formation |1 Oct |2 Oct |1 Oct |5 Oct |100 |--- |
| |Project Proposal |7 Oct |16 Oct |8 Oct |17 Oct |100 |--- |
| |Presentation |14 Oct |16 Oct |14 Oct |17-19 Oct |100 |--- |
| |Literature Review (Library, Web, former studies) |20 Oct |6 Nov |22 Oct |8 Nov |100 |--- |
| |Interviews with experts, decision makers in the |27 Oct |6 Nov |2 Nov |14 Nov |100 |Instead of interviews, we conduct|
| |related area | | | | | |an online survey. |
| |Development of the model |10 Nov |19 Nov |14 Nov |19 Nov |100 |--- |
| |Mid-report |15 Nov |20 Nov | 15 Nov |21 Nov |100 |--- |
| |Presentation |18 Nov |20 Nov | 19 Nov |21-23 Nov |100 |--- |
| |Data Collection and Organization |24 Nov |4 Dec |25 Nov |5 Dec |100 |--- |
| |Coding interfaces |5 Dec |19 Dec |6 Dec |20 Dec |100 |--- |
| |Validation (Optional) |12 Dec |19 Dec |12 Dec |20 Dec |100 |--- |
| |Final Report |18 Dec |21 Dec |20 Dec |26 Dec |100 |--- |
| |Presentation |22 Dec |25 Dec |23 Dec |28 Dec |100 |--- |
| | | | | | | |---- |
| | | | | | | | | |
VII. REFERENCES
1. Aaron S. (2011), "Smartphone Adoption and Usage"
2. Arthur,C. (2011), "How The Smartphone is Killing PC".
3. Atthirawong, W., McCarthy, B. (2002). "An Application of the Analytical Hierarchy Process to International Location Decision-Making". In Gregory, Mike. Proceedings of The 7th Annual Cambridge International Manufacturing Symposium: Restructuring Global Manufacturing. Cambridge, England: University of Cambridge. pp. 1-18.
4. BBC news, (2011),"Third of adults 'use smartphone' says Ofcom report"
5. Berrittella, M.; Certa, A.; Enea, M.; Zito, P. (2007), "An Analytic Hierarchy Process for the Evaluation of Transport Policies to Reduce Climate Change Impacts". Fondazione Eni Enrico Mattei (Milano).
6. Butcher, D. (2011), "More than half of smartphone owners use mobile devices in retail stores." study, iModerate Research Technologies, Chadwick Martin Bailey: USA
7. Cheng, J. (2011), "28% of US smartphone owners use them as the Primary Net Connection.",
8. Davie, E.(2011), " Learning From the Digital Jugglers: New Trends in Smartphone Adoption and Usage Patterns, User Insight Lead, Fjord." London.
9. Dey, P. K. (2003), "Analytic Hierarchy Process Analyzes Risk of Operating Cross-Country Petroleum Pipelines in India". Natural Hazards Review 4 (4): 213-221.
10. Eleanor, D. (2011), "LEARNING FROM THE DIGITAL JUGGLERS: NEW TRENDS IN SMARTPHONE ADOPTION AND USAGE PATTERNS"
11. Forman, E. H., Saul I. G. (2001), "The analytical hierarchy process-anexposition". OperationsResearch 49 (4):469-487.
12. Gorry, A., Scott, M. M. (1971). A Framework for Management Information Systems. Sloan Management Review, 50-70.
13. Grandzol, J. R. (2005), "Improving the Faculty Selection Process in Higher Education: A Case for the Analytic Hierarchy Process" (PDF). IR Applications 6.
14. Ingrid, L. (2011), "Smartphone Usage Up 60 Percent; Android Makes Biggest Gain"
15. Keen, P. G. W. (1978), Decision support systems: an organizational perspective, Addison-Wesley Retrieved November 8, 2009 from:
16. Keen, P., Scott, M. M. (1978), "Decision Support Systems: An Organizational Perspective." Reading, USA: Addison-Wesley Publishing.
17. McCaffrey, J. (2005), "Test Run: The Analytic Hierarchy Process". MSDN Magazine. Retrieved2007-08-21.
18. Olivarez,N., Giles - Los Angeles Times Nielsen research group (2011) "Smartphone sales surpass sales of other mobile phones"
19. Outing S. (2010), "Smartphone User Survey: A glimpse into the mobile lives of college students"
20. Ozdağoğlu, A. , Ozdağoğlu, G. (2007), "Comparison of AHP and Fuzzy AHP for the Multicriteria Decision Making Processes with Linguistic Evaluations." Istanbul Ticaret Üniversitesi Fen Bilimleri Dergisi Yıl: 6 Say?:11Bahar 2007/1 s. 65-85.
21. Philippakis, A.S. (1988), "Structured What If Analysis in DSS Models.", Proc. of the Twenty-First Annual Hawaii Int. Conf. on System.
22. Power, D. J. (2002), "Decision Support Systems: Concepts and Resources for Managers.", Westport, CT: Greenwood/Quorum Books.
23. Power, D. J. (2000), "Decision Support Systems Hyperbook." Cedar Falls, IA: , HTML version, accessed on (today's date) at URL .
24. Rao, L. (2011), " Google Survey: 39 Percent Of Smartphone Owners Use Their Devices In The Bathroom"
25. Roosevelt, T. R. (2001), "Management of Diversity" Gabler, Wiesbaden.
26. Saaty, R. (2009), "Participant Names and Papers". Proceedings of the 10th International Symposium on the Analytic Hierarchy/Network Process. Pittsburgh, Pennsylvania.
27. Saaty, T. L., Peniwati, K. (2008), "Group Decision Making: Drawing out and Reconciling Differences.", Pittsburgh, Pennsylvania: RWS Publications.
28. Simon, H. A. (1960), "The New Science of Management Decision.", New York, USA: Harper Brothers.
29. Smith, A. (2011), "Smartphone Adoption and Usage, Pew Internet and American Life Project.”, USA.
30. Steiguer, J.E.; Duberstein,J.; Lopes,V. (2003), "The Analytic Hierarchy Process as a Means for Integrated Watershed Management". In Renard, Kenneth G.. First Interagency Conference on Research on the Watersheds. Benson, Arizona: U.S. Department of Agriculture, Agricultural Research Service. pp. 736-740.
31. Swallow, E. (2011), "Are Smartphones Taking Over Our Lives?"
32. Weber,E.S., Konsynski,B. R. (1988), "Problem Management: Neglected Elements in Decision Support Systems." J. of Management Information Systems 4(3): 64-81
33. Wolfe,A. (2008), "Is The Smartphone Your Next Computer?"
Appendix 1:
[pic]
[pic]
[pic]
[pic]
[pic]
[pic]
Appendix 2:
Figure 1 It shows the main objectives and goals of the smart phone selection system. 5
Figure 2 DSS Vision 7
Figure 3 DSS identifier 7
Figure 4 DSS Architecture 7
Figure 5 DSS Elements 8
Figure 6 DSS and MIS connection 9
Figure 7 DSS Capabilities 10
Figure 8 Smart phone usage 12
Figure 9 Smartphone operating System 13
Figure 10 Smart phone MB Usage 14
Figure 11 Smartphone data usage 14
Figure 12 Smart phone usage area 15
Figure 13 Criteria Tree of Smartphone Selection system 27
Figure 14 Database Design 37
Figure 15 Context Diagram 38
Figure 16 Level O diagram 39
Figure 17 Use Case Diagram 40
Figure 18 Screen shot of Genel Comparison Page 41
Figure 19 Screen Shot of Alternative Style comparison Page 41
Figure 20- Usability and Iteration 43
Figure 21 First page of Smartphone selection system. 44
Figure 22 Filter Pages of Smartphone selection system 45
Figure 23 General Comparison Page of Smart Phone Selection system. 46
Figure 24 Technical Specifications Page of Smart Phone Selection system. 47
Figure 25 Multimedia Standards Comparison Page of Smart Phone Selection system. 48
Figure 26 Style Score Page of Smart Phone Selection system. 49
Figure 27 Social Network Options Comparison Page of Smart Phone Selection system. 50
Figure 28 Operatins System Speed Comparison Page of Smart Phone Selection system. 51
Figure 29 Application World Richness Page of Smart Phone Selection system. 52
Figure 30 Alternative Style Comparison Page of Smart Phone Selection system. 53
Figure 31 Result Page of Smart Phone Selection system. 55
Appendix 3:
Table 1 Main Criteria Calculation 28
Table 2 Main Criteria Calculation 28
Table 3 Main Criteria Consistency Calculation 28
Table 4 Sub criteria Calculation Application World 29
Table 5 Sub criteria Calculation Application World 29
Table 6 Sub criteria Consistency Calculation Application World 29
Table 7 Sub criteria Calculation Application World 29
Table 8 Sub criteria calculation for Multimedia standards 30
Table 9 Sub criteria calculation for Multimedia Standards 30
Table 10 Sub criteria Consistency calculation for multimedia standards 30
Table 11 Operating System Speed Calculation 31
Table 12 Operating System Speed Calculation 31
Table 13 Operating system Consistency Calculation 31
Table 14 Social Network Options Calculation 32
Table 15 Social Network Options Calculation 32
Table 16 Social Network Options Consistency Calculation 32
Table 17 Technical Specifications Calculation 33
Table 18 Technical Specifications Calculation 33
Table 19 Technical Specifications Consistency Calculation 33
Table 20 Priority Vector 34
Table 21General View of Scores 35
Table 22 Last scores of each smart phones 35
Table 23 Final Comparsion 35
Appendix 4:
1. FilterSmartphones
USE [DSS_Smartphone]
GO
/****** Object: StoredProcedure [dbo].[filterSmartphones] Script Date: 12/24/2011 00:06:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[filterSmartphones] (@Brands AS nvarchar(4000),@SmartphoneTypes AS nvarchar(4000),@PriceRangeId AS int)
AS
Declare @SQL AS nvarchar(4000)
BEGIN
Select * INTO #tmp
FROM (Select S.SmartphoneId,M.BrandId,S.ModelId,S.PriceRangeId,S.OperatingSystemId,S.SmartphoneTypeId
FROM Smartphones AS S
INNER JOIN Models AS M (NoLOCK) ON M.ModelId = S.ModelId
Where S.Active = 1)z
IF @Brands != 'ALL'
BEGIN
Set @SQL = 'DELETE FROM #tmp Where BrandId NOT IN ('+@Brands+')'
Exec (@SQL)
END
IF @SmartphoneTypes != 'ALL'
BEGIN
Set @SQL = 'DELETE FROM #tmp Where SmartphoneTypeId NOT IN ('+@SmartphoneTypes+')'
Exec (@SQL)
END
IF @PriceRangeId != -1
BEGIN
DELETE FROM #tmp Where PriceRangeId != @PriceRangeId
END
Select t.SmartphoneId,t.BrandId,B.Code,t.ModelId,M.[Description]
,t.PriceRangeId,t.OperatingSystemId
,t.SmartphoneTypeId,B.Code+' '+M.[Description] "Smartphone"
,''+Replace(B.Code,' ','+')+'+'+Replace(M.[Description],' ','+') "Link"
FROM #tmp AS t
INNER JOIN Brands AS B (NoLOCK) ON B.BrandId = t.BrandId
INNER JOIN Models AS M (NoLOCK) ON M.ModelId = t.ModelId
Drop table #tmp
END
2. FilterSmartphones2
USE [DSS_Smartphone]
GO
/****** Object: StoredProcedure [dbo].[filterSmartphones2] Script Date: 12/24/2011 00:07:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[filterSmartphones2] (@Smartphones AS nvarchar(4000))
AS
Declare @SQL AS nvarchar(4000)
BEGIN
Select * INTO #tmp
FROM (Select S.SmartphoneId,M.BrandId,S.ModelId,S.PriceRangeId,S.OperatingSystemId,S.SmartphoneTypeId
FROM Smartphones AS S
INNER JOIN Models AS M (NoLOCK) ON M.ModelId = S.ModelId
Where S.Active = 1)z
Set @SQL = 'DELETE FROM #tmp Where SmartphoneId NOT IN ('+@Smartphones+')'
Exec (@SQL)
Select t.SmartphoneId,t.BrandId
,B.Code,t.ModelId,M.[Description],t.PriceRangeId
,t.OperatingSystemId,t.SmartphoneTypeId,B.Code+' '+M.[Description] "Smartphone"
,''+Replace(B.Code,' ','+')+'+'+Replace(M.[Description],' ','+') "Link"
FROM #tmp AS t
INNER JOIN Brands AS B (NoLOCK) ON B.BrandId = t.BrandId
INNER JOIN Models AS M (NoLOCK) ON M.ModelId = t.ModelId
Drop table #tmp
END
3. getAgeRangeList
USE [DSS_Smartphone]
GO
/****** Object: StoredProcedure [dbo].[getAgeRangeList] Script Date: 12/24/2011 00:07:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[getAgeRangeList]
AS
BEGIN
Select AgeRangeId,[Description]
FROM AgeRanges
Where Active=1
Order By ListOrder
END
4. getBrandList
USE [DSS_Smartphone]
GO
/****** Object: StoredProcedure [dbo].[getBrandList] Script Date: 12/24/2011 00:09:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[getBrandList]
AS
BEGIN
Select BrandId,Code
FROM Brands
Where Active = 1
END
5. getEducationLevelList
USE [DSS_Smartphone]
GO
/****** Object: StoredProcedure [dbo].[getEducationLevelList] Script Date: 12/24/2011 00:09:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[getEducationLevelList]
AS
BEGIN
Select EducationLevelId,[Description]
FROM EducationLevels
Where Active=1
Order By ListOrder
END
6. getIncomeLevelList
USE [DSS_Smartphone]
GO
/****** Object: StoredProcedure [dbo].[getIncomeLevelList] Script Date: 12/24/2011 00:10:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[getIncomeLevelList]
AS
BEGIN
Select IncomeLevelId,[Description]
FROM IncomeLevels
Where Active=1
Order By ListOrder
END
7. getMainCriteriaList
USE [DSS_Smartphone]
GO
/****** Object: StoredProcedure [dbo].[getMainCriteriaList] Script Date: 12/24/2011 00:11:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[getMainCriteriaList]
AS
BEGIN
Select CriteriaId
,[Description]
FROM Criteria
Where Active = 1
Order By CriteriaId
END
8. getMainCriteriaListForPrint
USE [DSS_Smartphone]
GO
/****** Object: StoredProcedure [dbo].[getMainCriteriaListForPrint] Script Date: 12/24/2011 00:12:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[getMainCriteriaListForPrint]
AS
BEGIN
Select 0 "CriteriaId"
,'General Comparison' "Description"
UNION ALL
Select CriteriaId
,[Description]
FROM Criteria
Where Active = 1
END
9. getMobileScore
USE [DSS_Smartphone]
GO
/****** Object: StoredProcedure [dbo].[getMobileScore] Script Date: 12/24/2011 00:12:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[getMobileScore] (@SmartphoneId AS int)
AS
BEGIN
Select Score
FROM SmartphoneSubcriteriaScores
Where SmartphoneId = @SmartphoneId
END
10. getPriceRangesList
USE [DSS_Smartphone]
GO
/****** Object: StoredProcedure [dbo].[getPriceRangesList] Script Date: 12/24/2011 00:13:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[getPriceRangesList]
AS
BEGIN
Select NULL "PriceRangeId"
,'ALL' "Description"
UNION ALL
Select PriceRangeId,[Description]
FROM PriceRanges
Where Active = 1
END
11. getSmartphoneTypeList
USE [DSS_Smartphone]
GO
/****** Object: StoredProcedure [dbo].[getSmartphoneTypeList] Script Date: 12/24/2011 00:14:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[getSmartphoneTypeList]
AS
BEGIN
Select SmartphoneTypeId,[Description]
From SmartphoneTypes
Where Active = 1
END
12. getSubcriteriaList
USE [DSS_Smartphone]
GO
/****** Object: StoredProcedure [dbo].[getSubcriteriaList] Script Date: 12/24/2011 00:15:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[getSubcriteriaList](@CriteriaId int)
AS
BEGIN
Select SubCriteriaId
,Code
FROM Subcriteria
Where Active = 1
And CriteriaId = @CriteriaId
END
13. getSmartphoneUsageRates
USE [DSS_Smartphone]
GO
/****** Object: StoredProcedure [dbo].[getSmartphoneUsageRates] Script Date: 12/24/2011 00:15:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[getSmartphoneUsageRates] (@Type AS int,@Variable AS int)
AS
BEGIN
IF @Type = 1
BEGIN
Select TOP 3 B.[Code]+' '+M.[Description] "Smartphone"
FROM (Select SU.SmartphoneId
,Count(*) "Total"
FROM SmartphoneUsages AS SU
Where SU.AgeRangeId = @Variable
Group By SU.SmartphoneId)z
INNER JOIN Smartphones AS S (NoLOCK) ON S.SmartphoneId = z.SmartphoneId
INNER JOIN Models AS M (NoLOCK) ON M.ModelId = S.ModelId
INNER JOIN Brands AS B (NoLOCK) ON B.BrandId = M.BrandId
Order By z.Total DESC
END
IF @Type = 2
BEGIN
Select TOP 3 B.[Code]+' '+M.[Description] "Smartphone"
FROM (Select SU.SmartphoneId
,Count(*) "Total"
FROM SmartphoneUsages AS SU
Where SU.IncomeLevelId = @Variable
Group By SU.SmartphoneId)z
INNER JOIN Smartphones AS S (NoLOCK) ON S.SmartphoneId = z.SmartphoneId
INNER JOIN Models AS M (NoLOCK) ON M.ModelId = S.ModelId
INNER JOIN Brands AS B (NoLOCK) ON B.BrandId = M.BrandId
Order By z.Total DESC
END
IF @Type = 3
BEGIN
Select TOP 3 B.[Code]+' '+M.[Description] "Smartphone"
FROM (Select SU.SmartphoneId
,Count(*) "Total"
FROM SmartphoneUsages AS SU
Where SU.EducationLevelId = @Variable
Group By SU.SmartphoneId)z
INNER JOIN Smartphones AS S (NoLOCK) ON S.SmartphoneId = z.SmartphoneId
INNER JOIN Models AS M (NoLOCK) ON M.ModelId = S.ModelId
INNER JOIN Brands AS B (NoLOCK) ON B.BrandId = M.BrandId
Order By z.Total DESC
END
END
Appendix 5:
START
Public Class Start
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
FilterForm.Visible = True
Me.Visible = False
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Dispose()
End Sub
Private Sub Start_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
FILTER FORM
Public Class FilterForm
Dim dbcon As DBConnection = New DBConnection()
Dim opr As Operations = New Operations()
Public FilteredSmartphones As DataSet
Public AgeRange, IncomeLevel, EducationLevel As Integer
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FillControls()
End Sub
Private Sub FillControls()
'This private Function fills Comboxboxes and Listboxes.
lstBrand.ValueMember = "BrandId"
lstBrand.DisplayMember = "Code"
lstBrand.DataSource = dbcon.getBrandList().Tables(0)
lstSmartType.ValueMember = "SmartphoneTypeId"
lstSmartType.DisplayMember = "Description"
lstSmartType.DataSource = dbcon.getSmartphoneTypeList().Tables(0)
cbxPriceRanges.ValueMember = "PriceRangeId"
cbxPriceRanges.DisplayMember = "Description"
cbxPriceRanges.DataSource = dbcon.getPriceRangeList().Tables(0)
cbxAge.DataSource = dbcon.getAgeRangeList().Tables(0)
cbxAge.ValueMember = "AgeRangeId"
cbxAge.DisplayMember = "Description"
cbxIncome.DataSource = dbcon.getIncomeLevelList().Tables(0)
cbxIncome.ValueMember = "IncomeLevelId"
cbxIncome.DisplayMember = "Description"
cbxEducation.DataSource = dbcon.getEducationLevelList().Tables(0)
cbxEducation.ValueMember = "EducationLevelId"
cbxEducation.DisplayMember = "Description"
lstBrand.SelectedIndex = -1
lstSmartType.SelectedIndex = -1
End Sub
Private Sub btnDone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDone.Click
Dim Brands As String
Dim SmartphoneTypes As String
Dim PriceRange As Integer
'Gets selected values from comboxboxes
IncomeLevel = cbxIncome.SelectedValue
AgeRange = cbxAge.SelectedValue
EducationLevel = cbxEducation.SelectedValue
'End.
'Creates a string for SQL Query with the selected values of listboxes.
Brands = opr.createWhereString(lstBrand)
SmartphoneTypes = opr.createWhereString(lstSmartType)
If cbxPriceRanges.SelectedIndex = 0 Then
PriceRange = -1
Else
PriceRange = cbxPriceRanges.SelectedValue
End If
FilteredSmartphones = dbcon.getFilteredSmartphones(Brands, SmartphoneTypes, PriceRange)
'If filtered smartphone number greater than 7 than show alternative selection form,
'Otherwise opens criteria comperison form.
If FilteredSmartphones.Tables(0).Rows.Count < 3 Then
MsgBox("Alternative number is too low, please check your criteria...")
Else
If FilteredSmartphones.Tables(0).Rows.Count > 7 Then
Me.Visible = vbFalse
AlternativeSelection.Show()
Else
Me.Visible = vbFalse
CriteriaComparison.Show()
End If
End If
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Start.Dispose()
End Sub
Private Sub FilterForm_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
Start.Dispose()
End Sub
End Class
ALTERNATIVE SELECTION
Public Class AlternativeSelection
Dim dbcon As DBConnection = New DBConnection()
Dim opr As Operations = New Operations()
Private Sub AlternativeSelection_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'At load listbox is filled with filtered smartphone dataset.
lstSmartAlter.DataSource = FilterForm.FilteredSmartphones.Tables(0)
lstSmartAlter.ValueMember = "SmartphoneId"
lstSmartAlter.DisplayMember = "Smartphone"
End Sub
Private Sub btnDone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDone.Click
'If selected phone number between 3 and 7, then program overwrites these values to Filtered Smartphone dataset.
'Otherwise shows a message.
If lstSmartAlter.SelectedItems.Count = 3 Then
Dim s As String
'For newly selected phones, creates a new string and call another function to filter smartphones.
s = opr.createWhereString(lstSmartAlter)
FilterForm.FilteredSmartphones = dbcon.getFilteredSmartphones2(s)
CriteriaComparison.Show()
Me.Dispose()
ElseIf lstSmartAlter.SelectedItems.Count > 7 Then
MsgBox("Please select 7 smartphones at most..")
ElseIf lstSmartAlter.SelectedItems.Count < 3 Then
MsgBox("Please select 3 smartphones at least..")
End If
End Sub
Private Sub btnBackFilter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBackFilter.Click
FilterForm.Show()
Me.Dispose()
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Start.Dispose()
End Sub
Private Sub AlternativeSelection_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
Start.Dispose()
End Sub
End Class
CRITERIA COMPARISON
Public Class CriteriaComparison
Dim previoustab As Integer
Dim nexttab As Integer
Dim currenttab As Integer
Dim Panels() As System.Windows.Forms.Panel
Dim dbcon As DBConnection = New DBConnection()
Dim DSArray(6) As DataSet
Dim calc As Calculations = New Calculations()
Dim arrayList(6) As Array
Public priorityVectors(6) As Array
Dim CriteriaList As DataSet
Dim opr As Operations = New Operations()
Dim design As Design = New Design()
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'At load initiate values to navigation variables.
nexttab = 1
previoustab = 0
currenttab = 0
'Gets main criteria list from database.
CriteriaList = dbcon.getMainCriteriaListForPrint()
'Initiate panels to an array.
Panels = New Panel() {pnlMainCriteria, pnlTechnical, pnlMultimedia, pnlStyle, pnlSocial, pnlOperating, pnlApplication}
CreateControls()
ReturnStartScreen()
End Sub
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
'This function checks consistency of values and provide navigation.
Dim array As Double(,)
'According to the values in the textboxes, CreateArray function creates an array.
array = opr.CreateArray(DSArray(currenttab), Panels(currenttab))
array = pleteArray(array)
arrayList(currenttab) = array
'Checks consistency, if consistent calculates priority vector and put it in an array for further calculations.
'After calculation navigates to next panel.
If (calc.checkConsistency(array)) Then
Dim priority As Double()
priority = calc.calculatePriorityVector(array)
priorityVectors(currenttab) = priority
navigateNext(nexttab)
Else
MsgBox("Given Values are Inconsistent, Please Check Priority Values")
End If
End Sub
Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBack.Click
navigateBack(previoustab)
End Sub
Private Sub navigateNext(ByVal n As System.Object)
'This function show panels in the order of panel list.
'If last panel is shown, Next button is disabled and Continue button is enabled.
previoustab = currenttab
currenttab = nexttab
lblCriteria.Text = CriteriaList.Tables(0).Rows(currenttab).Item(1).ToString() + " - " + (currenttab + 1).ToString + "/" + CriteriaList.Tables(0).Rows.Count().ToString()
Panels(previoustab).Visible = False
Panels(currenttab).Visible = True
If currenttab < Panels.Length - 1 Then
nexttab = currenttab + 1
Else
btnNext.Enabled = False
btnContinue.Enabled = True
End If
btnBack.Enabled = True
End Sub
Private Sub navigateBack(ByVal p As System.Object)
'This function show preceding panel.
'If first panel is shown, Back button is disabled and Next button is enabled.
nexttab = currenttab
currenttab = previoustab
lblCriteria.Text = CriteriaList.Tables(0).Rows(currenttab).Item(1).ToString() + " - " + (currenttab + 1).ToString + "/" + CriteriaList.Tables(0).Rows.Count().ToString()
Panels(previoustab).Visible = True
Panels(nexttab).Visible = False
If currenttab > 0 Then
previoustab = currenttab - 1
Else
btnBack.Enabled = False
End If
btnNext.Enabled = True
btnContinue.Enabled = False
End Sub
Private Sub CreateControls()
'In order to design panels, combine two arrays and calls create design function.
For i = 0 To 6
DSArray(i) = New DataSet()
If i = 0 Then
DSArray(i) = dbcon.getMainCriteriaList()
ElseIf i < 3 Then
DSArray(i) = dbcon.getSubcriteriaList(i)
ElseIf i = 3 Or i > 3 Then
DSArray(i) = dbcon.getSubcriteriaList(i)
End If
design.createDesign(DSArray(i), Panels(i))
Next
End Sub
Private Sub resetButtonControls()
'Set enable property of buttons.
btnBack.Enabled = False
btnContinue.Enabled = False
btnNext.Enabled = True
btnReset.Enabled = True
End Sub
Public Sub ReturnStartScreen()
'Reset all buttons and panels to initial values.
nexttab = 1
previoustab = 0
currenttab = 0
lblCriteria.Text = CriteriaList.Tables(0).Rows(currenttab).Item(1).ToString() + " - " + (currenttab + 1).ToString + "/" + CriteriaList.Tables(0).Rows.Count().ToString()
pnlMainCriteria.Visible = True
pnlTechnical.Visible = False
pnlMultimedia.Visible = False
pnlSocial.Visible = False
pnlOperating.Visible = False
pnlApplication.Visible = False
pnlStyle.Visible = False
resetButtonControls()
End Sub
Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReset.Click
Me.resetPanels()
ReturnStartScreen()
End Sub
Private Sub btnBackFilter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBackFilter.Click
FilterForm.Show()
Me.Dispose()
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Start.Dispose()
End Sub
Public Sub resetPanels()
opr.resetPanels(Panels)
End Sub
Private Sub btnContinue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnContinue.Click
'This function handles last panel.
'Creates an array, calculate consistency and if consistent navigate to AlternativeStyleScore Form.
Dim array As Double(,)
array = opr.CreateArray(DSArray(currenttab), Panels(currenttab))
array = pleteArray(array)
If (calc.checkConsistency(array)) Then
Dim priority As Double()
priority = calc.calculatePriorityVector(array)
priorityVectors(currenttab) = priority
Me.Visible = vbFalse
AlternativeStyleScore.Show()
Else
MsgBox("Given Values are Inconsistent, Please Check Priority Values")
End If
End Sub
Private Sub CriteriaComparison_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
Start.Dispose()
End Sub
End Class
ALTERNATIVE STYLE SCORE
Public Class AlternativeStyleScore
Dim design As Design = New Design()
Dim SmartphoneList As DataSet
Dim dbcon As DBConnection = New DBConnection()
Dim calc As Calculations = New Calculations()
Dim opr As Operations = New Operations()
Public finalArray(,) As Object
Dim StyleScore() As Double
Private Sub AlternativeStyleScore_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SmartphoneList = FilterForm.FilteredSmartphones
CreateControls()
End Sub
Private Sub CreateControls()
design.createDesignForAlternative(SmartphoneList, pnlStyle)
End Sub
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
'Calculations are made under this function.
'Creates array to store score of the alternatives.
Dim ScoreArray(SmartphoneList.Tables(0).Rows.Count() - 1) As Double
Dim array As Double(,)
'For style score, creates an array from given values.
array = opr.CreateArray(SmartphoneList, pnlStyle)
array = pleteArray(array)
'If Consistent, creates a priority vector for style scores.
If (calc.checkConsistency(array)) Then
StyleScore = calc.calculatePriorityVector(array)
'Calculation are made under this loop.
For i = 0 To SmartphoneList.Tables(0).Rows.Count() - 1
Dim score As Double
Dim mobileScore As DataSet
'Gets subcriteria values of alternatives and sets it to a dataset for every alternative in Filtered Smartphone dataset.
mobileScore = dbcon.getMobileScore(SmartphoneList.Tables(0).Rows(i).Item(0))
'If no value is returned from database, it sets 0 for this alternative.
If mobileScore.Tables(0).Rows.Count() 0 Then
For i = 0 To lst.SelectedItems.Count - 1
Dim dt As DataRowView
dt = lst.SelectedItems.Item(i)
If lst.SelectedItems.Count = 1 Then
s = s + dt.Row(0).ToString()
ElseIf c = lst.SelectedItems.Count Then
s = s + dt.Row(0).ToString()
Else
s = s + dt.Row(0).ToString() + ","
End If
c += 1
Next
Else
'If nothing is selected, ALL is returned.
s = "ALL"
End If
Return s
End Function
Public Function CreateArray(ByVal ds As DataSet, ByVal panel As System.Windows.Forms.Panel) As Double(,)
'This function takes a panel and creates and array from textboxes in it.
Dim arr(ds.Tables(0).Rows.Count() - 1, ds.Tables(0).Rows.Count() - 1) As Double
Dim row, column As Integer
row = 0
column = 0
'Search for textboxes in a panel.
For i = 0 To panel.Controls.Item(0).Controls.Count() - 1
If (panel.Controls.Item(0).Controls.Item(i).GetType().ToString() = "System.Windows.Forms.TextBox") Then
'If reaches to end of the row, creates a new row in array.
If (i Mod ds.Tables(0).Rows.Count() = 0 And i 0) Then
row += 1
column = 0
End If
'Values are added to an array and this array is returned.
arr(row, column) = convertDoubleFromTextBox(panel.Controls.Item(0).Controls.Item(i).Text)
column += 1
End If
Next
Return arr
End Function
Private Function convertDoubleFromTextBox(ByVal str As String) As Double
'This function controls textbox text whether or not it is in specific range.
Select Case str
Case 1 To 9
Return Convert.ToDouble(str)
Case -1
Return 1
Case ""
Return 1
Case -2 To -9
Dim dbl As Double
dbl = Convert.ToDouble(str)
Return dbl
End Select
End Function
Public Function completeArray(ByVal arr As Double(,)) As Double(,)
'This function complete an array putting reversed values to missing ones.
Dim counter As Integer
counter = 1
For i = 0 To arr.GetLength(0) - 2
For j = 0 + counter To arr.GetLength(0) - 1
If (arr(i, j) < 0) Then
arr(j, i) = 0 - arr(i, j)
Else
arr(j, i) = 1 / arr(i, j)
End If
Next
counter += 1
Next
For i = 0 To arr.GetLength(0) - 1
For j = 0 To arr.GetLength(0) - 1
If (arr(i, j) < 0) Then
arr(i, j) = 1 / (0 - arr(i, j))
End If
Next
Next
Return arr
End Function
Public Sub resetPanels(ByVal panel() As Panel)
For i = 0 To panel.Length - 1
For j = 0 To panel(i).Controls.Item(0).Controls.Count - 1
If panel(i).Controls.Item(0).Controls.Item(j).GetType().ToString() = "System.Windows.Forms.TextBox" Then
panel(i).Controls.Item(0).Controls.Item(j).Text = ""
End If
Next
Next
End Sub
Public Function SortArray(ByVal arr(,) As Object) As Object(,)
'This function sorts two dimensional array.
'Final array is sorted in this function.
Dim array(,) As Object
array = arr
For i = 0 To array.GetLength(0) - 2
For j = i + 1 To arr.GetLength(0) - 1
If array(j, 2) > array(i, 2) Then
Dim brand, model, link, image As String
Dim score As Double
brand = array(i, 0)
model = array(i, 1)
score = array(i, 2)
link = array(i, 3)
image = array(i, 4)
array(i, 0) = array(j, 0)
array(i, 1) = array(j, 1)
array(i, 2) = array(j, 2)
array(i, 3) = array(j, 3)
array(i, 4) = array(j, 4)
array(j, 0) = brand
array(j, 1) = model
array(j, 2) = score
array(j, 3) = link
array(j, 4) = image
End If
Next
Next
Return array
End Function
End Class
DESIGN
Public Class Design
Public Sub createDesign(ByVal ds As DataSet, ByVal panel As System.Windows.Forms.Panel)
'This function automates the process of creating desing for panels.
Dim counter, counter2, c As Integer
counter = 2
counter2 = 1
c = 0
'Create two arrays for titles and one textbox for values.
Dim lblArray(ds.Tables(0).Rows.Count()) As Label
Dim lblArray2(ds.Tables(0).Rows.Count()) As Label
Dim txtArray(ds.Tables(0).Rows.Count() * ds.Tables(0).Rows.Count() - 1) As TextBox
Dim tblpanel As TableLayoutPanel = New TableLayoutPanel()
'According to criteria and subcriteria values, creates rows and columns of tablepanel.
tblpanel.RowCount = ds.Tables(0).Rows.Count() + 1
tblpanel.ColumnCount = ds.Tables(0).Rows.Count() + 1
tblpanel.Width = 1100
tblpanel.Height = 185
panel.Controls.Add(tblpanel)
'Initialize textboxes.
For i = 0 To txtArray.Length - 1
txtArray(i) = New TextBox()
txtArray(i).Width = 130
Next
'Put textboxes to Inner points of the table.
For i = 1 To ds.Tables(0).Rows.Count()
For j = 1 To ds.Tables(0).Rows.Count()
tblpanel.Controls.Add(txtArray(c), j, i)
c += 1
Next
counter += 1
Next
'Disable some textboxes.
For i = 0 To txtArray.Length - 1
If i Mod ds.Tables(0).Rows.Count() = 0 Then
For j = 0 To counter2 - 1
txtArray(i + j).Enabled = False
Next
counter2 += 1
End If
Next
'Initialize labels and insert them to outer points of the table panel.
For i = 0 To ds.Tables(0).Rows.Count() - 1
lblArray(i) = New Label()
lblArray(i).Text = ds.Tables(0).Rows(i).Item(1).ToString()
lblArray(i).Width = 130
lblArray2(i) = New Label()
lblArray2(i).Text = ds.Tables(0).Rows(i).Item(1).ToString()
lblArray2(i).Width = 130
tblpanel.Controls.Add(lblArray(i), 0, i + 1)
tblpanel.Controls.Add(lblArray2(i), i + 1, 0)
Next
End Sub
Public Sub createResultList(ByVal panel As System.Windows.Forms.Panel, ByVal arr As Object(,))
'Creates result page according to calculations.
Dim tblpanel As TableLayoutPanel = New TableLayoutPanel()
Dim lblArray(arr.GetLength(0) - 1) As Label
Dim lblArray2(arr.GetLength(0) - 1) As Label
Dim lnkArray(arr.GetLength(0) - 1) As LinkLabel
Dim rowstyle As RowStyle
tblpanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.InsetDouble
'Initialize table panel properties.
tblpanel.RowCount = arr.GetLength(0) - 1
tblpanel.ColumnCount = 3
tblpanel.Width = 320
tblpanel.Height = (arr.GetLength(0) * 20) + (arr.GetLength(0) * 4)
'Initialize sizes and styles.
For i = 0 To tblpanel.RowCount - 1
rowstyle = New RowStyle()
rowstyle.SizeType = SizeType.Absolute
rowstyle.Height = 20
tblpanel.RowStyles.Add(rowstyle)
Next
'Add table panel to the panel.
panel.Controls.Add(tblpanel)
'Insert values from final array.
For i = 0 To arr.GetLength(0) - 1
lblArray(i) = New Label()
'Brand and model label.
lblArray(i).Text = arr(i, 0).ToString() + " " + arr(i, 1).ToString()
lblArray(i).Width = 175
lblArray(i).Height = 20
lblArray2(i) = New Label()
'Calculated value label.
lblArray2(i).Text = "%" + (Math.Round(Convert.ToDouble(arr(i, 2)) * 100, 2)).ToString()
lblArray2(i).Width = 50
lblArray2(i).Height = 20
lnkArray(i) = New LinkLabel()
'Price Info label.
lnkArray(i).Text = "Price Info"
Dim link As LinkLabel.Link = New LinkLabel.Link
link.LinkData = arr(i, 3).ToString()
lnkArray(i).Links.Add(link)
lnkArray(i).Width = 60
lnkArray(i).Height = 20
AddHandler lnkArray(i).LinkClicked, AddressOf LinkClicked
'Add labels to table panel.
tblpanel.Controls.Add(lblArray(i), 0, i)
tblpanel.Controls.Add(lblArray2(i), 1, i)
tblpanel.Controls.Add(lnkArray(i), 2, i)
Next
End Sub
Public Sub createSegmentedResultList(ByVal panel As System.Windows.Forms.Panel, ByVal ds As DataSet)
'Create segmented result panels.
Dim tblpanel As TableLayoutPanel = New TableLayoutPanel()
Dim lblArray(ds.Tables(0).Rows.Count() - 1) As Label
Dim rowstyle As RowStyle
tblpanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.InsetDouble
tblpanel.RowCount = ds.Tables(0).Rows.Count()
tblpanel.ColumnCount = 1
tblpanel.Width = 120
If ds.Tables(0).Rows.Count() = 1 Then
tblpanel.Height = 26
Else
tblpanel.Height = (ds.Tables(0).Rows.Count() * 20) + (ds.Tables(0).Rows.Count() * 4)
End If
'Initialize sizes and styles.
For i = 0 To tblpanel.RowCount - 1
rowstyle = New RowStyle()
rowstyle.SizeType = SizeType.Absolute
rowstyle.Height = 20
tblpanel.RowStyles.Add(rowstyle)
Next
'Add table panel to the panel.
panel.Controls.Add(tblpanel)
'Add values to labels from dataset.
If ds.Tables(0).Rows.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count() - 1
lblArray(i) = New Label()
lblArray(i).Text = ds.Tables(0).Rows(i).Item(0).ToString()
lblArray(i).Width = 110
lblArray(i).Height = 20
tblpanel.Controls.Add(lblArray(i), 0, i)
Next
End If
End Sub
Public Sub createDesignForAlternative(ByVal ds As DataSet, ByVal panel As System.Windows.Forms.Panel)
'This function operates similar to createDesign, but this one creates design for alternative.
'Main difference is that this could include different row and column numbers.
Dim counter, counter2, c As Integer
counter = 2
counter2 = 1
c = 0
Dim lblArray(ds.Tables(0).Rows.Count()) As Label
Dim lblArray2(ds.Tables(0).Rows.Count()) As Label
Dim txtArray(ds.Tables(0).Rows.Count() * ds.Tables(0).Rows.Count() - 1) As TextBox
Dim tblpanel As TableLayoutPanel = New TableLayoutPanel()
tblpanel.RowCount = ds.Tables(0).Rows.Count() + 1
tblpanel.ColumnCount = ds.Tables(0).Rows.Count() + 1
tblpanel.Width = 1090
tblpanel.Height = 210
panel.Controls.Add(tblpanel)
For i = 0 To txtArray.Length - 1
txtArray(i) = New TextBox()
txtArray(i).Width = 130
Next
For i = 1 To ds.Tables(0).Rows.Count()
For j = 1 To ds.Tables(0).Rows.Count()
tblpanel.Controls.Add(txtArray(c), j, i)
c += 1
Next
counter += 1
Next
For i = 0 To txtArray.Length - 1
If i Mod ds.Tables(0).Rows.Count() = 0 Then
For j = 0 To counter2 - 1
txtArray(i + j).Enabled = False
Next
counter2 += 1
End If
Next
For i = 0 To ds.Tables(0).Rows.Count() - 1
lblArray(i) = New Label()
lblArray(i).Text = ds.Tables(0).Rows(i).Item(8).ToString()
lblArray(i).Width = 130
lblArray2(i) = New Label()
lblArray2(i).Text = ds.Tables(0).Rows(i).Item(8).ToString()
lblArray2(i).Width = 130
tblpanel.Controls.Add(lblArray(i), 0, i + 1)
tblpanel.Controls.Add(lblArray2(i), i + 1, 0)
Next
End Sub
Private Sub LinkClicked(ByVal sender As Object, ByVal e As System.EventArgs)
' Navigate to a URL.
System.Diagnostics.Process.Start(sender.Links.Item(0).LinkData.ToString())
End Sub
End Class
DB CONNECTION
Imports System.Data.SqlClient
Public Class DBConnection
Dim con As SqlConnection = New SqlConnection("Data Source=.\SQLExpress;Integrated Security=true; AttachDbFilename=|DataDirectory|\App_Data\DSS_Smartphone.mdf;User Instance=true;")
'Dim con As SqlConnection = New SqlConnection("Data source=Localhost;Initial Catalog=DSS_Smartphone;Integrated Security=SSPI")
Public Function getMainCriteriaList() As DataSet
'Gets Main Criteria List by calling "getMainCriteriaList" stored procedure and returns a dataset.
Dim ds1 As DataSet = New DataSet()
con.Open()
Dim cmd As SqlCommand = New SqlCommand("getMainCriteriaList", con)
mandType = CommandType.StoredProcedure
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(ds1)
con.Close()
Return ds1
End Function
Public Function getSubcriteriaList(ByVal CriteriaId As Integer) As DataSet
'Gets Sub Criteria List by calling "getSubcriteriaList" stored procedure and returns a dataset.
Dim ds1 As DataSet = New DataSet()
con.Open()
Dim cmd As SqlCommand = New SqlCommand("getSubcriteriaList", con)
mandType = CommandType.StoredProcedure
'Main criteriaId is provided to stored procedure.
Dim Param As SqlParameter = New SqlParameter("CriteriaId", CriteriaId)
Param.DbType = DbType.Int32
cmd.Parameters.Add(Param)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(ds1)
con.Close()
Return ds1
End Function
Public Function getBrandList() As DataSet
'Gets Brand List by calling "getBrandList" stored procedure and returns a dataset.
Dim ds1 As DataSet = New DataSet()
con.Open()
Dim cmd As SqlCommand = New SqlCommand("getBrandList", con)
mandType = CommandType.StoredProcedure
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(ds1)
con.Close()
Return ds1
End Function
Public Function getPriceRangeList() As DataSet
'Gets Price List by calling "getPriceRangesList" stored procedure and returns a dataset.
Dim ds1 As DataSet = New DataSet()
con.Open()
Dim cmd As SqlCommand = New SqlCommand("getPriceRangesList", con)
mandType = CommandType.StoredProcedure
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(ds1)
con.Close()
Return ds1
End Function
Public Function getSmartphoneTypeList() As DataSet
'Gets Smartphone Type List by calling "getSmartphoneTypeList" stored procedure and returns a dataset.
Dim ds1 As DataSet = New DataSet()
con.Open()
Dim cmd As SqlCommand = New SqlCommand("getSmartphoneTypeList", con)
mandType = CommandType.StoredProcedure
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(ds1)
con.Close()
Return ds1
End Function
Public Function getFilteredSmartphones(ByVal Brands As String, ByVal SmartphoneTypes As String, ByVal PriceRangeId As Integer) As DataSet
'Filters Smartphones according to parameters.
Dim ds1 As DataSet = New DataSet()
con.Open()
Dim cmd As SqlCommand = New SqlCommand("filterSmartphones", con)
mandType = CommandType.StoredProcedure
'Brand,SmartphoneType, and PriceRange is provided to stored procedure.
Dim Param As SqlParameter = New SqlParameter("Brands", Brands)
Dim Param2 As SqlParameter = New SqlParameter("SmartphoneTypes", SmartphoneTypes)
Dim Param3 As SqlParameter = New SqlParameter("PriceRangeId", PriceRangeId)
Param.DbType = DbType.String
Param2.DbType = DbType.String
Param3.DbType = DbType.Int32
cmd.Parameters.Add(Param)
cmd.Parameters.Add(Param2)
cmd.Parameters.Add(Param3)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(ds1)
con.Close()
Return ds1
End Function
Public Function getMobileScore(ByVal SmartphoneId As Integer) As DataSet
'Gets sub criteria values of a specific smartphone.
Dim ds1 As DataSet = New DataSet()
con.Open()
Dim cmd As SqlCommand = New SqlCommand("getMobileScore", con)
mandType = CommandType.StoredProcedure
Dim Param As SqlParameter = New SqlParameter("SmartphoneId", SmartphoneId)
Param.DbType = DbType.Int32
cmd.Parameters.Add(Param)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(ds1)
con.Close()
Return ds1
End Function
Public Function getFilteredSmartphones2(ByVal Smartphones As String) As DataSet
'Filter smartphones when user selects smartphones from alternative selection form.
Dim ds1 As DataSet = New DataSet()
con.Open()
Dim cmd As SqlCommand = New SqlCommand("filterSmartphones2", con)
mandType = CommandType.StoredProcedure
'Selected smartphone IDs are provided to stored procedure.
Dim Param As SqlParameter = New SqlParameter("Smartphones", Smartphones)
Param.DbType = DbType.String
cmd.Parameters.Add(Param)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(ds1)
con.Close()
Return ds1
End Function
Public Function getAgeRangeList() As DataSet
'Gets List of AgeRanges.
Dim ds1 As DataSet = New DataSet()
con.Open()
Dim cmd As SqlCommand = New SqlCommand("getAgeRangeList", con)
mandType = CommandType.StoredProcedure
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(ds1)
con.Close()
Return ds1
End Function
Public Function getIncomeLevelList() As DataSet
'Gets List of Income Levels.
Dim ds1 As DataSet = New DataSet()
con.Open()
Dim cmd As SqlCommand = New SqlCommand("getIncomeLevelList", con)
mandType = CommandType.StoredProcedure
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(ds1)
con.Close()
Return ds1
End Function
Public Function getEducationLevelList() As DataSet
'Gets List of Education Levels.
Dim ds1 As DataSet = New DataSet()
con.Open()
Dim cmd As SqlCommand = New SqlCommand("getEducationLevelList", con)
mandType = CommandType.StoredProcedure
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(ds1)
con.Close()
Return ds1
End Function
Public Function getSmartphoneUsageRates(ByVal Type As Integer, ByVal Variable As Integer) As DataSet
'Gets segmented results according to variables.
Dim ds1 As DataSet = New DataSet()
con.Open()
Dim cmd As SqlCommand = New SqlCommand("getSmartphoneUsageRates", con)
mandType = CommandType.StoredProcedure
'Type is about which segmented results are shown.
Dim Param As SqlParameter = New SqlParameter("Type", Type)
'Variable is the actual value of user such as "University".
Dim Param2 As SqlParameter = New SqlParameter("Variable", Variable)
Param.DbType = DbType.String
Param2.DbType = DbType.String
cmd.Parameters.Add(Param)
cmd.Parameters.Add(Param2)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(ds1)
con.Close()
Return ds1
End Function
Public Function getMainCriteriaListForPrint() As DataSet
Dim ds1 As DataSet = New DataSet()
con.Open()
Dim cmd As SqlCommand = New SqlCommand("getMainCriteriaListForPrint", con)
mandType = CommandType.StoredProcedure
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(ds1)
con.Close()
Return ds1
End Function
End Class
-----------------------
[1]
[2] Visual Basic (VB) is the third-generation event-driven programming language and integrated development environment (IDE) fromMicrosoft for its COM programming model. Visual Basic is designed to be relatively easy to learn and use.
[3] Microsoft SQL Server is a relational database server, developed by Microsoft: It is a software product whose primary function is to store and retrieve data as requested by other software applications, be it those on the same computer or those running on another computer across a network (including the Internet).
-----------------------
Figure 2 DSS Vision
Figure 3 DSS identifier
Figure 4 DSS Architecture
Figure 7 DSS Capabilities
Figure 8 Smart phone usage
Figure 9 Smartphone operating System
Figure 11 Smartphone data usage
Figure 12 Smart phone usage area
Table 1 Main Criteria Calculation
Table 2 Main Criteria Calculation
Table 3 Main Criteria Consistency Calculation
Table 4 Sub criteria Calculation Application World
Table 5 Sub criteria Calculation Application World
Table 6 Sub criteria Consistency Calculation Application World
Table 7 Sub criteria Calculation Application World
Table 10 Sub criteria Consistency calculation for multimedia standards
Table 20 Priority Vector
Figure 18 Screen shot of Genel Comparison Page
Figure 19 Screen Shot of Alternative Style comparison Page
Figure 20- Usability and Iteration
Schema 1
Figure 31 Result Page of Smart Phone Selection system.
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.