using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.IO;
using DataOper;

public partial class admin_report_registration_details : System.Web.UI.Page
{
    DataOperation dOper = new DataOperation();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["id"] != null)
            {
                PopDetails();
            }
        }
    }
    public void PopDetails()
    {
        string str_content = "";
        DataTable dt = dOper.return_dt("select * from tbl_registration_form where Member_id='" + Convert.ToString(Request.QueryString["id"]).Replace("'","") + "'");
        if (dt.Rows.Count > 0)
        {
            str_content = str_content + "<table class='custom_table'><tr class='table_hdr'><td width='150px'>Category</td><td width='250px'>" + Convert.ToString(dt.Rows[0]["memberType"]) + "</td><td width='100px'>Amount</td><td width='180px'>" + Convert.ToString(dt.Rows[0]["booking_amt"]) + "</td><td width='100px'>Date</td><td width='150px'>" + Convert.ToDateTime(dt.Rows[0]["action_on"]).ToString("dd.MM.yyyy") + "</td></tr></table>";
            str_content = str_content + "<table class='custom_table mt-3 mt-3'><tr class='table_hdr'><td width='60px'>Sl No.</td><td width='250px'>Name</td><td width='250px'>Designation</td><td width='250px'>Email</td><td width='120px'>Mobile</td></tr>";

            DataTable dtMember = dOper.return_dt("select * from tbl_reg_participant_person where Member_id='" + Convert.ToString(dt.Rows[0]["Member_id"]) + "'");
            for (int i = 0; i < dtMember.Rows.Count; i++)
            {
                str_content = str_content + "<tr><td>" + (i + 1) + "</td><td>" + Convert.ToString(dtMember.Rows[i]["name"]) + "</td><td>" + Convert.ToString(dtMember.Rows[i]["designation"]) + "</td><td>" + Convert.ToString(dtMember.Rows[i]["email"]) + "</td><td>" + Convert.ToString(dtMember.Rows[i]["mobile"]) + "</td></tr>";
            }
            str_content = str_content + "</table><table class='custom_table mt-3'><tr class='table_hdr'><td colspan='4'>Nominated By:</td></tr>";
            str_content = str_content + "<tr><td align='left' width='150px'>First Name</td><td align='left' width='300px'>" + Convert.ToString(dt.Rows[0]["first_name"]) + "</td><td align='left' width='180px'>Last Name</td><td align='left' width='300px'>" + Convert.ToString(dt.Rows[0]["last_name"]) + "</td></tr>";
            str_content = str_content + "<tr><td align='left'>Designation</td><td align='left' colspan='3'>" + Convert.ToString(dt.Rows[0]["designation"]) + "</td></tr>";
            str_content = str_content + "<tr><td align='left'>Mobile</td><td align='left'>" + Convert.ToString(dt.Rows[0]["mobile"]) + "</td><td align='left'>Email</td><td align='left'>" + Convert.ToString(dt.Rows[0]["email"]) + "</td></tr>";
            str_content = str_content + "<tr><td align='left'>Organization</td><td align='left' colspan='3'>" + Convert.ToString(dt.Rows[0]["organization"]) + "</td></tr>";
            str_content = str_content + "<tr><td align='left'>GST No</td><td align='left'>" + Convert.ToString(dt.Rows[0]["gst_no"]) + "</td><td align='left'>Pan No.(For Individual)</td><td align='left'>" + Convert.ToString(dt.Rows[0]["pan_no"]) + "</td></tr></table>";
        }
        litContent.Text = str_content;
    }
}