本文整理汇总了C#中Section.UpdateAssessmentSection方法的典型用法代码示例。如果您正苦于以下问题:C# Section.UpdateAssessmentSection方法的具体用法?C# Section.UpdateAssessmentSection怎么用?C# Section.UpdateAssessmentSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section.UpdateAssessmentSection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ButtonSaveMyWork_Click
//.........这里部分代码省略.........
Resp = "TextResponse" + i.ToString();
Flag = "SelectFalgRating" + i.ToString();
reverse = "chkReverse" + i.ToString();
ordNum = Request.Form[ordNum];
if (ordNum == null) break;
ques = Request.Form[ques];
RespAct = Request.Form[RespAct];
Resp = Request.Form[Resp];
Flag = Request.Form[Flag];
reverse = Request.Form[reverse];
//Assign Values to question
questn = new Question();
if (i > totalQuestion)
{
questn.QuestionOID = 0;
}
else
{
questn.QuestionOID = sectionExiting.QuestionList[i-1].QuestionOID;
}
questn.SectionOID = section.SectionOID;
questn.CreatedBy = 1;//Set current user
questn.LastModifiedBy = 1;//Set current user
questn.Keyword =" ";// Key;
questn.MultipleAllow = 1;
questn.OrderNo = Convert.ToInt32(ordNum);
questn.QuestionText = ques;
questn.RespAction = RespAct;
int rev = 0;
if (reverse == "on")
{
rev = 1;
}
questn.Reverse = rev;
quesList.Add(questn);
//Assign values Question Response
respList = new Collection<QuestionResponse>();
quesResp = new QuestionResponse();
if( questn.QuestionOID !=0)
{
quesResp.QuestionResponseOID = sectionExiting.QuestionList[i - 1].QuestionRespList[0].QuestionResponseOID;
}
quesResp.CreatedBy = 1;
quesResp.LastModifiedBy = 1;
quesResp.FlagRating = Convert.ToInt32(Flag);
quesResp.Response = Resp;
respList.Add(quesResp);
//Process
for (int j = 2; ; j++)
{
Resp = "TextResponse" + i.ToString() + "_" + j.ToString();
Flag = "SelectFalgRating" + i.ToString() + "_" + j.ToString();
Resp = Request.Form[Resp];
Flag = Request.Form[Flag];
if (Resp == null) break;
//Assign values Question Response
quesResp = new QuestionResponse();
if (i > totalQuestion)
{
quesResp.QuestionResponseOID = 0;
}
else
{
if (j > sectionExiting.QuestionList[i-1].QuestionRespList.Count)
{
quesResp.QuestionResponseOID = 0;
}
else
{
quesResp.QuestionResponseOID = sectionExiting.QuestionList[i-1].QuestionRespList[j-1].QuestionResponseOID;
}
}
//quesResp.QuestionResponseOID = sectionExiting.QuestionList[i].QuestionRespList
quesResp.CreatedBy = 1;
quesResp.LastModifiedBy = 1;
quesResp.FlagRating = Convert.ToInt32(Flag);
quesResp.Response = Resp;
respList.Add(quesResp);
}
questn.QuestionRespList = respList;
}
#endregion
section.QuestionList = quesList;
section.UpdateSection();
section.UpdateAssessmentSection();
this.InitializeQuestion(sectionOID);
LabelMessage.Text = "Saved Successfully.";
}
示例2: ButtonSaveMyWork_Click
//.........这里部分代码省略.........
Flag = Request.Form[Flag];
//Assign values Question Response
quesResp.CreatedBy = 1;
quesResp.LastModifiedBy = 1;
quesResp.FlagRating = Convert.ToInt32(Flag);
quesResp.Response = Resp;
respList.Add(quesResp);
}
ordNum = Request.Form[ordNum];
if (ordNum == null) break;
ques = Request.Form[ques];
RespAct = Request.Form[RespAct];
//Assign Values to question
// quesList= new Collection<Question>();
//questn = new Question();
questn.CreatedBy = 1;//Set current user
questn.LastModifiedBy = 1;//Set current user
questn.Keyword = " ";
questn.MultipleAllow = 1;
questn.OrderNo = Convert.ToInt32(ordNum);
questn.QuestionText = ques;
questn.RespAction = RespAct;
Reverse = Convert.ToString("chkReverse" + i.ToString());
Reverse = Request.Form[Reverse];
if (Reverse == "on")
{
questn.Reverse = 1;
}
else
{
questn.Reverse = 0;
}
quesList.Add(questn);
questn.QuestionRespList = respList;
}
#region dummy
////Process
//for (int j = 1; ; j++)
//{
// Resp = "TextResponse" + i.ToString() + "_" + j.ToString();
// Flag = "SelectFalgRating" + i.ToString() + "_" + j.ToString();
// Resp = Request.Form[Resp];
// Flag = Request.Form[Flag];
// if (Resp == null) break;
// //Assign values Question Response
// quesResp = new QuestionResponse();
// quesResp.CreatedBy = 1;
// quesResp.LastModifiedBy = 1;
// quesResp.FlagRating = Convert.ToInt32(Flag);
// quesResp.Response = Resp;
// respList.Add(quesResp);
//}
#endregion
#endregion
section.QuestionList = quesList;
section.AddSection();
section.UpdateAssessmentSection();
TextBoxSectionName.Text = "";
//TextBoxPassingTotal.Text = "0";
TextBoxTotalQuestion.Text = "1";
Assessment ass = new Assessment();
ass = ass.GetAssessmentByOID(assessmentOID);
CVTCMenu menu = new CVTCMenu();
CVTCMenu tmp = menu.GetMenuByOID(ass.RefMenuID);
menu.NameMenu = section.SectionName;
int menuId = new CVTCMenu().GetMaxMenuID();
menuId += 1;
menu.MenuID = menuId;
menu.URL = "pg/assessment/section.aspx?soid=" + section.SectionOID.ToString();
menu.MenuLevel = 3;
menu.Parent = tmp.MenuID+8;
menu.IsExpanded = "true";
menu.IsLeave = "true";
menu.SaveAssessmentMenuItem(menu);
LabelMessage.Text = "Saved Successfully.";
}
catch (Exception ex)
{
}
}