using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class rl_students_pg_RegisterCancelReason : System.Web.UI.Page
{
    //*********************************
    SqlConnection con;
    SqlCommand cmd;
    //*********************************
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string cancelDate = "", cancelReason = "";
            C_myClass.MenueItemsCreate(User, panelMenues);
            Label lblTitle = (Label)this.Master.FindControl("lblTitle");
            lblTitle.Text = "دلیل رد ثبت نام";
            int regId = Int32.Parse(Request.QueryString["regId"].ToString());
            string conString = RamanConnectionString.LocalConnectionString();
            con = new SqlConnection(conString);
            cmd = con.CreateCommand();
            try
            {
                con.Open();
                cmd.CommandText = "select cancelDate, cancelReason FROM t_Registers Where regId = " + regId;
                SqlDataReader rdr = cmd.ExecuteReader();
                if (rdr.HasRows)
                {
                    while (rdr.Read())
                    {
                        cancelDate = ( rdr.GetValue(0) != DBNull.Value ? rdr.GetString(0) : "");
                        cancelReason = (rdr.GetValue(1) != DBNull.Value ? rdr.GetString(1) : "");
                    }
                }
                rdr.Close();
                lblCancelDate.Text = "تاریخ رد ثبت نام : " + cancelDate;
                lblCancelReason.Text = "دلیل رد ثبت نام : " + cancelReason;
            }
            catch
            {
            }
            finally
            {
                if (con.State != ConnectionState.Closed)
                    con.Close();
            }
        }
        catch
        {
        }
        finally
        {
        }
    }
    protected void btnBack_Click(object sender, EventArgs e)
    {
        try
        {
            string returnUrl = Request.QueryString["returnUrl"].ToString();
            Response.Redirect(returnUrl);
        }
        catch
        {
        }
    }
}
