TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rahul Kashyap
NA
25
10k
How to disable checkbox after insert the value in data base
Dec 12 2018 2:53 AM
i'm trying this code, actually i'm trying to make bed booking.
please help me how can i do
protected
void
btnSave_Click(
object
sender, EventArgs e)
{
string
bednumber, Bedstatus;
try
{
if
(chkkk.Checked ==
true
)
{
bednumber =
"First Floor 201"
;
}
else
if
(chk1.Checked ==
true
)
{
bednumber =
"First Floor 202"
;
}
else
if
(chk2.Checked ==
true
)
{
bednumber =
"First Floor 203"
;
}
else
if
(chk3.Checked ==
true
)
{
bednumber =
"First Floor 204"
;
}
else
if
(chk4.Checked ==
true
)
{
bednumber =
"First Floor 205"
;
}
else
if
(chk5.Checked ==
true
)
{
bednumber =
"First Floor 206"
;
}
else
if
(chk6.Checked ==
true
)
{
bednumber =
"First Floor 207"
;
}
else
if
(chk7.Checked ==
true
)
{
bednumber =
"First Floor 208"
;
}
else
bednumber =
"Non"
;
if
(ChkActive.Checked)
{
Bedstatus =
"Booked"
;
}
else
Bedstatus =
"Booked"
;
conn.Open();
SqlCommand cmd =
new
SqlCommand(
"IF NOT EXISTS(SELECT * FROM BedBooking WHERE BedNumber = '"
+ bednumber +
"')INSERT INTO BedBooking(PatientName, BedNumber) VALUES('"
+ txtName.Text +
"','"
+ bednumber +
"')"
, conn);
cmd.ExecuteNonQuery();
SqlCommand cmd1 =
new
SqlCommand(
"IF NOT EXISTS(SELECT * FROM AddBedNumber WHERE BedNumber = '"
+ bednumber +
"') INSERT INTO AddBedNumber(BedNumber, Active) VALUES('"
+ bednumber +
"','"
+ Bedstatus +
"')"
, conn);
cmd1.ExecuteNonQuery();
conn.Close();
Response.Write(
"<script language='javascript'>alert('Thank you !!! Your Booking has been Sucessfully!!')</script>"
);
}
catch
(Exception ex)
{
}
}
Attachment:
BedBooking.rar
Reply
Answers (
3
)
Confirm new user with SMS instead of Email
How to get value from .json file in Asp.net core.