COMPUTERIZED GALLERY SYSTEMS BUSINESS SOLUTIONS DEVELOPMENT AMENDMENT REPORT VOLUME - 2 Project Assignment: System Analysis & Design Program Codes: C Sharp Montreal 2015 AUTHOR GOVINDARAJAN A CHITTARANJAN REVIEWED BY MR HAMID BENKHODJA DATE May 11, 2015
43
Embed
COMPUTERIZED GALLERY SYSTEMS Automation Project_CS_CODES_Govindarajan_A_Chittaranjan_APRIL2015
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
COMPUTERIZED GALLERY SYSTEMS
BUSINESS SOLUTIONS DEVELOPMENT AMENDMENT REPORT
VOLUME - 2
Project Assignment: System Analysis & Design
Program Codes: C Sharp
Montreal
2015
AUTHOR GOVINDARAJAN A CHITTARANJAN
REVIEWED BY
MR HAMID BENKHODJA
DATE May 11, 2015
ACKNOWLEDGMENTS
The Author wishes to acknowledge and appreciate valuable contributions from CGS
staff in Phase-II of current system analysis and development requirements to design
and develop a Business solution algorithm
The Author wishes to acknowledge the flexibility offered by the staff at CDI to access
resources and provide support to study, develop and document the assignment at
author’s own pace
The Author also wished to acknowledge the support and evaluation of Mr. Hamid
Benkhodja whose support and evaluation of the findings made it possible to produce
one of a kind quality report.
Last but never the least, the author wished to thank his family for being supportive
during the assignment process period
EXECUTIVE SUMMARY
CGS has a computerized business solution to keep track of Art works shown and
stored in its Gallery, The existing system facilitates real time file updating and tracking
protocols and it is accessed and processed from a single computer. CGS wished to
extend the existing system scope to maintain a unique file system for the Art pieces,
the Artists and the Curator, each identifiable by a unique key code for processing and
printing
The current scope of this report has evolved from the earlier model presented in
programming design logic Report dated 10th March 2015. The scope of this assignment
is to present the earlier logic in a programming language. C Sharp (#) in Visual Studios
2010 was used to develop the business solution application with a Login module to
authenticate valid users of this application listed as below
USER NAME PASSWORD
This is an Example (actual user name and password emailed
separately)
Curators and administration staff are assumed to be valid users of this application and
the codes were written to accommodate accordingly. Designer codes are published in
separate report
It is important to note that this report has evolved from the previous report I in the
sense that the screens were modified for user convenience but most of the logic
behind this project remains the same
This report pertains to assignment scope only and depicts the program logic by way of
a structure programming language coded in C# with uniform screen designs to
maintain professionalism. The picture-boxes of the menu screens and popular
paintings’ snap shots were used from public websites assuming no copy rights
violations as this report is intended for course assignment evaluation purpose only.
Microsoft’s Student Report template was used as the bases to hasten the
documentation process. Legends are not included in this report.
Page | 5
TABLE OF CONTENTS
ACKNOWLEDGMENTS ..................................................................................................................................... I
EXECUTIVE SUMMARY ................................................................................................................................... II
TABLE OF CONTENTS .......................................................................................................................................5
MAIN-ACCESS THROUGH USER AUTHENTICATION ......................................................................................... 10 DISPLAY MENU ................................................................................................................................................. 12 ART PIECE MENU .............................................................................................................................................. 14 ARTIST MENU ................................................................................................................................................... 16 CURATOR MENU .............................................................................................................................................. 18 ADD ART PIECE ................................................................................................................................................. 20 ADD ARTIST ...................................................................................................................................................... 22 ADD CURATOR .................................................................................................................................................. 24 SELL ART PIECE ................................................................................................................................................. 26 UPDATE ARTIST ................................................................................................................................................ 28 UPDATE ART PIECE ........................................................................................................................................... 30 UPDATE CURATOR ........................................................................................................................................... 32 REPORT ART PIECE ........................................................................................................................................... 34 REPORT ARTIST ................................................................................................................................................. 34 REPORT CURATORS .......................................................................................................................................... 38
SECTION 3: DATA TABLES ..............................................................................................................................40
DATA STRINGS AND TABLE ID .......................................................................................................................... 41
FIGURE 1 BASIC DESIGN STRUCTURE ........................................................................................................................ 8 FIGURE 2: CGS – LOGIN SCREEN FOR ACCESS TO MAIN APPLICATION ................................................................................. 10 FIGURE 3 MAIN MENU SCREEN ............................................................................................................................... 12 FIGURE 4 ART PIECE MENU SCREEN ........................................................................................................................ 14 FIGURE 5 ARTIST MENU SCREEN ............................................................................................................................. 16 FIGURE 6 CURATOR MENU SCREEN ........................................................................................................................ 18 FIGURE 8 ADD ART PIECE SCREEN ........................................................................................................................... 20 FIGURE 8 ADD ARTIST SCREEN ................................................................................................................................ 22 FIGURE 8 ADD CURATOR SCREEN ........................................................................................................................... 24 FIGURE 8 SELL ART PIECE SCREEN ........................................................................................................................... 26 FIGURE 9 UPDATE ARTISTS SCREEN ........................................................................................................................ 28 FIGURE 11 UPDATE ART PIECE SCREEN ................................................................................................................... 30 FIGURE 12 UPDATE CURATORS SCREEN ................................................................................................................. 32
Page | 7
SECTION 1: STRUCTURE CHARTS
Page | 8
B A S I C D E S I G N S T R U C T U R E
Figure 1 BASIC DESIGN STRUCTURE
Page | 9
SECTION 2: C# PROGRAMMING CODES
Page | 10
M A I N - A C C E S S T H R O U G H U S E R A U T H E N T I C A T I O N
Figure 2: CGS – Login Screen for access to Main Application
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.Data.SqlClient; namespace Main_CGS { public partial class CGS_Login : Form { public CGS_Login() { InitializeComponent(); textBox1.Text = ""; textBox2.Text = ""; } private void Clear_bt_Click(object sender, EventArgs e) { textBox1.Clear(); textBox2.Clear(); }
Page | 11
private void CGS_Login_Load(object sender, EventArgs e) { textBox1.Focus(); } private void Login_bt_Click(object sender, EventArgs e) { SqlConnection lg = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename='C:\Users\GC\Documents\Visual Studio 2010\Projects\Main_CGS\Main_CGS\CGS.mdf';Integrated Security=True;Connect Timeout=30;User Instance=True"); lg.Open(); SqlCommand cmd = new SqlCommand("select * from CURATOR_AUTHENTIC_USERS WHERE USER_NAME = '" + textBox1.Text + "' and PASSWORD = '" + textBox2.Text + "'", lg); SqlDataReader dt = cmd.ExecuteReader(); int count = 0; while (dt.Read()) { count += 1; } if (count == 1) { MessageBox.Show("OK"); MAIN_MENU mm = new MAIN_MENU(); mm.Show(); dt.Close(); lg.Close(); this.Hide(); } else { MessageBox.Show("Invalid USER NAME and PASSWORD"); } } private void Login_Exit_bt_Click(object sender, EventArgs e) { this.Close(); this.Dispose(); } private void Header_lbl_Click(object sender, EventArgs e) { } } }
Page | 12
D I S P L A Y M E N U
Figure 3 MAIN MENU SCREEN
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 Main_CGS { public partial class MAIN_MENU : Form { public MAIN_MENU() { InitializeComponent(); } private void Artist_Click(object sender, EventArgs e) { this.Hide(); Artists arts = new Artists(); arts.ShowDialog(); }
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 Main_CGS { public partial class Art_Piece : Form { public Art_Piece() { InitializeComponent(); } private void Sell_bt_Click(object sender, EventArgs e) { this.Hide(); Sell_Art_Piece apsel = new Sell_Art_Piece(); apsel.ShowDialog(); }
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 Main_CGS { public partial class Artists : Form { public Artists() { InitializeComponent(); } private void Artists_Load(object sender, EventArgs e) { } private void Add_Artist_bt_Click(object sender, EventArgs e)
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 Main_CGS { public partial class Curators : Form { public Curators() { InitializeComponent(); } private void Add_Curator_bt_Click(object sender, EventArgs e) { this.Hide(); Add_Curator cus = new Add_Curator(); cus.ShowDialog(); }
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.Data.SqlClient; namespace Main_CGS { public partial class Add_Art_Piece : Form { public Add_Art_Piece() { InitializeComponent(); } private void Add_Art_Piece_Clear_Click(object sender, EventArgs e) { ART_TITLE.Text = ""; ART_ID.Text = "";
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.Data.SqlClient; namespace Main_CGS { public partial class Add_Artist : Form { public Add_Artist() { InitializeComponent(); } private void Add_Artist_Exit_Click(object sender, EventArgs e) { this.Hide(); Artists arts = new Artists(); arts.ShowDialog(); } private void Add_Artist_Clear_Click(object sender, EventArgs e)
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.Data.SqlClient; namespace Main_CGS { public partial class Add_Curator : Form { public Add_Curator() { InitializeComponent(); } private void Add_Curator_Load(object sender, EventArgs e) { } private void Add_Curator_Clear_bt_Click(object sender, EventArgs e)
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 Main_CGS { public partial class Sell_Art_Piece : Form { public Sell_Art_Piece() { InitializeComponent(); } private void Sell_Art_Piece_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'cGSDataSet4.ART_PIECE' table. You can move, or remove it, as needed. this.aRT_PIECETableAdapter.Fill(this.cGSDataSet4.ART_PIECE); } private void Sell_bt_Click(object sender, EventArgs e) { // Event not required for this project but presented herewith float SP; float EP; SP = 0.00F; EP = 0.00F; SP = Int32.Parse(Sale_Price.Text); EP = Int32.Parse(listBox5.Text); //string Status = ""; if (SP > EP) { SqlConnection scon = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename='C:\Users\GC\documents\visual studio 2010\Projects\Main_CGS\Main_CGS\CGS.mdf';Integrated Security=True;User Instance=True"); scon.Open(); SqlCommand cmd = new SqlCommand("insert into ART_PIECE(SALE_PRICE)value('"+Add_Sale_Price.Text+"')", scon);
Page | 27
cmd.ExecuteNonQuery(); scon.Close(); MessageBox.Show(" Art Piece SOLD "); } else { MessageBox.Show("Not A Profitable Transaction, Selling Price less than Estimated"); } } private void Sell_Exit_bt_Click(object sender, EventArgs e) { this.Hide(); Art_Piece aps = new Art_Piece(); aps.ShowDialog(); } private void bindingSource1_CurrentChanged(object sender, EventArgs e) { } } }
Page | 28
U P D A T E A R T I S T
Figure 11 UPDATE ARTISTS SCREEN
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.Data.SqlClient; namespace Main_CGS { public partial class Update_Artists : Form { SqlConnection con; SqlDataAdapter adap; DataSet ds; public Update_Artists() { InitializeComponent(); } private void Update_Artist_Exit_bt_Click(object sender, EventArgs e) { this.Hide(); Artists arts = new Artists(); arts.ShowDialog(); } private void panel1_Paint(object sender, PaintEventArgs e) { } private void Update_Artists_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'cGSDataSet7.ARTISTS' table. You can move, or remove it, as needed. this.aRTISTSTableAdapter.Fill(this.cGSDataSet7.ARTISTS); try { con = new SqlConnection(); con.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename='C:\Users\GC\documents\visual studio 2010\Projects\Main_CGS\Main_CGS\CGS.mdf';Integrated Security=True;User Instance=True";
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.Data.SqlClient; namespace Main_CGS { public partial class Update_Artist_Piece : Form { SqlConnection acon; SqlDataAdapter aadap; DataSet das; //SqlCommandBuilder cmdbuilder; public Update_Artist_Piece() { InitializeComponent(); } private void Update_Art_Piece_Exit_bt_Click(object sender, EventArgs e) { this.Hide(); Art_Piece aps = new Art_Piece(); aps.ShowDialog(); } private void Update_Artist_Piece_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'cGSDataSet6.ART_PIECE' table. You can move, or remove it, as needed. this.aRT_PIECETableAdapter3.Fill(this.cGSDataSet6.ART_PIECE); try { acon = new SqlConnection(); acon.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename='C:\Users\GC\documents\visual studio 2010\Projects\Main_CGS\Main_CGS\CGS.mdf';Integrated Security=True;User Instance=True"; acon.Open(); aadap = new SqlDataAdapter("Select * FROM ART_PIECE", acon); das = new System.Data.DataSet(); aadap.Fill(das); dataGridView1.DataSource = das.Tables[0];
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.Data.SqlClient; namespace Main_CGS { public partial class Update_Curators : Form { SqlConnection ccon; SqlDataAdapter cadap; DataSet cds; //SqlCommandBuilder cmdbuilder; public Update_Curators() { InitializeComponent(); } private void Update_Curators_Load(object sender, EventArgs e) { this.cURATOR_AUTHENTIC_USERSTableAdapter.Fill(this.cGSDataSet10.CURATOR_AUTHENTIC_USERS); try { ccon = new SqlConnection(); ccon.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename='C:\Users\GC\documents\visual studio 2010\Projects\Main_CGS\Main_CGS\CGS.mdf';Integrated Security=True;User Instance=True"; ccon.Open(); cadap = new SqlDataAdapter("SELECT * FROM CURATOR_AUTHENTIC_USERS", ccon); cds = new System.Data.DataSet(); cadap.Fill(cds, "CURATORS"); dataGridView1.DataSource = cds.Tables[0]; } catch (Exception ex) {
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 Main_CGS { public partial class Report_AP : Form { public Report_AP() { InitializeComponent(); } private void Exit_Click(object sender, EventArgs e) // to Exit the Screen { this.Hide(); this.Dispose(); ArtPiece aps = new ArtPiece(); aps.ShowDialog(); } private void Report_AP_Load(object sender, EventArgs e) { string[] row; //initializing the variables row and listview ListViewItem lvi; try { StreamReader sr2 = new StreamReader(@"C:\VB2010_GC\Main_CGS\Main_CGS\Art_Piece.txt"); // specifing path and source String LineAC = sr2.ReadLine(); while (LineAC != null) // while text file rows are not empty perform addition of items into ListView columns into list View separated by "," for columns - via "for" loop {
row= LineAC.Split(','); lvi = new ListViewItem(row[0]); listView1.Items.Add(lvi); for (int i = 0; i < row.Length; i++) { lvi.SubItems.Add(row[i]); } LineAC = sr2.ReadLine(); }
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 Main_CGS { public partial class Report_AT : Form { public Report_AT() { InitializeComponent(); } private void Exit_Click(object sender, EventArgs e) // to Exit the Screen { this.Hide(); this.Dispose(); Artists aps = new Artists(); ats.ShowDialog(); } private void Report_AT_Load(object sender, EventArgs e) { string[] row; //initializing the variables row and listview ListViewItem lvi; try { StreamReader sr1 = new StreamReader(@"C:\VB2010_GC\Main_CGS\Main_CGS\Artist.txt"); // specifing path and source String LineAC = sr1.ReadLine(); while (LineAC != null) // while text file rows are not empty perform addition of items into ListView columns into list View separated by "," for columns - via "for" loop {
row= LineAC.Split(','); lvi = new ListViewItem(row[0]); listView1.Items.Add(lvi); for (int i = 0; i < row.Length; i++) { lvi.SubItems.Add(row[i]); } LineAC = sr1.ReadLine(); }
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 Main_CGS { public partial class Report_CU : Form { public Report_CU() { InitializeComponent(); } private void Exit_Click(object sender, EventArgs e) // to Exit the Screen { this.Hide(); this.Dispose(); Curators aps = new Curators(); aps.ShowDialog(); } private void Report_CU_Load(object sender, EventArgs e) { string[] row; //initializing the variables row and listview ListViewItem lvi; try { StreamReader sr3 = new StreamReader(@"C:\VB2010_GC\Main_CGS\Main_CGS\Curators.txt"); // specifing path and source String LineAC = sr3.ReadLine(); while (LineAC != null) // while text file rows are not empty perform addition of items into ListView columns into list View separated by "," for columns - via "for" loop {
row= LineAC.Split(','); lvi = new ListViewItem(row[0]); listView1.Items.Add(lvi); for (int i = 0; i < row.Length; i++) { lvi.SubItems.Add(row[i]); } LineAC = sr3.ReadLine(); }
A. ART PIECE DATA TABLE SQL STRING: Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\CGS.mdf;Integrated Security=True;User Instance=True TABLE NAME: ART_PIECE
B. ARTIST DATA TABLE SQL STRING: Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\CGS.mdf;Integrated Security=True;User Instance=True
TABLE NAME: ARTISTS
C. CURATORS / AUTHENTIC USERS DATA TABLE SQL STRING: Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\CGS.mdf;Integrated Security=True;User Instance=True TABLE NAME: CURATORS_AUTHENTIC_USERS
Page | 42
CONCLUSION
Presented herewith are the C Sharp programming codes for the system in brief and the
requirements to improve and develop business solutions for the Computerized Gallery
Systems by Object oriented approach to achieve the desired results
As stated earlier there are ample scopes for more detailed new system definition and design
that could be discussed and tasks could be assigned for further developments to optimize the
operational efficiency of Computerized Gallery Systems