protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { genratetable(); date(); bind(); se = Convert.ToInt32(id); // Tree(Convert.ToString(Session["id"])); check(id); // ActiveidL = ActiveidL - 1; if (Activeid < ActiveidL) { aco = Activeid.ToString(); } else { aco = ActiveidL.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { Label17.Visible = false; Label18.Visible = false; Label19.Visible = false; Label20.Visible = false; Label21.Visible = false; Label22.Visible = false; string[] Month = new string[12]; Month[0] = "Jan"; Month[1] = "Feb"; Month[2] = "Mar"; Month[3] = "Apr"; Month[4] = "May"; Month[5] = "Jun"; Month[6] = "Jul"; Month[7] = "Aug"; Month[8] = "Sep"; Month[9] = "Oct"; Month[10] = "Nov"; Month[11] = "Dec"; if (Page.IsPostBack == false) { DateTime last2 = System.DateTime.Now.AddMonths(-2); DateTime last = System.DateTime.Now.AddMonths(-1); int l = last.Month - 1; int l2 = last2.Month - 1; lnklast2.CommandArgument = l2.ToString(); lnklast.CommandArgument = l.ToString(); lnklast.Text = Month[l].ToString(); lnklast2.Text = Month[l2].ToString(); date(); se = Convert.ToInt32(Session["id"]); Tree(Convert.ToString(Session["id"])); check(Convert.ToString(Session["id"])); pNodeL(Convert.ToString(Session["id"]), "Left"); pNodeR(Convert.ToString(Session["id"]), "Right"); // ActiveidL = ActiveidL - 1; if (Activeid < ActiveidL) { aco = Activeid.ToString(); } else { aco = ActiveidL.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { date(); se = Convert.ToInt32(Session["id"]); // Tree(Convert.ToString(Session["id"])); check(Convert.ToString(Session["id"])); pNodeL(Convert.ToString(Session["id"]), "Left"); pNodeR(Convert.ToString(Session["id"]), "Right"); // ActiveidL = ActiveidL - 1; if (Activeid < ActiveidL) { aco = Activeid.ToString(); } else { aco = ActiveidL.ToString(); } SqlConnection con = new SqlConnection(); con.ConnectionString = ConfigurationManager.ConnectionStrings["cn"].ConnectionString; con.Open(); Int64 lbus = 0; { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select id from member_creation where upleg=@ID and side='Left'"; cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["ID"]); cmd.Connection = con; if (Convert.ToString(cmd.ExecuteScalar()) != "") { SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select active from cnt_down(@ID)"; cmd1.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(cmd.ExecuteScalar()); cmd1.Connection = con; Label33.Text = Convert.ToString(cmd1.ExecuteScalar()); lbus = Convert.ToInt64(cmd1.ExecuteScalar()); } else { Label33.Text = "0"; } } Int64 rbus = 0; { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select id from member_creation where upleg=@ID and side='Right'"; cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["ID"]); cmd.Connection = con; if (Convert.ToString(cmd.ExecuteScalar()) != "") { SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select active from cnt_down(@ID)"; cmd1.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(cmd.ExecuteScalar()); cmd1.Connection = con; Label34.Text = Convert.ToString(cmd1.ExecuteScalar()); rbus = Convert.ToInt64(cmd1.ExecuteScalar()); } else { Label34.Text = "0"; } } { SqlCommand cmd11 = new SqlCommand(); cmd11.CommandText = "select count(*) from member_creation where spon=@ID"; cmd11.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["ID"]); cmd11.Connection = con; if (Convert.ToInt64(cmd11.ExecuteScalar()) >= 4) { Label9.Text = "Yes"; } { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select count(*) from rewards where reward=1 and id=@ID"; cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd.Connection = con; if (Convert.ToInt64(cmd.ExecuteScalar()) >= 1) { Label10.Text = "Yes"; SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select convert(varchar,date_entry,106) from rewards where reward=1 and id=@ID"; cmd1.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd1.Connection = con; Label3.Text = Convert.ToString(cmd1.ExecuteScalar()); } } } { if (lbus >= 30 && rbus >= 30) { Label11.Text = "Yes"; } { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select count(*) from rewards where reward=2 and id=@ID"; cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd.Connection = con; if (Convert.ToInt64(cmd.ExecuteScalar()) >= 1) { Label12.Text = "Yes"; SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select convert(varchar,date_entry,106) from rewards where reward=2 and id=@ID"; cmd1.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd1.Connection = con; Label4.Text = Convert.ToString(cmd1.ExecuteScalar()); } } } { if (lbus >= 125 && rbus >= 125) { Label13.Text = "Yes"; } { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select count(*) from rewards where reward=3 and id=@ID"; cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd.Connection = con; if (Convert.ToInt64(cmd.ExecuteScalar()) >= 1) { Label14.Text = "Yes"; SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select convert(varchar,date_entry,106) from rewards where reward=3 and id=@ID"; cmd1.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd1.Connection = con; Label5.Text = Convert.ToString(cmd1.ExecuteScalar()); } } } { if (lbus >= 500 && rbus >= 500) { Label15.Text = "Yes"; } { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select count(*) from rewards where reward=4 and id=@ID"; cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd.Connection = con; if (Convert.ToInt64(cmd.ExecuteScalar()) >= 1) { Label16.Text = "Yes"; SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select convert(varchar,date_entry,106) from rewards where reward=4 and id=@ID"; cmd1.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd1.Connection = con; Label6.Text = Convert.ToString(cmd1.ExecuteScalar()); } } } { if (lbus >= 1000 && rbus >= 1000) { Label17.Text = "Yes"; } { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select count(*) from rewards where reward=5 and id=@ID"; cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd.Connection = con; if (Convert.ToInt64(cmd.ExecuteScalar()) >= 1) { Label18.Text = "Yes"; SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select convert(varchar,date_entry,106) from rewards where reward=5 and id=@ID"; cmd1.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd1.Connection = con; Label7.Text = Convert.ToString(cmd1.ExecuteScalar()); } } } { if (lbus >= 2050 && rbus >= 2050) { Label19.Text = "Yes"; } { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select count(*) from rewards where reward=6 and id=@ID"; cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd.Connection = con; if (Convert.ToInt64(cmd.ExecuteScalar()) >= 1) { Label20.Text = "Yes"; SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select convert(varchar,date_entry,106) from rewards where reward=6 and id=@ID"; cmd1.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd1.Connection = con; Label8.Text = Convert.ToString(cmd1.ExecuteScalar()); } } } { if (lbus >= 3200 && rbus >= 3200) { Label21.Text = "Yes"; } { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select count(*) from rewards where reward=7 and id=@ID"; cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd.Connection = con; if (Convert.ToInt64(cmd.ExecuteScalar()) >= 1) { Label22.Text = "Yes"; SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select convert(varchar,date_entry,106) from rewards where reward=7 and id=@ID"; cmd1.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd1.Connection = con; Label25.Text = Convert.ToString(cmd1.ExecuteScalar()); } } } { if (lbus >= 10000 && rbus >= 10000) { Label23.Text = "Yes"; } { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select count(*) from rewards where reward=8 and id=@ID"; cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd.Connection = con; if (Convert.ToInt64(cmd.ExecuteScalar()) >= 1) { Label24.Text = "Yes"; SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select convert(varchar,date_entry,106) from rewards where reward=8 and id=@ID"; cmd1.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd1.Connection = con; Label26.Text = Convert.ToString(cmd1.ExecuteScalar()); } } } { if (lbus >= 25000 && rbus >= 25000) { Label1.Text = "Yes"; } { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select count(*) from rewards where reward=9 and id=@ID"; cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd.Connection = con; if (Convert.ToInt64(cmd.ExecuteScalar()) >= 1) { Label2.Text = "Yes"; SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select convert(varchar,date_entry,106) from rewards where reward=9 and id=@ID"; cmd1.Parameters.Add("@ID", SqlDbType.VarChar).Value = Convert.ToString(Session["id"]); cmd1.Connection = con; Label27.Text = Convert.ToString(cmd1.ExecuteScalar()); } } } con.Dispose(); }