protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ViewState["RefUrl"] = Request.UrlReferrer.ToString();
            }

            try
            {
                cUV = uvContext.GetById(int.Parse(Request.Params.Get("uv")));
                string projectId = Request.Params.Get("project");

                if (projectId != null && projectId != "")
                {
                    cProject = projectContext.GetById(int.Parse(projectId));

                    // prevent from executing the following code when a button is clicked on the page (like "save" for example)
                    if (!IsPostBack)
                    {
                        Name.Text        = cProject.Name;
                        Description.Text = cProject.Description;
                    }
                }
            }
            catch
            {
                Response.Redirect("/Errors/403.aspx", true);
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            cQuizz   = quizzContext.GetByIdStringEager(Request.Params.Get("quizz"));
            linkedUv = uvContext.GetById(cQuizz.IdUv);
            user     = identityContext.GetById(Context.User.Identity.GetUserId());

            isProf = user.Role.Equals("Prof");
            Button_Rep_Quizz.Enabled = !isProf;

            setQuizzInfos();


            int count = 1;

            foreach (Question question in cQuizz.Questions)
            {
                string questionNumber = count.ToString();
                setQuestion(panel_Questions_Container, question, questionNumber);
                count++;
            }
        }
예제 #3
0
        protected void Button_RedirectToDetailUV_Click(object sender, EventArgs e)
        {
            string uv = uvContext.GetById(cProject.IdUV).Denomination;

            Response.Redirect("/UVS/DetailUV.aspx?uv=" + uv, true);
        }