当前位置: 首页>>代码示例>>C#>>正文


C# Section.AddSection方法代码示例

本文整理汇总了C#中Section.AddSection方法的典型用法代码示例。如果您正苦于以下问题:C# Section.AddSection方法的具体用法?C# Section.AddSection怎么用?C# Section.AddSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Section的用法示例。


在下文中一共展示了Section.AddSection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ButtonCreate_Click

    protected void ButtonCreate_Click(object sender, EventArgs e)
    {
        try
        {
            if (TextBoxAssessment.Text.Length > 0)
            {
                string assName = TextBoxAssessment.Text;
                int menuId = new CVTCMenu().GetMaxMenuID();
                menuId += 1;
                TextBoxAssessment.Text = "";
                Collection<CVTCMenu> menuList = new Collection<CVTCMenu>();
                CVTCMenu menu = null;
                Section section = new Section();

                Assessment ass = new Assessment();
                ass.AssessmentName = assName;
                ass.CreatedBy = 1;
                ass.CreatedDate = DateTime.Now;
                ass.LastModifiedBy = 1;
                ass.LastModifiedDate = DateTime.Now;
                ass.RefMenuID = menuId;
                ass.TotalFlag = 0;
                ass.TotalFlagPoint = 0;
                ass.TotalQuestion = 0;
                ass.TotalSection = 0;
                ass.AddAssessment();

                section.AssessmentOID = ass.AssessmentOID;
                section.SectionName = "NoScore";
                section.TotalQuestion = 0;
                section.TotalFlag = 0;
                section.Low = -1;
                section.Medium = -1;
                section.Flag = -1;
                section.High = -1;
                section.LastModifiedBy = 1;
                section.CreatedBy = 1;
                section.CreatedDate = DateTime.Now;
                section.LastModifiedDate = DateTime.Now;
                section.PassingTotal = -1;
                section.FlagPointTotal = -1;
                section.QuestionList = null;
                section.AddSection();

                #region Assign Value to Menu Items
                for (int i = menuId; i <= (menuId + 10); i++)
                {
                    menu = new CVTCMenu();
                    menu.MenuID = i;
                    if (menu.MenuID == menuId)
                    {
                        menu.NameMenu = assName;
                        menu.URL = " ";
                        menu.MenuLevel = 1;
                        menu.Parent = 24;
                        menu.IsExpanded = "false";
                        menu.IsLeave = "false";
                    }
                    if (menu.MenuID == (menuId + 1))
                    {

                        menu.NameMenu = "View Results";
                        menu.URL = "pg/assessment/Result.aspx?aid=" + ass.AssessmentOID.ToString();
                        menu.MenuLevel = 2;
                        menu.Parent = menuId;
                        menu.IsExpanded = "true";
                        menu.IsLeave = "true";
                    }
                    if (menu.MenuID == (menuId + 2))
                    {
                        menu.NameMenu = "Settings";
                        menu.URL = "pg/assessment/setting.aspx?aid=" + ass.AssessmentOID.ToString();
                        menu.MenuLevel = 2;
                        menu.Parent = menuId;
                        menu.IsExpanded = "true";
                        menu.IsLeave = "true";
                    }
                    if (menu.MenuID == (menuId + 3))
                    {
                        menu.NameMenu = "Reminder Email";
                        menu.URL = " ";
                        menu.MenuLevel = 2;
                        menu.Parent = menuId;
                        menu.IsExpanded = "false";
                        menu.IsLeave = "false";
                    }
                    if (menu.MenuID == (menuId + 4))
                    {
                        menu.NameMenu = "Send Email";
                        menu.URL = "pg/assessment/ReminderEmail.aspx?aid=" + ass.AssessmentOID.ToString();
                        menu.MenuLevel = 3;
                        menu.Parent = (menuId + 3);
                        menu.IsExpanded = "true";
                        menu.IsLeave = "true";
                    }
                    if (menu.MenuID == (menuId + 5))
                    {
                        menu.NameMenu = "Edit Term Codes";
                        menu.URL = "pg/assessment/editTermCodes.aspx?aid=" + ass.AssessmentOID.ToString();
                        menu.MenuLevel = 3;
//.........这里部分代码省略.........
开发者ID:mominbd,项目名称:testing,代码行数:101,代码来源:createAssessment.aspx.cs

示例2: GetSection

 public static Section GetSection(Section parent, Properties attributes)
 {
     Section section = parent.AddSection("");
     SetSectionParameters(section, attributes);
     return section;
 }
开发者ID:pixelia-es,项目名称:RazorPDF2,代码行数:6,代码来源:ElementFactory.cs

示例3: 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)
        {

        }
    }
开发者ID:mominbd,项目名称:testing,代码行数:101,代码来源:SectionEdit.aspx.cs


注:本文中的Section.AddSection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。