Ejemplo n.º 1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string s  = SectionTitle.Text.Trim();
        string c  = txtCode.Text.Trim();
        string i  = txtintro.Text.Trim();
        bool   st = bool.Parse(status.SelectedValue);
        int    pr = int.Parse(txtpri.Text);


        Button btn = (Button)sender;

        if (!string.IsNullOrEmpty(Request.QueryString["section"]))
        {
            byte bytID = byte.Parse(Request.QueryString["section"]);
            if (AssessmentController.EditSection(bytID, s, c, i, st, pr))
            {
                Response.Redirect("Assessmentoptionaddedit");
            }
        }
        else
        {
            if (AssessmentController.AddSection(s, c, i, pr) > 0)
            {
                Response.Redirect(Request.Url.ToString());
            }
        }
    }