Professional Documents
Culture Documents
Technology
MANIPAL INSTITUTE OF TECHNOLOGY
(A constituent Institute of Manipal University)
MANIPAL - 576 104, KARNATAKA, INDIA
Project Title
Sensex Management
DOS: 07-05-2012
DBMS Mini-project
(BE IT)
Team Members:
CERTIFICATE
TITLE PAGE
NO.
I. Introduction
1. Abstract 1
II. Requirements
1. Data Requirements 2
2. Functional Requirements 5
3. Non Functional Requirements 7
III. Design
1. Relational Schema Diagram 8
2. ER Diagram 9
3. Functional Dependencies 10
4. Normalization 11
IV. Implementation
1. Code 13
V. Screenshots 25
VI. Conclusion 28
VII. Reference 29
SENSEX MANAGEMENT
Abstract
The application is made using C# and consists of a GUI. There will be many
forms which will serve the purposes of different functions and features to be
implemented. There will also be an option to sign up as a registered user.
Any query by a registered user will lead to changes in the database and will
be saved so that the user can track it even afterwards.
A user can access the database for different purposes like viewing the current
value of sensex or tracking any particular stock. A registered user will also
have an option to create his portfolio where he can keep a record of his
favourite stocks and can make changes to his profile. Any changes or query
made by such a user will update his portfolio and that will be in sync with
real time updates via internet. He/she will even be able to view the changes
in value of selected stocks as compared to previous day. A registered user
will have extra access to database as compared to unregistered users in
terms of maintaining customized portfolio, processing desired queries like
current value of stock, future Quarterly reports of the selected stock, highest
and lowest value of selected stock and many more. The updates will be taken
from the official Sensex website: http://bseindia.com/sensex/index.htm and other
websites whose addresses are given in references.
1
Data Requirements
Table: stock_info
Table: stock_id
2
Table: sensex_val
Table: login_details
3
Table: favourites
Table: user_status
4
FUNCTIONAL REQUIREMENTS
Interface Requirements:-
User Interface is there to provide communication between the user and the
system and our application also has communication between them. User
interface provides many functions to the user to select from and user based on
his/her requirements and needs selects one or the other. The various functions
provided by the system which the user can access are:-
Generic View: - This is the most basic feature which can be accessed by any
kind of user whether registered or unregistered. This is the function which will
be provided to the user when he/she opens the application. Under this, a user
can see sensex value, get basic knowledge about constituent 30 stocks and can
also read the news. He/she can also search a particular company by writing its
name or code in the box provided.
Registration: - A user who wishes to gain some extra facilities about sensex
and stock market can get registered and have his/her own portfolio created.
For registration a user needs to provide his/her email id, preferred password,
first name, last name, date of birth and gender. A confirmation code is sent to
the given email id to get it verified. After verification the user can login.
Login: - After the user gets registers, he selects the login option from the main
GUI. He/she has to provide email id, password and the code received in mail
box if he/she is logging in for the first time. If the credentials are correct then
user’s profile is displayed.
5
Portfolio: - After the user is logged in, the GUI displays the user’s first name
and he/she is shown extra buttons like Logout and view Portfolio. On clicking
view Portfolio, a new frame opens with new buttons like Edit Portfolio and
Back to Home. If the user has already created his/her portfolio then it will
display his/her favourite stocks with buying price, current price, quantity,
individual loss/gain in absolute as well as in terms of percentage. After clicking
Back to Home, the user returns to his/her default home page.
Edit Portfolio: - If the user has not created his portfolio yet then on clicking
Edit Portfolio button he/she can do this. After clicking the button, a new frame
opens with all the 30 stocks displayed in a tabular form. The user can select his
favourite by clicking on it and then providing its quantity in the box space
provided. A Save button is also there, clicking on which the portfolio is created.
6
Non Functional Requirements
I. Security:-
I.1. Login ID
Every registered user who uses the system shall have a Login ID and Password.
I.2. Modification
Any modification will be done only by registered user and will be synchronized with the real time
update via internet and portfolio will be immediately updated
II. Performance :-
II.3. Capacity
The application can support multiple users to get registered.
III. Maintainability:-
III.1. Back Up
All the data of the registered users are stored up in the database.
III.2. Errors
The application in designed in such a way that there is minimum scope of errors.
IV. Reliability:-
The system is very reliable because all the values are extracted from official website and other
reputed websites.
V. Availability:-
The system is available to the user 24 hours a day 7 days a week and 365 days a year.
VI. Usability:-
• The user must have some basic knowledge about Sensex and Stock Markets otherwise a
little training is required.
• The application is user friendly and self-explanatory.
VII. User Cost:-
The user can use this application free
7
RELATIONAL SCHEMA DIAGRAM
Stock_Id
Stock_Info
Scrip_Id
Scrip_Id
Date_Time Company_name
LTP
Change_Abs
Change_per
Favourites
Login_Details
Email_Id
Email_ID Scrip_Id
Password Qty
F_Name Buying_Price
L_name
DOB
Gender
User_Status
Email_Id
Code
Sensex_Val Status
Date_Time
Value
Change_sensex
Sensex_per
8
ER DIAGRAM
Stock_Id
Stock_Info
Scrip_Id Scrip_Id
Extract
Date_Time Company_details
LTP Company_name
Change_Abs
Change_per
Favourites
Retrieve
_LTP Email_Id
Scrip_Id
Qty
Buying_Price
Login_Details
Email_ID View
Password
F_Name
L_name
DOB
Gender
Authentication
User_Status
Email_Id
Code
Status
Sensex_Val
Date_Time
Value Sensex_
Retrieval
Change_sensex
Sensex_per
9
FUNCTIONAL DEPENDENCIES
1. STOCK_INFO Table
2. STOCK_ID Table
Scrip_Id Company_Name
3. Sensex_Val
4. Login_Details
5. User_Status
10
NORMALIZATION
STOCK
2NF Normalization
Stock_Info
Stock_ID
Scrip_Id Company_name
Sensex_Value
11
User
2NF Normailization
Login_Details
User_Status
Favourites
12
Form1.cs
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.Net;
using System.IO;
using System.Threading;
namespace SensexManager
{
public partial class Form1 : Form
{
String[] companyNames = { "Bajaj Auto", "Bharti Airtel", "BHEL", "Cipla",
"Coal India", "DLF", "Gail India", "HDFC", "HDFC Bank", "Hero MotoCorp", "Hindalco
Inds", "Hindustan Unilever", "ICICI Bank", "Infosys", "ITC", "Jindal Steel", "L&T",
"Mahindra & Mahindra", "Maruti Suzuki", "NTPC", "ONGC", "RIL", "SBI", "Sterlite Inds",
"Sun Pharma", "Tata Motors", "Tata Power", "Tata Steel", "TCS", "Wipro" };
public String username = "GUEST!";
System.Windows.Forms.Timer timer1;
String[][] cv;
String[] sv;
int tickTim = 0;
String tickText = "";
String email = "";
Boolean work = false;
public Form1()
{
//Loading ll = new Loading();
//ll.Show();
//this.Hide();
InitializeComponent();
reload_data();
label14.Text = username;
button1.Show();
button4.Hide();
textBox2.Text = tickText;
//ll.Close();
//this.Show();
label1.Text = sv[0];
label2.Text = sv[1];
label3.Text = sv[2];
label4.Text = sv[3];
label5.Text = sv[4];
label6.Text = sv[5];
label7.Text = sv[6];
if (!label2.Text.Equals(""))
{
if (double.Parse(label2.Text) <= 0)
pictureBox1.Hide();
else
pictureBox2.Hide();
}
else
label2.Text = "0.00";
tickText = "";
for (int i = 0; i < 30; i++)
{
String spac = " ";
String cn = companyNames[i];
for (; cn.Length < 30; cn += spac) ;
obc.Add(cn + cv[i][1]);//cv[i]);
tickText += companyNames[i] + " " + cv[i][1] + " ";
}
textBox2.Text = tickText;
}
});
bw.RunWorkerAsync();
//String[] cv = { "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
"0", "0", "0", };
cv = getCompanyValues();
}
catch (Exception ex)
{
//textBox2.Text = "Not connected to the internet!";
work = false;
}
}
downloadPage("http://www.bseindia.com/mktlive/indiceswatch_scrip.asp?iname=BSE30&sensi
d=30&type=sens", "D:\\temp\\temp_web.html");
String s = returnStringFromFile("D:\\temp\\temp_web.html");
return temp;
}
public static String[] getSensexValues()
{
String[] temp = new String[7];
downloadPage("http://www.moneycontrol.com/sensex/bse/sensex-live",
"D:\\temp\\temp_web.html");
String s = returnStringFromFile("D:\\temp\\temp_web.html");
return temp;
}
public static String[] extractValue(String source, String stkey, String
endkey, int limit)
{
String[] temp = new String[limit + 1];
int top = 0;
for (int i = 0, j = 0; i < source.Length && j < limit; j++)
{
int stind = source.IndexOf(stkey, i);
if (stind == -1)
break;
int diff = source.IndexOf(endkey, stind + 2) - stind - stkey.Length;
String extract = source.Substring(stind + stkey.Length, diff);
temp[++top] = extract;
i = stind + stkey.Length + 3;
}
temp[0] = top.ToString();
return temp;
}
public static Boolean downloadPage(String url, String path)
{
try
{
WebClient client = new WebClient();
client.DownloadFile(url, path);
}
catch (Exception e)
{
return false;
}
return true;
}
public static String returnStringFromFile(String path)
{
try
{
StreamReader sr = new StreamReader(path);
String temp = sr.ReadToEnd();
sr.Close();
return temp;
}
catch (Exception e)
{
return null;
}
}
}*/
}
}
SignIn.cs
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;
using System.Threading;
using Oracle.DataAccess.Client;
namespace SensexManager
{
public partial class SignIn : Form
{
private Form1 form1 = null;
public SignIn()
{
InitializeComponent();
}
dt = ds.Tables[0];
String pass = (dt.Rows[0]["password"]).ToString();
uname = (dt.Rows[0]["fname"]).ToString();
if (pass.Equals(textBox2.Text))
password = true;
else
password = false;
}
if (password)
{
if (code)
{
form1.username = uname;
form1.updateUser(textBox1.Text);
form1.Show();
this.Close();
}
else
label4.Text = "Click on \"Enter Code\" for verifying your code.";
}
else
label4.Text = "Sorry, the details don't match";
}
Register.cs
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;
using System.Net.Mail;
using Oracle.DataAccess.Client;
namespace SensexManager
{
public partial class Register : Form
{
private Form1 form1;
public Register()
{
InitializeComponent();
}
load();
conn.Close();
load2();
conn.Close();
ValidateCode.cs
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 Oracle.DataAccess.Client;
namespace SensexManager
{
public partial class ValidateCode : Form
{
SignIn si;
if (code.Equals(textBox2.Text))
chk = true;
else
chk = false;
}
this.Hide();
si.Show();
si.updatelabel("Code Confirmed.");
this.Close();
}
}
}
MsgCodeSent.cs
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 SensexManager
{
public partial class MsgCodeSent : Form
{
Form1 f1;
public MsgCodeSent(Form1 f1)
{
InitializeComponent();
this.f1 = f1;
}
The application is very practical and simple to run and use. In today’s time when personal
finance is so much important that everyone needs to be updated about stock market and its
day to day happenings, this application can prove to be very handy to the user in terms of
keeping track of favourite stocks and virtual loss or gain. It also satisfies security concerns as
it is based on email id, password and one time verification code.
We hope the application ends up giving a nice experience to every user and has no fatal
errors and any severe drawback. Any suggestion or feedback is eagerly awaited by us.
28
REFERENCES
The following references helped immensely in gathering information about the project and
its creation. The application accesses them to update and retrieve the values of sensex and
its individual stock. All the references provided below may not have explicit use in the
application or for the user but were visited numerous times by the developers during the
development of the project for different information and knowledge. If any reference is
missed in the list below it is deeply regretted. The references are as follows:-
http://en.wikipedia.org/wiki/BSE_SENSEX
http://en.wikipedia.org/wiki/Bombay_Stock_Exchange
www.bseindia.com/sensex/index.htm
http://www.bseindia.com/stockinfo/indices.aspx
http://www.bseindia.com/
http://www.bseindia.com/sensex/mktwatchR.aspx?filter=gainer*all$all$
http://www.bseindia.com/about/abtip.asp
http://www.bseindia.com/mktlive/adv_dec/advdec.asp
http://www.bseindia.com/sensex/groupvols.aspx
http://www.bseindia.com/sensex/groupvals.aspx
http://www.bseindia.com/deri/HotLinks/Notices.aspx?L=2&id=hd3&Lid=0
http://www.bseindia.com/deri/HotLinks/DeriHistorical.aspx?L=2&id=hd4&Lid=0
http://www.bseindia.com/about/list_comp.asp
http://www.bseindia.com/about/datal/change/changes.asp
http://www.bseindia.com/ipo/schema.asp
http://www.bseindia.com/mktlive/contactinformation.asp
http://www.bseindia.com/about/illiquidscrips.asp
http://www.bseindia.com/tagcloud/mktgalaxy.aspx
http://www.moneycontrol.com/stocksmarketsindia/
http://www.moneycontrol.com/sensex/bse/sensex-live
http://www.moneycontrol.com/earnings/
http://www.moneycontrol.com/stocks/marketstats/index.php
http://www.moneycontrol.com/mccode/tools/
http://poweryourtrade.moneycontrol.com/plus/login/login.php
30