Exemple #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtLabelText.Text))
            {
                lblTextError.Visible = true;
                return;
            }
            var label = new Academic.DbEntities.ActivityAndResource.LabelResource()
            {
                Id   = LabelId,
                Text = txtLabelText.Text.Trim()
            };

            if (SectionId > 0)
            {
                var restriction = new Academic.DbEntities.AccessPermission.Restriction()
                {
                };
                using (var helper = new DbHelper.ActAndRes())
                {
                    var saved = helper.AddOrUpdateLabelResource(label, SectionId, restriction);
                    if (saved != null)
                    {
                        Response.Redirect(DbHelper.StaticValues.WebPagePath.CourseDetailPage(SubjectId, SectionId));
                        //Response.Redirect("~/Views/Course/Section/Master/CourseSectionListing.aspx?SubId=" + SubjectId + "&edit=1#section_" + SectionId);
                    }
                }
            }
        }