-
Notifications
You must be signed in to change notification settings - Fork 0
/
Paper_Presentation.aspx.cs
717 lines (587 loc) · 24.9 KB
/
Paper_Presentation.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Hints.DB;
using Hints.HintsUtility;
using suro.util;
namespace PaperSystem
{
/// <summary>
/// Paper_Presentation 的摘要描述。
/// </summary>
public partial class Paper_Presentation : AuthoringTool_BasicForm_BasicForm
{
string strUserID, strCaseID, strDivisionID, strClinicNum, strSectionName, strPaperID;
string strBackText, strNextText, strTitleText;
protected void Page_Load(object sender, System.EventArgs e)
{
//此頁面部份功能隱藏 請搜索20110324 並把註解取消
this.Initiate();
Ajax.Utility.RegisterTypeForAjax(typeof(Paper_Presentation));
//接收參數
this.getParameter();
//建立標題和按鈕的多國語言
this.setupText();
//建立選項區域
this.setupPresentationSelection();
//是否同時存在tableContent和tableRandom
bool bExist = true;
//建立Paper_Content
clsPresentTable myTable = new clsPresentTable();
Table tableContent = new Table();
//將OLD的跳題與回饋機制隱藏 20110324
//tableContent = myTable.setupSuggestedQuestionTableByPaperID(strPaperID, strCaseID, Convert.ToInt32(strClinicNum), strSectionName);
if (tableContent.Rows.Count > 0)
{
tdMainTable.Controls.Add(tableContent);
}
else
{
trMainTable.Style["DISPLAY"] = "none";
trMainTableHR.Style["DISPLAY"] = "none";
bExist = false;
}
//建立Paper_RandomNum
Table tableRandom = myTable.getListTableFromRandomNum(strPaperID);
if (tableRandom.Rows.Count > 0)
{
tdRandomTable.Controls.Add(tableRandom);
}
else
{
trRandomTable.Style["DISPLAY"] = "none";
bExist = false;
}
//如果兩個表格沒有同時出現,則隱藏兩個表格中間的<HR>
if (bExist == false)
{
trHR.Style["DISPLAY"] = "none";
}
btnNext.ServerClick += new EventHandler(btnNext_ServerClick);
//暫時將ASSIGN QUESTION功能隱藏 不知道功能用途20110324
btnPreAssign.Style["DISPLAY"] = "none";
}
/// <summary>
/// 建立選項區域
/// </summary>
private void setupPresentationSelection()
{
clsPresentTable myTable = new clsPresentTable();
Table table = new Table();
tdSelect.Controls.Add(table);
//Switch
myTable.getSwitchSelectionTable(table, strPaperID);
//Mark
myTable.getMarkSelectionTable(table, strPaperID);
//Modify
myTable.getModifySelectionTable(table, strPaperID);
//Assign method
myTable.getAssignSelectionTable(table, strPaperID);
//Random select
myTable.getRandomSelectionSelectionTable(table, strPaperID);
//Test Duration
myTable.getTestDurationTable(table, strPaperID);
//顯示正確答案
myTable.getCorrectAnswerTable(table, strPaperID);
//Present method
myTable.getPresentMethodSelectionTable(table, strPaperID, strCaseID, Convert.ToInt32(strClinicNum), strSectionName);
//重作機制設定
myTable.getAnsProcess(table, strPaperID, strCaseID);
//Table Driven
//myTable.getTableDriven(table, strPaperID, strCaseID);
//選擇情境題模式設定
myTable.getQuestionSituationMode(table, strPaperID, strCaseID);
//批改問答題時否顯示學生姓名
myTable.getStudentNameVisibleMode(table, strPaperID, strCaseID);
//設定CSS
TableAttribute.setupTopHeaderTableStyle(table, "TableName", 1, "70%", 5, 0, GridLines.Both, false);
}
private void setupText()
{
strTitleText = "Please setup the presentation for this examination";
strBackText = "<< Back";
strNextText = "Finish and save";
tdTitle.InnerText = strTitleText;
btnBack.Value = strBackText;
btnNext.Value = strNextText;
}
private void getParameter()
{
//PaperID
if (Session["PaperID"] != null)
{
strPaperID = Session["PaperID"].ToString();
hfPaperID.Value = strPaperID;
}
//UserID
if (Session["UserID"] != null)
{
strUserID = Session["UserID"].ToString();
}
//CaseID
if (Session["CaseID"] != null)
{
strCaseID = Session["CaseID"].ToString();
hfCaseID.Value = strCaseID;
}
//Division 9801
if (Session["DivisionID"] != null)
{
strDivisionID = Session["DivisionID"].ToString();
hfDivisionID.Value = strDivisionID;
}
//ClinicNum
if (Session["ClinicNum"] != null)
{
strClinicNum = Session["ClinicNum"].ToString();
}
//SectionName
if (Session["SectionName"] != null)
{
strSectionName = Session["SectionName"].ToString();
}
//Opener
if (Request.QueryString["Opener"] != null)
{
hiddenOpener.Value = Request.QueryString["Opener"].ToString();
}
//QuestionMode
if (Session["QuestionMode"] != null)
{
hiddenQuestionMode.Value = Session["QuestionMode"].ToString();
}
//PresentType
if (Session["PresentType"] != null)
{
hiddenPresentType.Value = Session["PresentType"].ToString();
}
//Edit method
if (Session["EditMode"] != null)
{
hiddenEditMode.Value = Session["EditMode"].ToString();
}
//PreOpener
if (Session["PreOpener"] != null)
{
hiddenPreOpener.Value = Session["PreOpener"].ToString();
}
}
#region Web Form 設計工具產生的程式碼
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 此為 ASP.NET Web Form 設計工具所需的呼叫。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 此為設計工具支援所必須的方法 - 請勿使用程式碼編輯器修改
/// 這個方法的內容。
/// </summary>
private void InitializeComponent()
{
}
#endregion
private void btnNext_ServerClick(object sender, EventArgs e)
{
//儲存此問卷的Presentation資料
//儲存Paper_Header
this.savePresentationIntoPaperHeader(this, strPaperID, strCaseID, Convert.ToInt32(strClinicNum), strSectionName);
//儲存Paper_NextStepBySelectionID
this.saveNextStepByPaperID(this, strPaperID);
}
/// <summary>
/// 儲存呈現設定到paper_Header
/// </summary>
/// <param name="WebPage"></param>
/// <param name="strPaperID"></param>
private void savePresentationIntoPaperHeader(System.Web.UI.Page WebPage, string strPaperID, string strCaseID, int intClinicNum, string strSectionName)
{
//Switch
this.saveSwitchPresentation(this, strPaperID);
//Mark
this.saveMarkPresentation(this, strPaperID);
//Modify
this.saveModifyPresentation(this, strPaperID);
//Present
this.savePresentPresentation(this, strPaperID, strCaseID, intClinicNum, strSectionName);
//Assign
this.saveAssignPresentation(this, strPaperID);
//Random selection
this.saveRandomSelection(this, strPaperID);
//Test duration
this.saveTestDurationPresentation(this, strPaperID);
//Correct Answer
this.saveCorrectAnswerPresentation(this, strPaperID);
//SituationQuestionMode
this.saveSituationQuestionModePresentation(this, strPaperID);
//StudentNameVisibleMode
this.saveStudentNameVisibleModePresentation(this, strPaperID);
}
/// <summary>
/// 儲存Switch的設定
/// </summary>
public void saveSwitchPresentation(System.Web.UI.Page WebPage, string strPaperID)
{
RadioButton rbYes = ((RadioButton)(WebPage.FindControl("Form1").FindControl("rb-Switch-Yes")));
//此功能是否有被開啟
int intSelect = 1;
if (rbYes.Checked)
{
intSelect = 1;
}
else
{
intSelect = 0;
}
SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]);
string strSQL = "UPDATE Paper_Header SET bSwitch = '" + intSelect.ToString() + "' WHERE cPaperID = '" + strPaperID + "' ";
myDB.ExecuteNonQuery(strSQL);
}
/// <summary>
/// 儲存Mark的設定
/// </summary>
public void saveMarkPresentation(System.Web.UI.Page WebPage, string strPaperID)
{
RadioButton rbYes = ((RadioButton)(WebPage.FindControl("Form1").FindControl("rb-Mark-Yes")));
//此功能是否有被開啟
int intSelect = 1;
if (rbYes.Checked)
{
intSelect = 1;
}
else
{
intSelect = 0;
}
SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]);
string strSQL = "UPDATE Paper_Header SET bMarkable = '" + intSelect.ToString() + "' WHERE cPaperID = '" + strPaperID + "' ";
myDB.ExecuteNonQuery(strSQL);
}
/// <summary>
/// 儲存SectionSummaryShowCorrectAnswer的設定
/// </summary>
/// <param name="WebPage"></param>
/// <param name="strPaperID"></param>
public void saveCorrectAnswerPresentation(System.Web.UI.Page WebPage, string strPaperID)
{
RadioButton rbYes = ((RadioButton)(WebPage.FindControl("Form1").FindControl("rb-CorrectAnswer-Yes")));
//此功能是否有被開啟
int intSelect = 1;
if (rbYes.Checked)
{
intSelect = 1;
}
else
{
intSelect = 0;
}
SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]);
string strSQL = "UPDATE Paper_Header SET bSectionSummaryShowCorrectAnswer = '" + intSelect.ToString() + "' WHERE cPaperID = '" + strPaperID + "' ";
myDB.ExecuteNonQuery(strSQL);
}
/// <summary>
/// 儲存SituationQuestionMode的設定
/// </summary>
public void saveSituationQuestionModePresentation(System.Web.UI.Page WebPage, string strPaperID)
{
RadioButton rbExam = ((RadioButton)(WebPage.FindControl("Form1").FindControl("rb-SituationMode-Exam")));
//此功能是否有被開啟
int intSelect = 1;
if (rbExam.Checked)
{
intSelect = 1;
}
else
{
intSelect = 0;
}
SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]);
string strSQL = "UPDATE Paper_Header SET bIsSituationExam = '" + intSelect.ToString() + "' WHERE cPaperID = '" + strPaperID + "' ";
myDB.ExecuteNonQuery(strSQL);
}
/// <summary>
/// 儲存StudentNameVisibleMode的設定
/// </summary>
public void saveStudentNameVisibleModePresentation(System.Web.UI.Page WebPage, string strPaperID)
{
RadioButton rbVisible = ((RadioButton)(WebPage.FindControl("Form1").FindControl("rb-Visible")));
//此功能是否有被開啟
int intSelect = 1;
if (rbVisible.Checked)
{
intSelect = 1;
}
else
{
intSelect = 0;
}
SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]);
string strSQL = "UPDATE Paper_Header SET bIsStudentNameVisible = '" + intSelect.ToString() + "' WHERE cPaperID = '" + strPaperID + "' ";
myDB.ExecuteNonQuery(strSQL);
}
/// <summary>
/// 儲存Modify的設定
/// </summary>
public void saveModifyPresentation(System.Web.UI.Page WebPage, string strPaperID)
{
RadioButton rbYes = ((RadioButton)(WebPage.FindControl("Form1").FindControl("rb-Modify-Yes")));
//此功能是否有被開啟
int intSelect = 1;
if (rbYes.Checked)
{
intSelect = 1;
}
else
{
intSelect = 0;
}
SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]);
string strSQL = "UPDATE Paper_Header SET bModify = '" + intSelect.ToString() + "' WHERE cPaperID = '" + strPaperID + "' ";
myDB.ExecuteNonQuery(strSQL);
}
/// <summary>
/// 儲存Assign的設定
/// </summary>
public void saveAssignPresentation(System.Web.UI.Page WebPage, string strPaperID)
{
RadioButton rbYes = ((RadioButton)(WebPage.FindControl("Form1").FindControl("rb-Assign-Yes")));
//此功能是否有被開啟
int intSelect = 1;
if (rbYes.Checked)
{
intSelect = 1;
}
else
{
intSelect = 2;
}
SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]);
string strSQL = "UPDATE Paper_Header SET sAssignMethod = '" + intSelect.ToString() + "' WHERE cPaperID = '" + strPaperID + "' ";
myDB.ExecuteNonQuery(strSQL);
}
/// <summary>
/// 儲存RandomSelection的設定
/// </summary>
public void saveRandomSelection(System.Web.UI.Page WebPage, string strPaperID)
{
RadioButton rbYes = ((RadioButton)(WebPage.FindControl("Form1").FindControl("rb-RandomSelection-Yes")));
//此功能是否有被開啟
int intSelect = 1;
if (rbYes.Checked)
{
intSelect = 1;
}
else
{
intSelect = 0;
}
SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]);
string strSQL = "UPDATE Paper_Header SET bRandomSelection = '" + intSelect.ToString() + "' WHERE cPaperID = '" + strPaperID + "' ";
myDB.ExecuteNonQuery(strSQL);
}
/// <summary>
/// 儲存TestDuration的設定
/// </summary>
public void saveTestDurationPresentation(System.Web.UI.Page WebPage, string strPaperID)
{
RadioButton rbYes = ((RadioButton)(WebPage.FindControl("Form1").FindControl("rb-Duration-Yes")));
//TestDuration的時間
int intDuration = 0;
DropDownList dlDuration = new DropDownList();
if (rbYes.Checked)
{
//取得時間
dlDuration = ((DropDownList)(WebPage.FindControl("Form1").FindControl("dlTestDuration")));
intDuration = Convert.ToInt32(dlDuration.SelectedItem.Value);
}
else
{
intDuration = 0;
}
// if(intDuration > 0)
// {
// dlDuration.Attributes["disabled"] = "";
// }
// else
// {
// dlDuration.Attributes["disabled"] = "disabled";
// }
SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]);
string strSQL = "UPDATE Paper_Header SET sTestDuration = '" + intDuration.ToString() + "' WHERE cPaperID = '" + strPaperID + "' ";
myDB.ExecuteNonQuery(strSQL);
}
/// <summary>
/// 儲存PresentMethod的設定
/// </summary>
/// <param name="WebPage"></param>
/// <param name="strPaperID"></param>
public void savePresentPresentation(System.Web.UI.Page WebPage, string strPaperID, string strCaseID, int intClinicNum, string strSectionName)
{
DropDownList dlPresent = ((DropDownList)(WebPage.FindControl("Form1").FindControl("dlPresent")));
string strSelectWorkType = dlPresent.SelectedItem.Value;
SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]);
string strSQL = "UPDATE UserLevelPresent SET sWorkType = '" + strSelectWorkType + "' WHERE cCaseID = '" + strCaseID + "' AND sClinicNum = '" + intClinicNum.ToString() + "' AND cSectionName = '" + strSectionName + "' ";
myDB.ExecuteNonQuery(strSQL);
}
/// <summary>
/// 儲存資料至Paper_NextStepBySelectionID
/// </summary>
public void saveNextStepByPaperID(System.Web.UI.Page WebPage, string strPaperID)
{
DataReceiver myReceiver = new DataReceiver();
//取得此問卷的所有題目(Paper_Content)
int intContentQuestionCount = myReceiver.getPaperContentQuestionNum(strPaperID);
//目前顯示的題號
int intQuestionIndex = 1;
//取得此問卷中的所有問題
for (int i = 1; i <= intContentQuestionCount; i++)
{
//取得問題的資料(From Paper_Content)
DataRow[] drQuestion = myReceiver.getQIDFromPaper_ContentByQuestionIndex(strPaperID, intQuestionIndex);
if (drQuestion.Length > 0)
{
//取得要顯示問題的QID
string strQID = drQuestion[0]["cQID"].ToString();
//QuestionType
string strQuestionType = drQuestion[0]["cQuestionType"].ToString();
//QuestionMode
string strQuestionMode = drQuestion[0]["cQuestionMode"].ToString();
//問題是選擇題還是問答題?
switch (drQuestion[0]["cQuestionType"].ToString())
{
case "2":
//問答題
break;
default:
//選擇題
//將OLD的跳題與回饋機制隱藏20110324
//this.saveNextStepBySelectionID(WebPage, strPaperID, strQID, intQuestionIndex);
break;
}
}
intQuestionIndex += 1;
}
//顯示儲存成功訊息,並且回到MainPage
string strScript = "<script language='javascript'>\n";
strScript += "goNext();\n";
strScript += "</script>\n";
Page.RegisterStartupScript("goNext", strScript);
}
/// <summary>
/// 儲存一個題目下所有選項的資料至Paper_NextStepBySelectionID
/// </summary>
/// <param name="WebPage"></param>
/// <param name="strPaperID"></param>
/// <param name="strQID"></param>
/// <param name="strSelectionID"></param>
/// <param name="intQuestionIndex"></param>
public void saveNextStepBySelectionID(System.Web.UI.Page WebPage, string strPaperID, string strQID, int intQuestionIndex)
{
//DataReceiver myReceiver = new DataReceiver();
//選項
SQLString mySQL = new SQLString();
string strSQL = mySQL.getAllSelections(strQID);
SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]);
DataSet dsSelection = myDB.getDataSet(strSQL);
if (dsSelection.Tables[0].Rows.Count > 0)
{
for (int i = 0; i < dsSelection.Tables[0].Rows.Count; i++)
{
string strSelectionID = dsSelection.Tables[0].Rows[i]["cSelectionID"].ToString();
int intSelectionIndex = Convert.ToInt32(dsSelection.Tables[0].Rows[i]["sSeq"]);
string strSelection = dsSelection.Tables[0].Rows[i]["cSelection"].ToString();
bool bSuggested = Convert.ToBoolean(dsSelection.Tables[0].Rows[i]["bCaseSelect"]);
//取得題號下拉式選單被選取的內容
string strDlIndexID = "dlSelection-Index-" + strSelectionID;
DropDownList dlIndex = ((DropDownList)(WebPage.FindControl("Form1").FindControl(strDlIndexID)));
int intNextIndex = Convert.ToInt32(dlIndex.SelectedItem.Value);
//取得Section下拉式選單被選取的內容
string strDlSectionID = "dlSelection-Section-" + strSelectionID;
DropDownList dlSection = ((DropDownList)(WebPage.FindControl("Form1").FindControl(strDlSectionID)));
string strNextSection = "";
if (dlSection.SelectedItem != null)
strNextSection = dlSection.SelectedItem.Value;
//此選項的NextStep是By Section還是題號
int intNextMethod = 2;
//檢查此選項的NextStep是Section還是題號
string strRbIndexID = "rbIndex-" + strSelectionID;
RadioButton rbIndex = ((RadioButton)(WebPage.FindControl("Form1").FindControl(strRbIndexID)));
string strRbSectionID = "rbSection-" + strSelectionID;
RadioButton rbSection = ((RadioButton)(WebPage.FindControl("Form1").FindControl(strRbSectionID)));
string strRbDefaultID = "rbDefault-" + strSelectionID;
RadioButton rbDefault = ((RadioButton)(WebPage.FindControl("Form1").FindControl(strRbDefaultID)));
if (rbIndex.Checked == true)
{
if (intNextIndex == 0)
{
//結束Section
intNextMethod = 0;
}
else
{
//題號
intNextMethod = 2;
}
}
else if (rbSection.Checked == true)
{
//Section
intNextMethod = 1;
}
else
{
//Default
intNextMethod = 9999;
intNextIndex = 9999;
}
//把資料存入Paper_NextStepBySelectionID
SQLString.SaveToPaper_NextStepBySelectionID(strPaperID, strQID, intQuestionIndex, strSelectionID, intSelectionIndex, intNextMethod, strNextSection, intNextIndex);
}
}
dsSelection.Dispose();
}
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
public void DeleteTDTemplate(string strPaperID, string strCaseID)
{
Hints.DB.TableDriven.TD_QandA.TD_QandA_DELETE(strPaperID, strCaseID);
}
/// <summary>
/// 取得AnsProcess_Paper的AnsProcessID
/// 若無則新增一筆
/// </summary>
/// <param name="strPaperID"></param>
/// <param name="strCaseID"></param>
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
public string GetPaperAnsProcessID(string strPaperID, string strCaseID)
{
string strAnsProcessID = "";
string strSQL = "";
clsHintsDB HintsDB = new clsHintsDB();
DataTable dt = new DataTable();
strSQL = "SELECT * FROM AnsProcess_Paper WHERE cCaseID = '" + strCaseID + "' AND cPaperID = '" + strPaperID + "'";
dt = HintsDB.getDataSet(strSQL).Tables[0];
if (dt.Rows.Count > 0)
{
strAnsProcessID = dt.Rows[0]["cAnsProcessID"].ToString();
}
else
{
strAnsProcessID = "AnsProcess" + DateTime.Now.ToString("yyyyMMddHHmmss");
strSQL = "INSERT INTO AnsProcess_Paper (cAnsProcessID, cCaseID, cPaperID) " +
" VALUES ('" + strAnsProcessID + "', '" + strCaseID + "', '" + strPaperID + "')";
HintsDB.ExecuteNonQuery(strSQL);
}
return strAnsProcessID;
dt.Dispose();
}
}
}