protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e) { precio = 0; ListBox2.Items.Clear(); if (ListBox1.SelectedValue == "Ford") { Image1.ImageUrl = "imagenes/ford.jpg"; ListBox2.DataSource = arrayFord; ListBox2.DataBind(); } else if (ListBox1.SelectedValue == "Peugeot") { Image1.ImageUrl = "imagenes/peugeot.jpg"; ListBox2.DataSource = arrayPeugeot; ListBox2.DataBind(); } else if (ListBox1.SelectedValue == "Renault") { Image1.ImageUrl = "imagenes/renault.jpg"; ListBox2.DataSource = arrayRenault; ListBox2.DataBind(); } if (RadioButtonList1.SelectedValue == "Si") { RadioButtonList1.SelectedValue = "No"; } RadioButtonList2.ClearSelection(); color = ""; Label2.Text = precio.ToString(); }
private void reset() { TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; TextBox7.Text = ""; TextBox8.Text = ""; TextBox9.Text = ""; TextBox10.Text = ""; TextBox11.Text = ""; TextBox15.Text = ""; TextBox16.Text = ""; TextBox17.Text = ""; TextBox18.Text = ""; TextBox19.Text = ""; RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); RadioButtonList5.ClearSelection(); DropDownList1.SelectedIndex = 0; DropDownList2.SelectedIndex = 0; DropDownList3.SelectedIndex = 0; DropDownList5.SelectedIndex = 0; }
protected void ListBox2_SelectedIndexChanged(object sender, EventArgs e) { int indice = ListBox2.SelectedIndex; if (ListBox1.SelectedValue == "Peugeot") { precio = preciosPeugeot[indice]; } if (ListBox1.SelectedValue == "Renault") { precio = preciosRenault[indice]; } if (ListBox1.SelectedValue == "Ford") { precio = preciosFord[indice]; } Label2.Text = precio.ToString(); control = false; if (RadioButtonList1.SelectedValue == "Si") { RadioButtonList1.SelectedValue = "No"; } RadioButtonList2.ClearSelection(); color = ""; }
protected void Button1_Click(object sender, EventArgs e) { eventsource.InsertParameters["event_title"].DefaultValue = TextBox7.Text.ToUpper().Trim(); eventsource.InsertParameters["event_start_date"].DefaultValue = TextBox10.Text.ToUpper().Trim(); eventsource.InsertParameters["event_end_date"].DefaultValue = TextBox12.Text.ToUpper().Trim(); eventsource.InsertParameters["event_end_time"].DefaultValue = TextBox24.Text.ToUpper().Trim(); eventsource.InsertParameters["event_start_time"].DefaultValue = TextBox11.Text.ToUpper().Trim(); eventsource.InsertParameters["event_place"].DefaultValue = CheckBoxList1.SelectedValue; eventsource.InsertParameters["event_capacity"].DefaultValue = TextBox15.Text.Trim(); eventsource.InsertParameters["multi_day_event"].DefaultValue = RadioButtonList1.SelectedValue; eventsource.InsertParameters["audio_visual"].DefaultValue = RadioButtonList2.SelectedValue; eventsource.InsertParameters["user_id"].DefaultValue = TextBox25.Text.Trim(); eventsource.Insert(); TextBox7.Text = string.Empty; TextBox10.Text = string.Empty; TextBox12.Text = string.Empty; TextBox24.Text = string.Empty; TextBox11.Text = string.Empty; TextBox5.Text = string.Empty; TextBox25.Text = string.Empty; TextBox2.Text = string.Empty; TextBox3.Text = string.Empty; TextBox6.Text = string.Empty; TextBox15.Text = string.Empty; TextBox8.Text = string.Empty; CheckBoxList1.ClearSelection(); RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); }
protected void btnClear_Click(object sender, EventArgs e) { RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); RadioButtonList4.ClearSelection(); RadioButtonList5.ClearSelection(); }
protected void Button1_Click(object sender, EventArgs e) { Button1.BackColor = System.Drawing.Color.Red; Button2.BackColor = System.Drawing.Color.Silver; Panel1.Visible = true; Panel2.Visible = false; RadioButtonList2.ClearSelection(); }
protected void clear() { txtroomno.Text = ""; RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); Image1.ImageUrl = ""; txtdesc.Text = ""; txtrate.Text = ""; }
protected void Button2_Click(object sender, EventArgs e) { DropDownList1.ClearSelection(); TextBox1.Text = ""; TextBox2.Text = ""; RadioButtonList1.ClearSelection(); DropDownList3.ClearSelection(); RadioButtonList2.ClearSelection(); }
private void reset() { DDLSem0.Text = ""; TBSName.Text = ""; TBSCode.Text = ""; DDLBName.SelectedIndex = 0; DDLSem.SelectedIndex = 0; DDLYear.SelectedIndex = 0; RadioButtonList2.ClearSelection(); }
protected void Tipo_Rale_SelectedIndexChanged(object sender, EventArgs e) { LabelMensaje.Visible = false; Rale1.Items.Clear(); Rale1.Items.Add(new ListItem("-- Selecciona Rale Base --", "")); Rale2.Items.Clear(); Rale2.Items.Add(new ListItem("-- Selecciona Rale a Comparar --", "")); Rale2.Enabled = false; RadioButtonList1.ClearSelection(); RadioButtonList1.Enabled = false; RadioButtonList2.ClearSelection(); RadioButtonList2.Enabled = false; fecha1.Items.Clear(); fecha1.Items.Add(new ListItem("-- Seleccione el Periodo Inicial --", "")); fecha1.Enabled = false; fecha2.Items.Clear(); fecha2.Items.Add(new ListItem("-- Seleccione el Periodo Final --", "")); fecha2.Enabled = false; Rale1.AppendDataBoundItems = true; String strConnString = ConfigurationManager.ConnectionStrings["SupervisionConnectionString"].ConnectionString; String strQuery = "SELECT CONVERT(NVARCHAR, fecha_rale, 105) AS MOSTRAR, CONVERT (NVARCHAR, fecha_rale, 112) AS VALUE FROM Rales_Combo WHERE (tipo_rale = @COP_RCV ) ORDER BY VALUE ASC"; SqlConnection con = new SqlConnection(strConnString); SqlCommand cmd = new SqlCommand(); cmd.Parameters.AddWithValue("@COP_RCV", Tipo_Rale.SelectedItem.Value); cmd.CommandType = CommandType.Text; cmd.CommandText = strQuery; cmd.Connection = con; try { con.Open(); Rale1.DataSource = cmd.ExecuteReader(); Rale1.DataTextField = "MOSTRAR"; Rale1.DataValueField = "VALUE"; Rale1.DataBind(); if (Rale1.Items.Count > 1) { Rale1.Enabled = true; } else { Rale1.Enabled = false; Rale2.Enabled = false; } } catch (Exception ex) { throw ex; } finally { con.Close(); con.Dispose(); } }
protected void Btn4Reset_Click(object sender, EventArgs e) { Preguntas.ActiveViewIndex = 0; RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); RadioButtonList4.ClearSelection(); RadioButtonList5.ClearSelection(); lbResultado.Text = ""; lbResultado.Visible = false; }
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { RadioButtonList2.Enabled = true; fecha1.Items.Clear(); fecha1.Items.Add(new ListItem("-- Seleccione el Periodo Inicial --", "")); fecha1.Enabled = false; fecha2.Items.Clear(); fecha2.Items.Add(new ListItem("-- Seleccione el Periodo Final --", "")); fecha2.Enabled = false; RadioButtonList2.ClearSelection(); }
public void bosalt() { plaka_numarasi.Text = ""; birim_adi.Text = ""; marka.Text = ""; model.Text = ""; DropDownList1.SelectedIndex = 0; RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); }
protected void Button2_Click(object sender, EventArgs e) { TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; TextBox7.Text = ""; TextBox8.Text = ""; RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); CheckBoxList1.ClearSelection(); }
private void BindRadioButtonList() { List <TestClass> myList = new List <TestClass>(); myList.Add(new TestClass("1", "数据绑定值 1")); myList.Add(new TestClass("2", "数据绑定值 2")); myList.Add(new TestClass("3", "数据绑定值 3")); myList.Add(new TestClass("4", "数据绑定值 4")); RadioButtonList2.DataTextField = "Name"; RadioButtonList2.DataValueField = "Id"; RadioButtonList2.DataSource = myList; RadioButtonList2.DataBind(); RadioButtonList2.SelectedValue = "3"; }
private void InitRadioButtonList2() { List <TestClass> myList = new List <TestClass>(); myList.Add(new TestClass("value1", "可选项 1")); myList.Add(new TestClass("value2", "可选项 2")); myList.Add(new TestClass("value3", "可选项 3")); myList.Add(new TestClass("value4", "可选项 4")); myList.Add(new TestClass("value5", "可选项 5")); myList.Add(new TestClass("value6", "可选项 6")); RadioButtonList2.DataTextField = "Name"; RadioButtonList2.DataValueField = "Id"; RadioButtonList2.DataSource = myList; RadioButtonList2.DataBind(); RadioButtonList2.SelectedValue = "value1"; }
protected void Button2_Click(object sender, EventArgs e) { TextBox7.Text = string.Empty; TextBox10.Text = string.Empty; TextBox12.Text = string.Empty; TextBox24.Text = string.Empty; TextBox11.Text = string.Empty; TextBox5.Text = string.Empty; TextBox25.Text = string.Empty; TextBox2.Text = string.Empty; TextBox3.Text = string.Empty; TextBox6.Text = string.Empty; TextBox15.Text = string.Empty; TextBox8.Text = string.Empty; CheckBoxList1.ClearSelection(); RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); }
protected void btnSubmit_Click(object sender, EventArgs e) { sComplete.CompletedSurveyID = count++; sComplete.CompletedSurveyName = ddlSurveyList.Text; sComplete.Answer1 = RadioButtonList1.SelectedValue; sComplete.Answer2 = RadioButtonList2.SelectedValue; sComplete.Answer3 = RadioButtonList3.SelectedValue; sComplete.Answer4 = RadioButtonList4.SelectedValue; sComplete.Answer5 = RadioButtonList5.SelectedValue; sComplete.Question1 = lblQuestion1.Text; sComplete.Question2 = lblQuestion2.Text; sComplete.Question3 = lblQuestion3.Text; sComplete.Question4 = lblQuestion4.Text; sComplete.Question5 = lblQuestion5.Text; if (sComplete.Answer1 != string.Empty && sComplete.Answer2 != string.Empty && sComplete.Answer3 != string.Empty && sComplete.Answer4 != string.Empty && sComplete.Answer5 != string.Empty) { lblSaved.Visible = true; ddlSurveyList.SelectedIndex = 0; lblQuestion1.Visible = false; lblQuestion2.Visible = false; lblQuestion3.Visible = false; lblQuestion4.Visible = false; lblQuestion5.Visible = false; RadioButtonList1.Visible = false; RadioButtonList2.Visible = false; RadioButtonList3.Visible = false; RadioButtonList4.Visible = false; RadioButtonList5.Visible = false; RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); RadioButtonList4.ClearSelection(); RadioButtonList5.ClearSelection(); } }
protected void Button1_Click(object sender, EventArgs e) { TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; TextBox7.Text = ""; TextBox8.Text = ""; TextBox9.Text = ""; RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); RadioButtonList4.ClearSelection(); DropDownList1.ClearSelection(); DropDownList3.ClearSelection(); DropDownList4.ClearSelection(); DropDownList5.ClearSelection(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataSet ds1 = GetData2(); for (int i = 0; i < 10; i++) { int Qid = int.Parse(ds1.Tables["Questions"].Rows[i][0].ToString()); DataSet ds = GetData1(Qid); int type = int.Parse(ds1.Tables["Questions"].Rows[i][2].ToString()); if (type == 0) { controlArray[i] = new string[4] { ds.Tables["Choices"].Rows[0][0].ToString(), ds.Tables["Choices"].Rows[1][0].ToString(), ds.Tables["Choices"].Rows[2][0].ToString(), ds.Tables["Choices"].Rows[3][0].ToString() }; } else { controlArray[i] = new string[2] { ds.Tables["Choices"].Rows[0][0].ToString(), ds.Tables["Choices"].Rows[1][0].ToString() }; } } RadioButtonList1.DataSource = controlArray[0]; RadioButtonList1.DataBind(); RadioButtonList2.DataSource = controlArray[1]; RadioButtonList2.DataBind(); RadioButtonList3.DataSource = controlArray[2]; RadioButtonList3.DataBind(); RadioButtonList4.DataSource = controlArray[3]; RadioButtonList4.DataBind(); RadioButtonList5.DataSource = controlArray[4]; RadioButtonList5.DataBind(); RadioButtonList6.DataSource = controlArray[5]; RadioButtonList6.DataBind(); RadioButtonList7.DataSource = controlArray[6]; RadioButtonList7.DataBind(); RadioButtonList8.DataSource = controlArray[7]; RadioButtonList8.DataBind(); RadioButtonList9.DataSource = controlArray[8]; RadioButtonList9.DataBind(); RadioButtonList10.DataSource = controlArray[9]; RadioButtonList10.DataBind(); Label1.Text = ds1.Tables["Questions"].Rows[0][1].ToString(); Label2.Text = ds1.Tables["Questions"].Rows[1][1].ToString(); Label3.Text = ds1.Tables["Questions"].Rows[2][1].ToString(); Label4.Text = ds1.Tables["Questions"].Rows[3][1].ToString(); Label5.Text = ds1.Tables["Questions"].Rows[4][1].ToString(); Label6.Text = ds1.Tables["Questions"].Rows[5][1].ToString(); Label7.Text = ds1.Tables["Questions"].Rows[6][1].ToString(); Label8.Text = ds1.Tables["Questions"].Rows[7][1].ToString(); Label9.Text = ds1.Tables["Questions"].Rows[8][1].ToString(); Label10.Text = ds1.Tables["Questions"].Rows[9][1].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var la = Request.QueryString["lan"].ToString(); //int alng = int.Parse(la); if (la == "en") { Panel1.Visible = true; Panel2.Visible = false; } else if (la == "ar") { Panel2.Visible = true; Panel1.Visible = false; Button1.Text = "التالي"; Button2.Text = "رجوع"; } var chap = Request.QueryString["id"].ToString(); int ch = int.Parse(chap); Tbl_ExamStructure rr = db.Tbl_ExamStructure.First(u => u.Chapter_ID == ch); int MCQA = rr.Num_Ques_Mcq_A; int MCQB = rr.Num_Ques_Mcq_B; int MCQC = rr.Num_Ques_Mcq_C; Tbl_Question rrA = db.Tbl_Question.First(u => u.Chapter_ID == ch && u.Question_Level == "A"); Tbl_Question rrB = db.Tbl_Question.First(u => u.Chapter_ID == ch && u.Question_Level == "B"); Tbl_Question rrC = db.Tbl_Question.First(u => u.Chapter_ID == ch && u.Question_Level == "C"); int qA = rrA.Question_ID; int qB = rrB.Question_ID; int qC = rrC.Question_ID; if (MCQA != 0) { Label1.Text = rrA.Question_En.ToString(); Label9.Text = rrA.Question_Ar.ToString(); var stateidA = from Tbl_Answer in db.Tbl_Answer where Tbl_Answer.Question_ID == qA select new { Tbl_Answer.Answer_En, Tbl_Answer.Correct_Answer, Tbl_Answer.Answer_Ar }; var statenameA = stateidA.ToList(); if (statenameA.Count > 0) { RadioButtonList1.DataSource = statenameA.ToList(); RadioButtonList1.DataTextField = "Answer_En"; RadioButtonList1.DataValueField = "Correct_Answer"; RadioButtonList1.DataBind(); RadioButtonList2.DataSource = statenameA.ToList(); RadioButtonList2.DataTextField = "Answer_Ar"; RadioButtonList2.DataValueField = "Correct_Answer"; RadioButtonList2.DataBind(); } } else if (MCQA == 0 && MCQB != 0) { Label1.Text = rrB.Question_En.ToString(); Label9.Text = rrB.Question_Ar.ToString(); Label3.Text = 1.ToString(); var stateidB = from Tbl_Answer in db.Tbl_Answer where Tbl_Answer.Question_ID == qB select new { Tbl_Answer.Answer_En, Tbl_Answer.Correct_Answer, Tbl_Answer.Answer_Ar }; var statenameB = stateidB.ToList(); if (statenameB.Count > 0) { RadioButtonList1.DataSource = statenameB.ToList(); RadioButtonList1.DataTextField = "Answer_En"; RadioButtonList1.DataValueField = "Correct_Answer"; RadioButtonList1.DataBind(); RadioButtonList2.DataSource = statenameB.ToList(); RadioButtonList2.DataTextField = "Answer_Ar"; RadioButtonList2.DataValueField = "Correct_Answer"; RadioButtonList2.DataBind(); } } else { Label1.Text = rrC.Question_En.ToString(); Label9.Text = rrC.Question_Ar.ToString(); Label4.Text = 1.ToString(); var stateidC = from Tbl_Answer in db.Tbl_Answer where Tbl_Answer.Question_ID == qC select new { Tbl_Answer.Answer_En, Tbl_Answer.Correct_Answer, Tbl_Answer.Answer_Ar }; var statenameC = stateidC.ToList(); if (statenameC.Count > 0) { RadioButtonList1.DataSource = statenameC.ToList(); RadioButtonList1.DataTextField = "Answer_En"; RadioButtonList1.DataValueField = "Correct_Answer"; RadioButtonList1.DataBind(); RadioButtonList2.DataSource = statenameC.ToList(); RadioButtonList2.DataTextField = "Answer_Ar"; RadioButtonList2.DataValueField = "Correct_Answer"; RadioButtonList2.DataBind(); } } } }
protected void Button1_Click(object sender, EventArgs e) { var la = Request.QueryString["lan"].ToString(); //int alng = int.Parse(la); if (la == "en") { int mark = int.Parse(RadioButtonList1.SelectedValue.ToString()); int final_mark = int.Parse(Label8.Text); final_mark += mark; Label8.Text = final_mark.ToString(); } else if (la == "ar") { int mark = int.Parse(RadioButtonList2.SelectedValue.ToString()); int final_mark = int.Parse(Label8.Text); final_mark += mark; Label8.Text = final_mark.ToString(); } //int mark = int.Parse(RadioButtonList1.SelectedValue.ToString()); //int final_mark = int.Parse(Label8.Text); //final_mark += mark; //Label8.Text = final_mark.ToString(); var chap = Request.QueryString["id"].ToString(); int ch = int.Parse(chap); Tbl_ExamStructure rr = db.Tbl_ExamStructure.First(u => u.Chapter_ID == ch); int MCQA = rr.Num_Ques_Mcq_A; int MCQB = rr.Num_Ques_Mcq_B; int MCQC = rr.Num_Ques_Mcq_C; int TFA = rr.Num_Ques_TF_A; int TFB = rr.Num_Ques_TF_B; int TFC = rr.Num_Ques_TF_C; int ques = MCQA + MCQB + MCQC + TFA + TFB + TFC; int y1 = int.Parse(Label2.Text); int y2 = int.Parse(Label3.Text); int y3 = int.Parse(Label4.Text); int y4 = int.Parse(Label5.Text); int y5 = int.Parse(Label6.Text); int y6 = int.Parse(Label7.Text); int num = y1 + y2 + y3 + y4 + y5 + y6; if (y1 < MCQA) { var rrA = db.Tbl_Question.Where(u => u.Chapter_ID == ch && u.Question_Level == "A" && u.Type == "MCQ").OrderBy(u => u.Question_ID).Skip(y1); foreach (var item in rrA) { Label1.Text = item.Question_En.ToString(); Label9.Text = item.Question_Ar.ToString(); y1 += 1; Label2.Text = y1.ToString(); int qA = item.Question_ID; var stateidA = from Tbl_Answer in db.Tbl_Answer where Tbl_Answer.Question_ID == qA select new { Tbl_Answer.Answer_En, Tbl_Answer.Correct_Answer, Tbl_Answer.Answer_Ar }; var statenameA = stateidA.ToList(); if (statenameA.Count > 0) { RadioButtonList1.DataSource = statenameA.ToList(); RadioButtonList1.DataTextField = "Answer_En"; RadioButtonList1.DataValueField = "Correct_Answer"; RadioButtonList1.DataBind(); RadioButtonList2.DataSource = statenameA.ToList(); RadioButtonList2.DataTextField = "Answer_Ar"; RadioButtonList2.DataValueField = "Correct_Answer"; RadioButtonList2.DataBind(); } break; } } else if (y2 < MCQB) { var rrA = db.Tbl_Question.Where(u => u.Chapter_ID == ch && u.Question_Level == "B" && u.Type == "MCQ").OrderBy(u => u.Question_ID).Skip(y2); foreach (var item in rrA) { Label1.Text = item.Question_En.ToString(); Label9.Text = item.Question_Ar.ToString(); y2 += 1; Label3.Text = y2.ToString(); int qA = item.Question_ID; var stateidA = from Tbl_Answer in db.Tbl_Answer where Tbl_Answer.Question_ID == qA select new { Tbl_Answer.Answer_En, Tbl_Answer.Correct_Answer, Tbl_Answer.Answer_Ar }; var statenameA = stateidA.ToList(); if (statenameA.Count > 0) { RadioButtonList1.DataSource = statenameA.ToList(); RadioButtonList1.DataTextField = "Answer_En"; RadioButtonList1.DataValueField = "Correct_Answer"; RadioButtonList1.DataBind(); RadioButtonList2.DataSource = statenameA.ToList(); RadioButtonList2.DataTextField = "Answer_Ar"; RadioButtonList2.DataValueField = "Correct_Answer"; RadioButtonList2.DataBind(); } break; } } else if (y3 < MCQC) { var rrA = db.Tbl_Question.Where(u => u.Chapter_ID == ch && u.Question_Level == "C" && u.Type == "MCQ").OrderBy(u => u.Question_ID).Skip(y3); foreach (var item in rrA) { Label1.Text = item.Question_En.ToString(); Label9.Text = item.Question_Ar.ToString(); y3 += 1; Label4.Text = y3.ToString(); int qA = item.Question_ID; var stateidA = from Tbl_Answer in db.Tbl_Answer where Tbl_Answer.Question_ID == qA select new { Tbl_Answer.Answer_En, Tbl_Answer.Correct_Answer, Tbl_Answer.Answer_Ar }; var statenameA = stateidA.ToList(); if (statenameA.Count > 0) { RadioButtonList1.DataSource = statenameA.ToList(); RadioButtonList1.DataTextField = "Answer_En"; RadioButtonList1.DataValueField = "Correct_Answer"; RadioButtonList1.DataBind(); RadioButtonList2.DataSource = statenameA.ToList(); RadioButtonList2.DataTextField = "Answer_Ar"; RadioButtonList2.DataValueField = "Correct_Answer"; RadioButtonList2.DataBind(); } break; } } else if (y4 < TFA) { var rrA = db.Tbl_Question.Where(u => u.Chapter_ID == ch && u.Question_Level == "A" && u.Type == "T/F").OrderBy(u => u.Question_ID).Skip(y4); foreach (var item in rrA) { Label1.Text = item.Question_En.ToString(); Label9.Text = item.Question_Ar.ToString(); y4 += 1; Label5.Text = y4.ToString(); int qA = item.Question_ID; var stateidA = from Tbl_Answer in db.Tbl_Answer where Tbl_Answer.Question_ID == qA select new { Tbl_Answer.Answer_En, Tbl_Answer.Correct_Answer, Tbl_Answer.Answer_Ar }; var statenameA = stateidA.ToList(); if (statenameA.Count > 0) { RadioButtonList1.DataSource = statenameA.ToList(); RadioButtonList1.DataTextField = "Answer_En"; RadioButtonList1.DataValueField = "Correct_Answer"; RadioButtonList1.DataBind(); RadioButtonList2.DataSource = statenameA.ToList(); RadioButtonList2.DataTextField = "Answer_Ar"; RadioButtonList2.DataValueField = "Correct_Answer"; RadioButtonList2.DataBind(); } break; } } else if (y5 < TFB) { var rrA = db.Tbl_Question.Where(u => u.Chapter_ID == ch && u.Question_Level == "B" && u.Type == "T/F").OrderBy(u => u.Question_ID).Skip(y5); foreach (var item in rrA) { Label1.Text = item.Question_En.ToString(); Label9.Text = item.Question_Ar.ToString(); y5 += 1; Label6.Text = y5.ToString(); int qA = item.Question_ID; var stateidA = from Tbl_Answer in db.Tbl_Answer where Tbl_Answer.Question_ID == qA select new { Tbl_Answer.Answer_En, Tbl_Answer.Correct_Answer, Tbl_Answer.Answer_Ar }; var statenameA = stateidA.ToList(); if (statenameA.Count > 0) { RadioButtonList1.DataSource = statenameA.ToList(); RadioButtonList1.DataTextField = "Answer_En"; RadioButtonList1.DataValueField = "Correct_Answer"; RadioButtonList1.DataBind(); RadioButtonList2.DataSource = statenameA.ToList(); RadioButtonList2.DataTextField = "Answer_Ar"; RadioButtonList2.DataValueField = "Correct_Answer"; RadioButtonList2.DataBind(); } break; } } else if (y6 < TFC) { var rrA = db.Tbl_Question.Where(u => u.Chapter_ID == ch && u.Question_Level == "C" && u.Type == "T/F").OrderBy(u => u.Question_ID).Skip(y6); foreach (var item in rrA) { Label1.Text = item.Question_En.ToString(); Label9.Text = item.Question_Ar.ToString(); y6 += 1; Label7.Text = y6.ToString(); int qA = item.Question_ID; var stateidA = from Tbl_Answer in db.Tbl_Answer where Tbl_Answer.Question_ID == qA select new { Tbl_Answer.Answer_En, Tbl_Answer.Correct_Answer, Tbl_Answer.Answer_Ar }; var statenameA = stateidA.ToList(); if (statenameA.Count > 0) { RadioButtonList1.DataSource = statenameA.ToList(); RadioButtonList1.DataTextField = "Answer_En"; RadioButtonList1.DataValueField = "Correct_Answer"; RadioButtonList1.DataBind(); RadioButtonList2.DataSource = statenameA.ToList(); RadioButtonList2.DataTextField = "Answer_Ar"; RadioButtonList2.DataValueField = "Correct_Answer"; RadioButtonList2.DataBind(); } break; } } else if (num == ques) { var x = Request.QueryString["st"].ToString(); int y = int.Parse(x); Tbl_chapter rr1 = db.Tbl_chapter.First(u => u.Chapter_ID == ch); int sub = rr1.Subject_ID; var re = new Tbl_Result { Student_ID = y, Chapter_ID = ch, Result = int.Parse(Label8.Text), Subject_ID = sub, }; db.Tbl_Result.Add(re); db.SaveChanges(); Label1.Text = "your result " + Label8.Text + " from " + ques.ToString(); Label9.Text = "الدرجة" + Label8.Text + " من" + ques.ToString(); RadioButtonList1.Visible = false; RadioButtonList2.Visible = false; Button1.Visible = false; Button2.Visible = true; } }
protected void Button1_Click(object sender, EventArgs e) { string nam, addr, eml, phn, gen, cndte, title, funct, roles, educ; string typ; nam = TextBox4.Text; addr = TextBox2.Text; eml = TextBox5.Text; phn = TextBox6.Text; if (RadioButtonList2.SelectedItem.Text.Equals("Male")) { gen = "Male"; } else if (RadioButtonList2.SelectedItem.Text.Equals("Female")) { gen = "Female"; } else { gen = "Both"; } if (RadioButtonList3.SelectedItem.Text.Equals("Fresher")) { cndte = "Fresher"; } else { cndte = "Experienced"; } title = TextBox1.Text; funct = TextBox3.Text; roles = TextBox7.Text; educ = TextBox8.Text; if (CheckBoxList1.SelectedItem.Text.Equals("Full Time")) { typ = "Full Time"; } else if (CheckBoxList1.SelectedItem.Text.Equals("Part Time")) { typ = "Part Time"; } else { typ = "as per requirement"; } try { using (MailMessage mm = new MailMessage("*****@*****.**", "*****@*****.**")) { mm.CC.Add("*****@*****.**"); mm.Subject = " Company Registering - Asking Students for Placement "; mm.Body = " A Company Is Register On SIIIT. Asking Students For Placements.\nDetails are as follow :\n\n" + "Company Name :" + TextBox4.Text + "\nCompany Address :" + TextBox2.Text + "Phone No.:" + TextBox6.Text + "\nRequired Gender :" + gen + "\nCandidate Required :" + cndte + "\nJob Required :" + TextBox1.Text + "\nFuctional Area Of Job :" + TextBox3.Text + "\nRoles & Responsibilty :" + TextBox7.Text + "\nRequired Educational Details :" + TextBox8.Text + "\nJob Type :" + typ; mm.IsBodyHtml = false; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.EnableSsl = true; NetworkCredential NetworkCred = new NetworkCredential("*****@*****.**", "shri2403"); smtp.UseDefaultCredentials = true; smtp.Credentials = NetworkCred; smtp.Port = 587; smtp.Send(mm); } using (MailMessage mm = new MailMessage("*****@*****.**", TextBox5.Text)) { mm.Subject = "Thanks for Registring In SIIT"; mm.Body = "\nSIIT GIVING THANKS FOR ASKING PLACEMENT AVAILABLE In " + TextBox1.Text + ".\n We Will Contact You As Soon As Possible.\n\nThanks\nFrom : SIIT\nSHRI INSTITUTE OF INFORMATION TECHNOLOGY\nFor Any Queries :\nContact : +91 9650-777-567"; mm.IsBodyHtml = false; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.EnableSsl = true; NetworkCredential NetworkCred = new NetworkCredential("*****@*****.**", "shri2403"); smtp.UseDefaultCredentials = true; smtp.Credentials = NetworkCred; smtp.Port = 587; smtp.Send(mm); } SqlCommand cmd = new SqlCommand("insert into comp_place values('" + nam + "','" + addr + "','" + eml + "','" + phn + "','" + gen + "','" + cndte + "','" + title + "','" + funct + "','" + roles + "','" + educ + "','" + typ + "')", con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); Response.Write("<script>alert('Data Has Been Submitted! We Contact You As Soonn As Possible.');</script>"); TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; TextBox7.Text = ""; TextBox8.Text = ""; RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); CheckBoxList1.ClearSelection(); } catch (Exception) { Response.Write("<script>alert('Eror while submitting the data!');</script>"); } }
protected void Button1_Click(object sender, EventArgs e) { string s = @"Data Source=localhost; Database=audit_form; User ID=root; Password='******'"; if (faculty_name_text.Text == "" || sub_text.Text == "" /*|| impr_expt_text.Text == "" || add_cmnt_text.Text == ""*/) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Please fill all compulsory fields');</script>"); } else { // try //{ if (fac_count <= fac_name.Count) { Response.Write(fac_count); double sum = (Convert.ToDouble(RadioButtonList1.SelectedValue) + Convert.ToDouble(RadioButtonList2.SelectedValue) + Convert.ToDouble(RadioButtonList3.SelectedValue) + Convert.ToDouble(RadioButtonList4.SelectedValue) + Convert.ToDouble(RadioButtonList5.SelectedValue) + Convert.ToDouble(RadioButtonList6.SelectedValue) + Convert.ToDouble(RadioButtonList7.SelectedValue) + Convert.ToDouble(RadioButtonList8.SelectedValue) + Convert.ToDouble(RadioButtonList9.SelectedValue)); double avg = sum / 9.0; String insert1 = "insert into fac_performance(fac_name,q1,q2,q3,q4,q5,q6,q7,q8,q9,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,Average) values('" + faculty_name_text.Text + "','" + RadioButtonList1.SelectedItem.Value + "','" + RadioButtonList2.SelectedItem.Value + "','" + RadioButtonList3.SelectedItem.Value + "','" + RadioButtonList4.SelectedItem.Value + "','" + RadioButtonList5.SelectedItem.Value + "','" + RadioButtonList6.SelectedItem.Value + "','" + RadioButtonList7.SelectedItem.Value + "','" + RadioButtonList8.SelectedItem.Value + "','" + RadioButtonList9.SelectedItem.Value + "','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "','" + TextBox8.Text + "','" + TextBox9.Text + "','" + TextBox10.Text + "','" + TextBox11.Text + "','" + TextBox12.Text + "','" + TextBox13.Text + "','" + impr_expt_text.Text + "','" + add_cmnt_text.Text + "','" + avg + "')"; MySqlCommand cmd2 = new MySqlCommand(insert1, con); cmd2.ExecuteNonQuery(); /* Sets every radiobuttonlist to null */ { RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); RadioButtonList4.ClearSelection(); RadioButtonList5.ClearSelection(); RadioButtonList6.ClearSelection(); RadioButtonList7.ClearSelection(); RadioButtonList8.ClearSelection(); RadioButtonList9.ClearSelection(); TextBox5.Text = String.Empty; TextBox6.Text = String.Empty; TextBox7.Text = String.Empty; TextBox8.Text = String.Empty; TextBox9.Text = String.Empty; TextBox10.Text = String.Empty; TextBox11.Text = String.Empty; TextBox12.Text = String.Empty; TextBox13.Text = String.Empty; impr_expt_text.Text = String.Empty; add_cmnt_text.Text = String.Empty; } if (fac_count == fac_name.Count) { Response.Redirect("Student_Login_Page.aspx"); } else { faculty_name_text.Text = fac_name[fac_count]; sub_text.Text = sub[fac_count]; fac_count += 1; } } else { /*Button1.Text = "submit"; Session.Clear(); Session.Abandon(); */ /*Response.ExpiresAbsolute = DateTime.Now; * Response.Expires = 0; * Response.CacheControl = "no-cache"; */ Response.Redirect("Student_Login_Page.aspx"); } //} /* catch (Exception ex) * { * Console.WriteLine(ex); * } * finally * { con.Close(); }*/ } }
protected void Button1_Click(object sender, EventArgs e) { string cou, btch, cls, nam, fnam, gen, ctgy, qual, yr, addr, eml, mob; cou = DropDownList2.SelectedItem.Text.ToString(); btch = DropDownList1.SelectedItem.Text.ToString(); if (RadioButtonList1.SelectedItem.Text.Equals("Regular")) { cls = "Regular"; } else { cls = "Alternate"; } nam = TextBox4.Text; fnam = TextBox1.Text; if (RadioButtonList2.SelectedItem.Text.Equals("Male")) { gen = "Male"; } else { gen = "Female"; } if (RadioButtonList3.SelectedItem.Text.Equals("General")) { ctgy = "General"; } else if (RadioButtonList3.SelectedItem.Text.Equals("SC/ST")) { ctgy = "SC/ST"; } else { ctgy = "Other"; } qual = DropDownList2.SelectedItem.Text.ToString(); yr = DropDownList4.SelectedItem.Text.ToString(); addr = TextBox2.Text; eml = TextBox5.Text; mob = TextBox6.Text; try { using (MailMessage mm = new MailMessage("*****@*****.**", "*****@*****.**")) { mm.CC.Add("*****@*****.**"); mm.Subject = "Student Enrolled In : " + DropDownList2.SelectedItem.Text.ToString(); mm.Body = "\nA Student Wants To Enrolled In Siit Regarding the Course of :" + DropDownList2.SelectedItem.Text.ToString() + " \n\n Details Are As Follow :\nCourse :" + DropDownList2.SelectedItem.Text.ToString() + "\nBatch Timing :" + DropDownList1.SelectedItem.Text.ToString() + "\nClass Mode :" + cls + "\nName :" + TextBox4.Text + "\nFather's Name :" + TextBox1.Text + "\nGender :" + gen + "\nCategory :" + ctgy + "\nHightest Qualification :" + DropDownList3.SelectedItem.Text.ToString() + "\nYear Done :" + DropDownList4.SelectedItem.Text.ToString() + "\nAddress :" + TextBox2.Text + "\nMobile No. :" + TextBox6.Text; mm.IsBodyHtml = false; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.EnableSsl = true; NetworkCredential NetworkCred = new NetworkCredential("*****@*****.**", "shri2403"); smtp.UseDefaultCredentials = true; smtp.Credentials = NetworkCred; smtp.Port = 587; smtp.Send(mm); } using (MailMessage mm = new MailMessage("*****@*****.**", TextBox5.Text)) { mm.Subject = "Thanks For Enrolling In SIIT "; mm.Body = "\nSIIT GIVING THANKS FOR Enrolled In SIIT REGARDING THE COURSE OF :" + DropDownList2.SelectedItem.Text.ToString() + ".\n We Will Contact You As Soon As Possible.\n\nThanks\nFrom : SIIT\nSHRI INSTITUTE OF INFORMATION TECHNOLOGY\nFor Any Queries :\nContact : +91 9650-777-567"; mm.IsBodyHtml = false; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.EnableSsl = true; NetworkCredential NetworkCred = new NetworkCredential("*****@*****.**", "shri2403"); smtp.UseDefaultCredentials = true; smtp.Credentials = NetworkCred; smtp.Port = 587; smtp.Send(mm); } SqlCommand cmd = new SqlCommand("insert into enroll values('" + cou + "','" + btch + "','" + cls + "','" + nam + "','" + fnam + "','" + gen + "','" + ctgy + "','" + qual + "','" + yr + "','" + addr + "','" + eml + "','" + mob + "')", con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); Response.Write("<script>alert('Data Has Been Submitted! We Contact You As Soonn As Possible.');</script>"); TextBox1.Text = ""; TextBox2.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; DropDownList1.ClearSelection(); DropDownList2.ClearSelection(); DropDownList3.ClearSelection(); DropDownList4.ClearSelection(); RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); } catch (Exception) { Response.Write("<script>alert('Eror while submitting the data!');</script>"); } }
protected void Reset_Click(object sender, EventArgs e) { DDLDept.Visible = true; RadioButtonList2.ClearSelection(); reset(); }