private void testsidecount(string code) { con.Open(); com = new SqlCommand("SELECT COUNT(*) FROM Registration_Master WHERE sponcorid='" + code + "'", con); int count = (int)com.ExecuteScalar(); SqlDataAdapter da = new SqlDataAdapter(); try { if (count == 2) { int presentCount = 0; presentCount++; SqlCommand comm = new SqlCommand(); comm.Connection = con; comm.CommandText = "UPDATE Registration_Master SET count_mem = '" + presentCount + "' ,modifieddate='" + DateTime.Now + "' WHERE regCode = '" + code + "'"; comm.CommandType = CommandType.Text; comm.ExecuteNonQuery(); if ((sponcorL2.Text != "Blank") && (sponcorR3.Text != "Blank")) { int temp = 0; temp = presentCount + 1; comm = new SqlCommand(); comm.Connection = con; comm.CommandText = "UPDATE Registration_Master SET count_mem='" + temp + "' WHERE sponcorid='" + sponcor + "'"; comm.CommandType = CommandType.Text; comm.ExecuteNonQuery(); if ((SponcorL4.Text != "Blank") && (sponcorR7.Text != "Blank")) { int temp1 = 3; com.Connection = con; com.CommandText = "UPDATE Registration_Master SET count_mem='" + temp1 + "' WHERE sponcorid='" + sponcor + "'"; com.CommandType = CommandType.Text; com.ExecuteNonQuery(); if ((sponcorL8.Text != "Blank") && (sponcorR15.Text != "Blank")) { string count4 = ""; count4 = "4"; com.Connection = con; com.CommandText = "UPDATE Registration_Master SET count_mem='" + count4 + "' WHERE sponcorid='" + sponcor + "'"; com.CommandType = CommandType.Text; com.ExecuteNonQuery(); if ((sponcorL16.Text != "Blank") && (sponcorR31.Text != "Blank")) { string count5 = ""; count5 = "5"; com.Connection = con; com.CommandText = "UPDATE Registration_Master SET count_mem='" + count5 + "' WHERE sponcorid='" + sponcor + "'"; com.CommandType = CommandType.Text; com.ExecuteNonQuery(); if ((sponcorL32.Text != "Blank") && (sponcorR63.Text != "Blank")) { string count6 = ""; count6 = "6"; com.Connection = con; com.CommandText = "UPDATE Registration_Master SET count_mem='" + count6 + "' WHERE sponcorid='" + sponcor + "'"; com.CommandType = CommandType.Text; com.ExecuteNonQuery(); if ((sponcorL64.Text != "Blank") && (sponcorR127.Text != "Blank")) { string count7 = ""; count7 = "7"; com.Connection = con; com.CommandText = "UPDATE Registration_Master SET count_mem='" + count7 + "' WHERE sponcorid='" + sponcor + "'"; com.CommandType = CommandType.Text; com.ExecuteNonQuery(); if ((sponcorL128.Text != "Blank") && (sponcorR255.Text != "Blank")) { string count8 = ""; count8 = "8"; com.Connection = con; com.CommandText = "UPDATE Registration_Master SET count_mem='" + count8 + "' WHERE sponcorid='" + sponcor + "'"; com.CommandType = CommandType.Text; com.ExecuteNonQuery(); if ((sponcorL256.Text != "Blank") && (sponcorR511.Text != "Blank")) { string count9 = ""; count9 = "9"; com.Connection = con; com.CommandText = "UPDATE Registration_Master SET count_mem='" + count9 + "' WHERE sponcorid='" + sponcor + "'"; com.CommandType = CommandType.Text; com.ExecuteNonQuery(); if ((sponcorL512.Text != "Blank") && (sponcorR1023.Text != "Blank")) { string count10 = ""; count10 = "10"; com.Connection = con; com.CommandText = "UPDATE Registration_Master SET count_mem='" + count10 + "' WHERE sponcorid='" + sponcor + "'"; com.CommandType = CommandType.Text; com.ExecuteNonQuery(); } } } } } } } } } } } catch (Exception ex) { throw ex; } finally { con.Close(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)