Exemple #1
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        int secID = int.Parse(dropSection.SelectedValue);

        string strtitle = txtSubTitle.Text.Trim();
        bool   Status   = bool.Parse(radioSubStatus.SelectedValue);

        string combind    = Combind.Text;
        string combindRet = string.Empty;

        if (!string.IsNullOrEmpty(combind))
        {
            string[] arrc = combind.Split(',');
            combindRet = string.Join(",", arrc.Select(i => i.Substring(2)).ToArray());
        }

        Model_AsSubSection sub = new Model_AsSubSection
        {
            SCID    = secID,
            Title   = strtitle,
            Status  = Status,
            Combind = combindRet
        };

        Button btn = (Button)sender;

        if (!string.IsNullOrEmpty(Request.QueryString["subsection"]))
        {
            int bytID = int.Parse(Request.QueryString["subsection"]);
            sub.SUCID = bytID;

            if (AssessmentController.EditSubSection(sub))
            {
                Response.Redirect("Assessmentoptionaddedit?tab=2&section=" + dropSection.SelectedValue);
            }
        }
        else
        {
            if (AssessmentController.AddSubSection(sub) > 0)
            {
                Response.Redirect(Request.Url.ToString());
            }
        }
    }