Exemplo n.º 1
0
        private void Update(DataGridCommandEventArgs e)
        {
            string strName        = dtbConfig.Rows[e.Item.ItemIndex]["Name"].ToString();
            string strDescription = dtbConfig.Rows[e.Item.ItemIndex]["Description"].ToString();

            bool noRichText = ((strName == "Number_Of_Quiz_Questions") || (strName == "css") || (strName == "ShowDetailedHelp") ||
                               (strName == "Student_Summary_Subject") || (strName == "Overdue_Summary_Subject"));

            string strValue = null;

            if (noRichText)
            {
                strValue = ((TextBox)dgrConfig.Items[(int)e.Item.ItemIndex].FindControl("txtValue_Edit2")).Text;
            }
            else
            {
                strValue = ((TextEditor)dgrConfig.Items[(int)e.Item.ItemIndex].FindControl("txtValue_Edit")).Text;
            }

            // Perform business update
            OrganisationConfig objOrgConfig = new OrganisationConfig();

            objOrgConfig.Update(0, strName, strDescription, strValue);

            // Done
            Response.Redirect("EmailDefault.aspx");
        }