Skip to content

Commit fe96f84

Browse files
committed
Merge branch 'V_1.0_lakshang' of https://github.com/nipunanz/Library_Management_System into V_1.0_lakshang
2 parents 5e8c3e8 + f7d6fb0 commit fe96f84

File tree

9 files changed

+600
-96
lines changed

9 files changed

+600
-96
lines changed

Library_Management_System_v0.1/Library_Management_System_v0.1/Add_New_Author.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ namespace Library_Management_System_v0._1
1212
{
1313
public partial class Add_New_Author : Form
1414
{
15-
public Add_New_Author()
15+
Register_new_books rnbinstance;
16+
public Add_New_Author(Register_new_books rnb)
1617
{
1718
InitializeComponent();
19+
this.rnbinstance = rnb;
1820
}
1921
private void buttonSaveAuthor_Click(object sender, EventArgs e)
2022
{
2123
if (textBoxAddAuthor.Text == "" || textBoxAuthorDescription.Text == "")
2224
{
2325

24-
MessageBox.Show(" Invalid Entry ", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Error);
26+
MessageBox.Show(" Invalid Entry. ", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Error);
2527

2628

2729
}
@@ -34,7 +36,7 @@ private void buttonSaveAuthor_Click(object sender, EventArgs e)
3436
String authorDescp = textBoxAuthorDescription.Text;
3537
int bookCount = 0;
3638
int isActive = 1;
37-
int user_login_id = 1;
39+
int user_login_id = 4;
3840
//MySqlConnection connection = DataConnection.getDBConnection();
3941
String newAuthor_SQL = "INSERT INTO book_author (name,description,bookCount,createDateTime,updateDateTime,isActive,user_login_history_id) VALUES (@name,@description,@bookCount,@createDateTime,@updateDateTime,@isActive,@user_login_history_id)";
4042

@@ -68,6 +70,10 @@ private void buttonSaveAuthor_Click(object sender, EventArgs e)
6870
{
6971
textBoxAddAuthor.Text = String.Empty;
7072
textBoxAuthorDescription.Text = String.Empty;
73+
74+
new Register_new_books().Show();
75+
rnbinstance.Hide();
76+
this.Dispose();
7177
}
7278

7379
}

Library_Management_System_v0.1/Library_Management_System_v0.1/Add_New_Book_Type.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ namespace Library_Management_System_v0._1
1313
{
1414
public partial class Add_New_Book_Type : Form
1515
{
16-
public Add_New_Book_Type()
16+
Register_new_books rnbinstance;
17+
public Add_New_Book_Type(Register_new_books rnb)
1718
{
1819
InitializeComponent();
20+
this.rnbinstance = rnb;
1921
}
2022

2123
private void buttonSaveBookType_Click(object sender, EventArgs e)
@@ -36,7 +38,9 @@ private void buttonSaveBookType_Click(object sender, EventArgs e)
3638
{
3739
textBoxAddBookType.Text = String.Empty;
3840
//Register_new_books
39-
41+
new Register_new_books().Show();
42+
rnbinstance.Hide();
43+
this.Dispose();
4044
}
4145
}
4246
}

Library_Management_System_v0.1/Library_Management_System_v0.1/Add_New_Category.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections;
23
using System.Collections.Generic;
34
using System.ComponentModel;
45
using System.Data;
@@ -12,11 +13,14 @@ namespace Library_Management_System_v0._1
1213
{
1314
public partial class Add_New_Category : Form
1415
{
15-
public Add_New_Category()
16+
Register_new_books rnbinstance;
17+
public Add_New_Category(Register_new_books rnb)
1618
{
19+
this.rnbinstance = rnb;
1720
InitializeComponent();
1821
}
1922

23+
2024
private void buttonSaveCategory_Click(object sender, EventArgs e)
2125
{
2226
if (textBoxAddCategory.Text == "")
@@ -34,7 +38,7 @@ private void buttonSaveCategory_Click(object sender, EventArgs e)
3438
String categoryName = textBoxAddCategory.Text;
3539
int bookCount = 0;
3640
int isActive = 1;
37-
int user_login_id = 1;
41+
int user_login_id = 4;
3842

3943
String newBookCategory_SQL = "INSERT INTO book_category (name,bookCount,createDateTime,updateDateTime,isActive,user_login_history_id) VALUES (@name,@bookCount,@createDateTime,@updateDateTime,@isActive,@user_login_history_id)";
4044

@@ -56,6 +60,11 @@ private void buttonSaveCategory_Click(object sender, EventArgs e)
5660
if (dialogResult == DialogResult.OK)
5761
{
5862
textBoxAddCategory.Text = String.Empty ;
63+
64+
new Register_new_books().Show();
65+
rnbinstance.Hide();
66+
this.Dispose();
67+
5968
}
6069
}
6170
}

Library_Management_System_v0.1/Library_Management_System_v0.1/Add_New_Publisher.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ namespace Library_Management_System_v0._1
1313
{
1414
public partial class Add_New_Publisher : Form
1515
{
16-
public Add_New_Publisher()
16+
Register_new_books rnbinstance;
17+
public Add_New_Publisher(Register_new_books rnb)
1718
{
1819
InitializeComponent();
20+
this.rnbinstance = rnb;
1921
}
2022

2123
private void buttonSavePublisher_Click(object sender, EventArgs e)
@@ -36,7 +38,7 @@ private void buttonSavePublisher_Click(object sender, EventArgs e)
3638
String publisherDescp = textBoxPublisherDescp.Text;
3739
int bookCount = 0;
3840
int isActive = 1;
39-
int user_login_id = 2;
41+
int user_login_id = 4;
4042
//MySqlConnection connection = DataConnection.getDBConnection();
4143
String newAuthor_SQL = "INSERT INTO book_printers (name,description,bookCount,createDateTime,updateDateTime,isActive,user_login_history_id) VALUES (@name,@description,@bookCount,@createDateTime,@updateDateTime,@isActive,@user_login_history_id)";
4244
MySqlConnection mySqlConnection = DataConnection.getDBConnection();
@@ -60,6 +62,9 @@ private void buttonSavePublisher_Click(object sender, EventArgs e)
6062
{
6163
textBoxAddPublisher.Text = String.Empty;
6264
textBoxPublisherDescp.Text = String.Empty;
65+
new Register_new_books().Show();
66+
rnbinstance.Hide();
67+
this.Dispose();
6368
}
6469

6570
}

Library_Management_System_v0.1/Library_Management_System_v0.1/DataConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class DataConnection
1414
public static MySqlConnection getDBConnection()
1515
{
1616

17-
String conStr = "server=localhost;user id=root;password=123;persistsecurityinfo=True;port=3306;database=nanofoxy_library_management_system;SslMode=none";
17+
String conStr = "server=localhost;user id=root;password=;persistsecurityinfo=True;port=3306;database=nanofoxy_library_management_system;SslMode=none";
1818

1919
if (DataConnection.mySqlConnection == null) {
2020

Library_Management_System_v0.1/Library_Management_System_v0.1/Library_Management_System_v0.1.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
<Compile Include="Add_New_User.Designer.cs">
7777
<DependentUpon>Add_New_User.cs</DependentUpon>
7878
</Compile>
79+
<Compile Include="comboControl.cs" />
7980
<Compile Include="DataConnection.cs" />
8081
<Compile Include="Edit_Author.cs">
8182
<SubType>Form</SubType>

0 commit comments

Comments
 (0)