Exemple #1
0
    protected void btn_add_Click(object sender, EventArgs e)
    {
        // Check whether admin section is in readonly mode.
        if (!Config.isAdminActionAllowed())
        {
            Response.Redirect(Config.GetUrl("adm/sc/Default.aspx?action_error=true"));
            return;
        }


        ConfigurationBLL.Update_Value(1, txt_title.Text);
        ConfigurationBLL.Update_Value(2, txt_description.Text);

        ConfigurationBLL.Update_Value(4, txt_email.Text);
        ConfigurationBLL.Update_Value(5, txt_emaildisplayname.Text);

        ConfigurationBLL.Update_Value(7, drp_databasetype.SelectedValue);
        ConfigurationBLL.Update_Value(8, drp_screening.SelectedValue);
        ConfigurationBLL.Update_Value(9, drp_approvaltype.SelectedValue);
        ConfigurationBLL.Update_Value(10, txt_abusereport_count.Text);
        ConfigurationBLL.Update_Value(11, txt_cache.Text);

        ConfigurationBLL.Update_Value(17, txt_channel_psize.Text);


        ConfigurationBLL.Update_Value(183, txt_tracking.Text);
        ConfigurationBLL.Update_Value(186, drp_template.SelectedValue);
        ConfigurationBLL.Update_Value(171, drp_navigationside.SelectedValue);
        ConfigurationBLL.Update_Value(26, txt_max_url_length.Text);


        Load_Settings();

        Config.ShowMessageV2(msg, "General Configuration Settings Updated Successfully", "Success!", 1);
    }
        public void ProcessRequest(HttpContext context)
        {
            var json = new StreamReader(context.Request.InputStream).ReadToEnd();
            var responseMsg = new Dictionary <string, string>(); var _ld_post_data = new Dictionary <string, CategoryObject>();

            if ((context.Request.Params["action"] != null))
            {
                switch (context.Request.Params["action"])
                {
                // This update is only for pubplishing pending videos (unpublished videos only)
                case "update":

                    // Authentication
                    if (!context.User.Identity.IsAuthenticated)
                    {
                        responseMsg["status"]  = "error";
                        responseMsg["message"] = "Authentication Failed";
                        context.Response.Write(responseMsg);
                        return;
                    }
                    var _data = JsonConvert.DeserializeObject <Category_Struct>(json);
                    ConfigurationBLL.Update_Value(_data.ID, _data.Name);

                    responseMsg["status"]  = "success";
                    responseMsg["message"] = "Operation Commit";
                    context.Response.Write(responseMsg);
                    break;

                case "return_value":
                    int ID = 0;
                    if (context.Request.Params["id"] != null)
                    {
                        ID = Convert.ToInt32(context.Request.Params["id"]);
                    }

                    responseMsg["value"] = ConfigurationBLL.Return_Value(ID);
                    context.Response.Write(responseMsg);
                    break;
                }
            }
            else
            {
                // No action found
                responseMsg["status"]  = "error";
                responseMsg["message"] = "No action found";
                context.Response.Write(JsonConvert.SerializeObject(responseMsg));
            }
        }
    protected void btn_add_Click(object sender, EventArgs e)
    {
        // Check whether admin section is in readonly mode.
        if (!Config.isAdminActionAllowed())
        {
            Response.Redirect(Config.GetUrl("adm/sc/Default.aspx?action_error=true"));
            return;
        }

        // update configuration values in database
        string value = "0";

        if (r_channels_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(74, value);



        if (r_comments_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(84, value);



        if (r_ads_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(90, value);

        if (r_email_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(91, value);

        if (r_email_ver_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(92, value);



        if (r_adult_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(94, value);

        if (r_rating_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(100, value);

        if (r_views_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(95, value);

        if (r_date_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(96, value);

        if (r_username_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(99, value);

        if (r_registration_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(97, value);

        if (r_registration_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(150, value);


        if (r_mchannel_on.Checked)
        {
            value = "true";
        }
        else
        {
            value = "false";
        }
        ConfigurationBLL.Update_Value(24, value);

        if (r_ip_on.Checked)
        {
            value = "true";
        }
        else
        {
            value = "false";
        }
        ConfigurationBLL.Update_Value(12, value);



        if (r_login_rating_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(101, value);

        if (r_login_comment_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(102, value);

        if (r_advice_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(103, value);

        if (r_cviews_on.Checked)
        {
            value = "1";
        }
        else
        {
            value = "0";
        }
        ConfigurationBLL.Update_Value(23, value);

        Load_Settings();
        Config.ShowMessageV2(msg, "Feature Configuration Settings Updated Successfully", "Success!", 1);
    }