protected void Button1_Click(object sender, EventArgs e) { int ID; PlayerProfileEntity objEntity = (new DA()).ValidateUser(txtName.Text.Trim(), txtEmail.Text.Trim()); if (objEntity != null) { Response.Write("<script>alert('User Already Registered');</script>"); return; } string gender; if(RadioButton1.Checked==true){ gender="Male"; } else { gender="Female"; } DA obj = new DA(); ID=obj.InsertCustomer(txtName.Text, Int32.Parse(txtAge.Text), gender, DropDownList1.SelectedValue, txtEmail.Text, 0); Session["Name"] = txtName.Text; Session["ID"] = ID; Response.Redirect("Consent.aspx"); }
protected void Button1_Click(object sender, EventArgs e) { Button1.Enabled = false; DropDownList1.Enabled = false; if (ConfigurationManager.AppSettings["GameMode"].ToString().Trim() == "B") { int result = 0; int ID = Int32.Parse(Session["ID"].ToString()); //int Team_ID = Math.DivRem(ID, 2, out result); int Team_ID = (int)Session["TeamId"]; DA obj = new DA(); int remainingtime = 32 - getTimeDifferenceNow(Application["CurrentRoundStartTime"].ToString()); if (remainingtime > 0) { (new DA()).insertchoiceofuser(((int)Application["CurrentRound"]) + 1, ((int)(Application["ChildRoundNo"])) % (((int)Application["bnTreeLevel"]) - 1) + 1, Convert.ToInt32(Session["InGameID"]), Convert.ToInt32(Session["ID"]), (int)Session["TeamId"], Int16.Parse(DropDownList1.SelectedValue), 0); } else { (new DA()).insertchoiceofuser(((int)Application["CurrentRound"]) + 1, ((int)(Application["ChildRoundNo"])) % (((int)Application["bnTreeLevel"]) - 1) +1, Convert.ToInt32(Session["InGameID"]), Convert.ToInt32(Session["ID"]), (int)Session["TeamId"], 0, 0); } //if (1 == 2) //{ //} int avg = obj.getAverage((int)Session["TeamId"], ((int)Application["CurrentRound"]) + 1, ((int)(Application["ChildRoundNo"])) % (((int)Application["bnTreeLevel"]) - 1) + 1, (int)Session["ID"]); if (avg != -1) { lblAverage.Text = "Your earning for the round as of now is:- " + avg.ToString(); } Button1.Enabled = false; DropDownList1.Enabled = false; } else { (new DA()).insertchoiceofuser(((int)Application["CurrentRound"]) + 1, 1, Convert.ToInt32(Session["InGameID"]), Convert.ToInt32(Session["ID"]), (int)Session["TeamId"], Int16.Parse(DropDownList1.SelectedValue), 0); } }
protected void UpdateAverage() { int result = 0; int ID = Int32.Parse(Session["ID"].ToString()); int avg; int Team_ID = Math.DivRem(ID, 2, out result); DA obj = new DA(); if(Team_ID !=0) avg = obj.getAverage(ID,Team_ID); else avg = obj.getAverage(ID,ID); lblAverage.Text = "Your earning for the round as of now is:- " + avg.ToString(); //insertChoice(((int)Application["CurrentRound"]), ID, (int)Application["bnTreeLevel"], avg); insertChoice(((int)Application["CurrentRound"]), ID, (int)Application["bnTreeLevel"], avg); }