01.
{
02.
strSQL =
"UPDATE CreateSchedule SET "
+
03.
" ScheduleID = '"
+
this
.txtId.Text +
"' "
+
04.
" ,NameSchedule = '"
+
this
.txtnameSc.Text +
"' "
+
05.
" ,Date = '"
+
this
.txtDate.Text +
"' "
+
06.
" ,StartTime = '"
+
this
.ddlTime1.SelectedItem.Value +
"' "
+
07.
" ,EndTime = '"
+
this
.ddlTime2.SelectedItem.Value +
"' "
+
08.
" ,Location = '"
+
this
.txtlocation.Text +
"' "
+
09.
" ,Boss = '"
+
this
.ddlBoss.SelectedItem.Value +
"' "
+
10.
" ,Name = '"
+
this
.txtNC.Text +
"' "
+
11.
" ,Tel = '"
+
this
.txttel.Text +
"' "
+
12.
" WHERE ScheduleID = '"
+ Request.QueryString[
"ScheduleID"
] +
"' "
;
13.
14.
objCmd =
new
SqlCommand();
15.
objCmd.Connection = objConn;
16.
objCmd.CommandText = strSQL;
17.
objCmd.CommandType = CommandType.Text;
18.
objCmd.ExecuteNonQuery();
19.
20.
strSQL =
"UPDATE totalWork SET "
+
21.
" workID = '"
+
this
.txtId.Text +
"' "
+
22.
" ,workName = '"
+
this
.txtnameSc.Text +
"' "
+
23.
" ,workdate = '"
+
this
.txtDate.Text +
"' "
+
24.
" ,worktime = '"
+
this
.ddlTime1.SelectedItem.Value +
"' "
+
25.
" ,worktime2 = '"
+
this
.ddlTime2.SelectedItem.Value +
"' "
+
26.
" ,worklocation = '"
+
this
.txtlocation.Text +
"' "
+
27.
" ,workboss = '"
+
this
.ddlBoss.SelectedItem.Value +
"' "
+
28.
" WHERE workID = '"
+ Request.QueryString[
"ScheduleID"
] +
"' "
;
29.
objCmd =
new
SqlCommand();
30.
objCmd.Connection = objConn;
31.
objCmd.CommandText = strSQL;
32.
objCmd.CommandType = CommandType.Text;
33.
objCmd.ExecuteNonQuery();
34.
35.
try
36.
{
37.
38.
this
.lblStatus.Text =
"Record Updated"
;
39.
this
.lblStatus.Visible =
true
;
40.
}
41.
catch
(Exception ex)
42.
{
43.
this
.lblStatus.Text =
"Record can not update"
;
44.
}
45.
46.
}