What's new

Closed C# Programming

Status
Not open for further replies.

chayoooo

Eternal Poster
Established
Joined
Jun 19, 2019
Posts
669
Reaction
740
Points
282
Mga C# masters jan, kailangan ko lang po ng tulong kung pano po yung limited lang yung ma-iinsert na value sa database?

May ginagawa po akong Library System for final project namin this sem. Bale, yung gusto ko pong mangyare is paano po malilimit yung books na mai-issue sa student/member? Gusto ko po kasi na hanggang 5 books lang yung pedeng ma-issue sa students po. Hindi ko po kasi alam kung ano yung isesearch sa google, di ko alam yung term. Patulong po.
 
Using select statement, check mo sa database kung ilang record na issue sa student then kpag equals to 5 na yung record, hndi kna makapag issue or insert ng record sa database.
 
Using select statement, check mo sa database kung ilang record na issue sa student then kpag equals to 5 na yung record, hndi kna makapag issue or insert ng record sa database.
Pede makahingi ng example ng code? Using if else statement po ba?
 
sorry sa syntax sa where

where (parameters)

example
SELECT COUNT(column_name)
FROM table_name
WHERE (column_name) = 'jose rizal'

ang result nyan ay int
 
maglagay kalang ng column for students kung ilan na ang na borrow nyang book
 
Yo. Pwede ka maglagay ng validations kay front-end at back-end. Para mas sure.

Mag add ka ng bagong table para sa borrowed books.
Borrowed_Books
-bb_id (PK)
-student_id (FK)
-book_id (FK)
-date_brrowed
-date_to_return
-returned_date

Then under ni student's table, gawa ka ng pang link sa kanila.
Borrower_Status
-borrower_status_id(pk)
-student_id (FK)
-bb_id(fk)
-status

Then sa front end,
If manghiram si student:
Insert kay borrowed_books ng details at kay borrower_status where status = unreturned

For verification kung nakaka lima na si student,
Select count mo yung keyword na status. Pag = sa 5, then bawal.

Pwede mo ilagay si 'status' column kay borrowed_books pero kung gusto mo naka-Normalize, then use 'Borrower_Status
 
Yo. Pwede ka maglagay ng validations kay front-end at back-end. Para mas sure.

Mag add ka ng bagong table para sa borrowed books.
Borrowed_Books
-bb_id (PK)
-student_id (FK)
-book_id (FK)
-date_brrowed
-date_to_return
-returned_date

Then under ni student's table, gawa ka ng pang link sa kanila.
Borrower_Status
-borrower_status_id(pk)
-student_id (FK)
-bb_id(fk)
-status

Then sa front end,
If manghiram si student:
Insert kay borrowed_books ng details at kay borrower_status where status = unreturned

For verification kung nakaka lima na si student,
Select count mo yung keyword na status. Pag = sa 5, then bawal.

Pwede mo ilagay si 'status' column kay borrowed_books pero kung gusto mo naka-Normalize, then use 'Borrower_Status
Hala, thank you so much poooo. Subukan ko po i-normalize. Kaso po nahihirapan ako kung pano ilalagay kung ilan na yung books na nasa student at i-update kung sakali din ma-lost yung book nung student, gusto ko sana din ma-view kung ilan yung books na na-lost nung student
 
gusto ko sana din ma-view kung ilan yung books na na-lost nung student

May example ako, nag-create ako ng Lost_Book na table para sa mga nawala ni student (then you can also count them all).

kung pano ilalagay kung ilan na yung books na nasa student

SELECT COUNT(*)
FROM Borrowed_Books
WHERE bb_status = ONHAND;


So basically dyan sa code, may tatlo kang constant values para kay bb_status which is: "ONHAND", "RETURNED", "LOST".

i-update kung sakali din ma-lost yung book nung student

Sa table na Lost_Book, may details don about sa nawalang libro. Front-end gagana dyan pag ganyan.
Update mo si Borrowed_Book (bb_status = LOST); then Insert kay Lost_Book ng details.

Pwede mo pa mas mapaganda yan, like yung sa 'returned_date' na medyo magulo pa. Pasensya na di ko pa kasi din alam buong Business Process ng system mo hehe kaya magulo.

Check my attached files if it can help.
 

Attachments

May example ako, nag-create ako ng Lost_Book na table para sa mga nawala ni student (then you can also count them all).



SELECT COUNT(*)
FROM Borrowed_Books
WHERE bb_status = ONHAND;


So basically dyan sa code, may tatlo kang constant values para kay bb_status which is: "ONHAND", "RETURNED", "LOST".



Sa table na Lost_Book, may details don about sa nawalang libro. Front-end gagana dyan pag ganyan.
Update mo si Borrowed_Book (bb_status = LOST); then Insert kay Lost_Book ng details.

Pwede mo pa mas mapaganda yan, like yung sa 'returned_date' na medyo magulo pa. Pasensya na di ko pa kasi din alam buong Business Process ng system mo hehe kaya magulo.

Check my attached files if it can help.
Thank you, gets ko na po. Yung ginawa ko kasi sa student ko nilagay yung LostBook na column pero mas madali maintindihan pag naka-normalize din pati yung LostTable. Thank you so much po, bale sa lost table nandun na din pala yung bills or payment po. Thank you po ng marami sir :)
 
P
May example ako, nag-create ako ng Lost_Book na table para sa mga nawala ni student (then you can also count them all).



SELECT COUNT(*)
FROM Borrowed_Books
WHERE bb_status = ONHAND;


So basically dyan sa code, may tatlo kang constant values para kay bb_status which is: "ONHAND", "RETURNED", "LOST".



Sa table na Lost_Book, may details don about sa nawalang libro. Front-end gagana dyan pag ganyan.
Update mo si Borrowed_Book (bb_status = LOST); then Insert kay Lost_Book ng details.

Pwede mo pa mas mapaganda yan, like yung sa 'returned_date' na medyo magulo pa. Pasensya na di ko pa kasi din alam buong Business Process ng system mo hehe kaya magulo.

Check my attached files if it can help.
Pasensya na din madami yung tanong ko, baguhan lang din po hehe
 
Kung true na may payment if nawala, what if sa penalty for not returning in time?

Tas pasok mo na lang din pala yung about sa patron.
 
Kung true na may payment if nawala, what if sa penalty for not returning in time?

Tas pasok mo na lang din pala yung about sa patron.
Yung gagawin ko nalang siguro po ilalagay ko nalang yung lost book dun sa bills table together with the penalty pag late returned. Chaka ano po yung patron?
 
Status
Not open for further replies.
Back
Top