Upload
govindarajan-chittaranjan
View
77
Download
0
Embed Size (px)
Citation preview
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
SECTION 1: STRUCTURE CHARTS .....................................................................................................................7
BASIC DESIGN STRUCTURE ................................................................................................................................. 8
SECTION 2: C# PROGRAMMING CODES ...........................................................................................................9
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
CONCLUSION .................................................................................................................................................42
Page | 6
LIST OF FIGURES
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(); }
Page | 13
private void Art_Piece_Click(object sender, EventArgs e) { this.Hide(); ART_PIECE artp = new ART_PIECE(); artp.ShowDialog(); } private void Curator_Click(object sender, EventArgs e) { this.Hide(); Curators cus = new Curators(); cus.ShowDialog(); } private void Exit_Click(object sender, EventArgs e) { this.Close(); this.Dispose(); } } }
Page | 14
A R T P I E C E M E N U
Figure 4 ART PIECE 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 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(); }
Page | 15
private void Add_art_bt_Click(object sender, EventArgs e) { this.Hide(); Add_Art_Piece aps = new Add_Art_Piece(); aps.ShowDialog(); } private void Update_art_bt_Click(object sender, EventArgs e) { this.Hide(); Update_Artist_Piece upats = new Update_Artist_Piece(); upats.ShowDialog(); } private void Report_art_bt_Click(object sender, EventArgs e) { this.Hide(); Report_AP aprs = new Report_AP(); aprs.ShowDialog(); } private void Exit_art_bt_Click(object sender, EventArgs e) { this.Close(); this.Dispose(); MAIN_MENU mm = new MAIN_MENU(); mm.ShowDialog(); } private void Art_Piece_Load(object sender, EventArgs e) { } } }
Page | 16
A R T I S T M E N U
Figure 5 ARTIST 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 Artists : Form { public Artists() { InitializeComponent(); } private void Artists_Load(object sender, EventArgs e) { } private void Add_Artist_bt_Click(object sender, EventArgs e)
Page | 17
{ this.Hide(); Add_Artist adarts = new Add_Artist(); adarts.ShowDialog(); } private void Update_Artists_bt_Click(object sender, EventArgs e) { this.Hide(); Update_Artists uparts = new Update_Artists(); uparts.ShowDialog(); } private void Report_Artists_bt_Click(object sender, EventArgs e) { this.Hide(); Report_AT atrs = new Report_AT(); atrs.ShowDialog(); } private void button4_Click(object sender, EventArgs e) { this.Close(); this.Dispose(); MAIN_MENU mm = new MAIN_MENU(); mm.ShowDialog(); } } }
Page | 18
C U R A T O R M E N U
Figure 6 CURATOR 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 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(); }
Page | 19
private void Update_Curators_bt_Click(object sender, EventArgs e) { this.Hide(); Update_Curators upcus = new Update_Curators(); upcus.ShowDialog(); } private void Reports_Curators_bt_Click(object sender, EventArgs e) { this.Hide(); Report_CU curats = new Report_CU(); curats.ShowDialog(); } private void Exit_Curators_bt_Click(object sender, EventArgs e) { this.Close(); this.Dispose(); MAIN_MENU mm = new MAIN_MENU(); mm.ShowDialog(); } private void Curators_Load(object sender, EventArgs e) { } } }
Page | 20
A D D A R T P I E C E
Figure 7 ADD ART PIECE 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 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 = "";
Page | 21
ARTIST_NAME.Text = ""; ARTIST_ID.Text = ""; CURATOR_ID.Text = ""; CURATOR_NAME.Text = ""; ESTIMATED_PRICE.Text = ""; ART_TITLE.Focus(); } private void Add_Art_Piece_bt_Click(object sender, EventArgs e) { SqlConnection apcon = 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"); apcon.Open(); SqlCommand acmd = new SqlCommand("insert into ART_PIECE(ART_TITLE, ART_ID, ARTIST_NAME, ARTIST_ID, CURATOR_ID, CURATOR_NAME, ESTIMATED_PRICE, STATUS)values('"+ART_TITLE.Text+"','"+ART_ID.Text+"','"+ARTIST_NAME+"','"+ARTIST_ID.Text+"','"+CURATOR_ID.Text+"','"+CURATOR_NAME.Text+"','"+ESTIMATED_PRICE.Text+"')",apcon); acmd.ExecuteNonQuery(); apcon.Close(); MessageBox.Show(" ART PIECE Data Added "); } public static void main(string[] args) { Application.Run(new Add_Art_Piece() ); } private void Add_Art_Piece_Exit_bt_Click(object sender, EventArgs e) { this.Hide(); Art_Piece aps = new Art_Piece(); aps.ShowDialog(); } private void Add_Art_Piece_Load(object sender, EventArgs e) { } } }
Page | 22
A D D A R T I S T
Figure 8 ADD ARTIST 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 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)
Page | 23
{ Add_Artist_Name.Text = ""; Add_Artist_ID.Text = ""; Art_Title.Text = ""; Curator_Name_AT.Text = ""; Curator_ID.Text = ""; Add_Artist_Name.Focus(); } private void Add_Artist_bt_Click(object sender, EventArgs e) { SqlConnection acon = 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"); acon.Open(); SqlCommand cmd = new SqlCommand("insert into ARTISTS(ARTIST_NAME, ARTIST_ID, ART_TITLE, CURATOR_ID, CURATOR_NAME)values('"+Add_Artist_ID.Text+"','"+Add_Artist_Name.Text+"','"+Art_Title.Text+ "','"+Curator_ID.Text+"','"+Curator_Name_AT.Text+"')",acon); cmd.ExecuteNonQuery(); acon.Close(); MessageBox.Show("ARTIST Added"); } private void Add_Artist_Load(object sender, EventArgs e) { } } }
Page | 24
A D D C U R A T O R
Figure 9 ADD CURATOR 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 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)
Page | 25
{ Add_Curator_Name_CU.Text = ""; Add_Curator_ID_CU.Text = ""; Add_Artist_CU.Text = ""; Curator_COM.Text = ""; Add_Curator_Name_CU.Focus(); } private void Add_Curator_bt_Click(object sender, EventArgs e) { SqlConnection ccon = 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"); ccon.Open(); SqlCommand cmd = new SqlCommand("insert into CURATOR_AUTHENTIC_USERS(CURATOR_ID, CURATOR_NAME, USER_NAME, PASSWORD, ARTIST_ASSIGNED, CURATOR_COMMISSION) values ('"+Add_Curator_Name_CU.Text + "','" + Add_Curator_ID_CU.Text + "','"+Add_Artist_CU.Text+"','"+Curator_COM.Text+"')", ccon); cmd.ExecuteNonQuery(); ccon.Close(); MessageBox.Show("Record Added"); } private void Add_Curator_Exit_bt_Click(object sender, EventArgs e) { this.Hide(); Curators cus = new Curators(); cus.ShowDialog(); } private void Add_Artist_CU_TextChanged(object sender, EventArgs e) { } private void Add_Curator_Load_1(object sender, EventArgs e) { } } }
Page | 26
S E L L A R T P I E C E
Figure 10 SELL ART PIECE 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 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";
Page | 29
con.Open(); adap = new SqlDataAdapter("Select * from ARTISTS", con); ds = new System.Data.DataSet(); adap.Fill(ds); dataGridView1.DataSource = ds.Tables[0]; } catch (Exception ex) { MessageBox.Show("Error", ex.Message); } } private void Update_bt_Click(object sender, EventArgs e) { try { if (this.dataGridView1.SelectedRows.Count > 0) { dataGridView1.Rows.RemoveAt(this.dataGridView1.SelectedRows[0].Index); } MessageBox.Show("Record Deleted", "Update Artists", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception exp) { MessageBox.Show(exp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
Page | 30
U P D A T E A R T P I E C E
Figure 12 UPDATE ART PIECE 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_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];
Page | 31
} catch (Exception exp) { MessageBox.Show("Error", exp.Message); } } private void Update_Artist_Bt_Click(object sender, EventArgs e) { try { if (this.dataGridView1.SelectedRows.Count > 0) { dataGridView1.Rows.RemoveAt(this.dataGridView1.SelectedRows[0].Index); } //cmdbuilder = new SqlCommandBuilder(aadap); //aadap.Update(das, "Update Art Pieces"); MessageBox.Show("Record Deleted", "Update Art Pieces", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception exp) { MessageBox.Show(exp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
Page | 32
U P D A T E C U R A T O R
Figure 13 UPDATE CURATORS 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_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) {
Page | 33
MessageBox.Show("Error", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void Update_Curator_Exit_bt_Click(object sender, EventArgs e) { this.Hide(); Curators cus = new Curators(); cus.ShowDialog(); } private void button1_Click(object sender, EventArgs e) { try { if (this.dataGridView1.SelectedRows.Count > 0) { dataGridView1.Rows.RemoveAt(this.dataGridView1.SelectedRows[0].Index); } MessageBox.Show("Record Deleted", "Update Curators", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception exp) { MessageBox.Show(exp.Message,"Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { } } }
Page | 34
R E P O R T A R T P I E C 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.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(); }
Page | 35
} catch (Exception exp) // return error message on null { MessageBox.Show("Error : " + exp.Message); } } } }
Page | 36
R E P O R T A R T I S T
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(); }
Page | 37
} catch (Exception exp) // return error message on null { MessageBox.Show("Error : " + exp.Message); } } } }
Page | 38
R E P O R T C U R A T O R S
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(); }
Page | 39
} catch (Exception exp) // return error message on null { MessageBox.Show("Error : " + exp.Message); } } } }
RETURN
Page | 40
SECTION 3: DATA TABLES
Page | 41
D A T A S T R I N G S A N D T A B L E I D
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
Page | 43
THANK YOU
Page | 44