Пример #1
0
    protected void Button6_Click(object sender, EventArgs e)
    {
        int secID = int.Parse(dropsection_1.SelectedValue);

        string strtitle = txtSubTitle2.Text.Trim();
        bool   Status   = bool.Parse(radioSubStatus2.SelectedValue);

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

        if (!string.IsNullOrEmpty(combind))
        {
            string[] arrc = combind.Split(',');
            combindRet = string.Join(",", arrc.Select(i => i.Substring(2)).ToArray());
        }
        Model_AsSubSection2 sub = new Model_AsSubSection2
        {
            SCID    = secID,
            Title   = strtitle,
            Status  = Status,
            Combind = combindRet
        };

        Button btn = (Button)sender;

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

            if (AssessmentController.EditSubSection2(sub))
            {
                Response.Redirect("Assessmentoptionaddedit?tab=5&section=" + dropsection_1.SelectedValue);
            }
        }
        else
        {
            if (AssessmentController.AddSubSection2(sub) > 0)
            {
                Response.Redirect(Request.Url.ToString());
            }
        }
    }