protected void AddBrand_Click(object sender, EventArgs e) { if (Name.Text != null && DropDownList1.SelectedItem.Value != null && DropDownList2.SelectedItem.Value != null && DropDownList3.SelectedItem.Value != null && DropDownList4.SelectedItem.Value != null) { SqlCommand cmd = new SqlCommand("sp_size", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@SizeName", Name.Text); cmd.Parameters.AddWithValue("@BrandId", DropDownList1.SelectedItem.Value); cmd.Parameters.AddWithValue("@catId", DropDownList2.SelectedItem.Value); cmd.Parameters.AddWithValue("@subcat", DropDownList3.SelectedItem.Value); cmd.Parameters.AddWithValue("@gender", DropDownList4.SelectedItem.Value); con.Open(); cmd.ExecuteNonQuery(); Name.Text = string.Empty; DropDownList1.ClearSelection(); DropDownList1.Items.FindByValue("0").Selected = true; DropDownList2.ClearSelection(); DropDownList2.Items.FindByValue("0").Selected = true; DropDownList3.ClearSelection(); DropDownList3.Items.FindByValue("0").Selected = true; DropDownList4.ClearSelection(); DropDownList4.Items.FindByValue("0").Selected = true; BindBrandsRptr(); con.Close(); } else { Txt.Text = "All Detail is not Full Feild"; } }
protected void GridViewUF_SelectedIndexChanged(object sender, EventArgs e) { LabelTitolModal.Text = "Modificar"; //Rellenaras los datos. GridViewRow row = GridViewUF.SelectedRow; String id = row.Cells[2].Text; LabelIdModificar.Text = id; ufs uf = BD.ConsultaUF(Convert.ToInt32(id)); String nom = uf.nom.ToString(); TextBoxNomUF.Text = nom; String cicle = uf.moduls_prof.cursos.id_cicle.ToString(); DropDownList3.ClearSelection(); DropDownList3_CascadingDropDown.SelectedValue = cicle; String id_curs = uf.moduls_prof.id_curs.ToString(); DropDownList4.ClearSelection(); DropDownList4_CascadingDropDown.SelectedValue = id_curs; String id_modul = uf.id_modul_prof.ToString(); DropDownList5.ClearSelection(); DropDownList5_CascadingDropDown.SelectedValue = id_modul; ButtonNou_ModalPopupExtender.Show(); }
protected void btnAddSize_Click(object sender, EventArgs e) { con.ConnectionString = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\aditya\source\repos\practice\practice\App_Data\Database1.mdf;Integrated Security=True"; con.Open(); SqlDataAdapter SQLAdapter = new SqlDataAdapter("insert into size values('" + size.Text + "','" + DropDownList2.SelectedItem.Value + "','" + DropDownList3.SelectedItem.Value + "','" + DropDownList1.SelectedItem.Value + "','" + DropDownList4.SelectedItem.Value + "')", con); DataTable DT = new DataTable(); SQLAdapter.Fill(DT); lblmsg.Text = "Size added successfuly!!"; lblmsg.ForeColor = System.Drawing.Color.Green; BindSizeRepeater(); size.Text = ""; size.Focus(); DropDownList2.ClearSelection(); DropDownList2.Items.FindByValue("0").Selected = true; DropDownList3.ClearSelection(); DropDownList3.Items.FindByValue("0").Selected = true; DropDownList1.ClearSelection(); DropDownList1.Items.FindByValue("0").Selected = true; DropDownList4.ClearSelection(); DropDownList4.Items.FindByValue("0").Selected = true; }
protected void BtnReset_Click(object sender, EventArgs e) { DdlSearchDep.ClearSelection(); DdlSearchPost.ClearSelection(); DropDownList3.ClearSelection(); DropDownList4.ClearSelection(); TxtSearchStaffNO.Text = ""; TxtSearchName.Text = ""; BindGrid_Detail(""); LblStateForGrid_Type.Text = "检索前"; UpdatePanel_SearchEmployee.Update(); }
protected void Button3_Click(object sender, EventArgs e) { try { int check = Convert.ToInt32(TextBox1.Text); if (check == Convert.ToInt32(ViewState["count"])) // insert we selected questions { SqlCommand testCmd = new SqlCommand(); testCmd.CommandText = "INSERT INTO Test(Test_Type,Total_Questions,Total_Marks,Subject_Id) Values('" + Convert.ToString(DropDownList4.SelectedItem) + "'," + GridView1.Rows.Count + "," + check + "," + Convert.ToInt32(Label7.Text) + ")"; testCmd.Connection = cn; testCmd.ExecuteNonQuery(); SqlCommand lastTest = new SqlCommand(); lastTest.CommandText = "SELECT max(Test_Id) FROM TEST"; lastTest.Connection = cn; int t_id = Convert.ToInt32(lastTest.ExecuteScalar()); // Response.Write("Test Id " + t_id); SqlCommand ins_queCmd = new SqlCommand(); for (int row = 0; row < GridView1.Rows.Count; row++) { ins_queCmd.CommandText = "INSERT INTO Test_Question(Test_Id,Question_Id) VALUES (" + t_id + "," + GridView1.Rows[row].Cells[0].Text + ")"; ins_queCmd.Connection = cn; ins_queCmd.ExecuteNonQuery(); //Response.Write(GridView1.Rows[row].Cells[0].Text); } DropDownList1.ClearSelection(); DropDownList2.ClearSelection(); DropDownList3.ClearSelection(); DropDownList4.ClearSelection(); TextBox1.Text = ""; CheckBoxList1.Items.Clear(); CheckBoxList2.Items.Clear(); GridView1.DataSource = null; GridView1.DataBind(); Response.Write(@"<script language='javascript'>alert('Test is successfully generated')</script>"); } else { Response.Write("Select Entered Mark paper"); } } catch (Exception a) { } }
protected void Button2_Click(object sender, EventArgs e) { TextBox1.Text = ""; TextBox2.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; DropDownList1.ClearSelection(); DropDownList2.ClearSelection(); DropDownList3.ClearSelection(); DropDownList4.ClearSelection(); RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); }
protected void Button1_Click(object sender, EventArgs e) { if (Page.IsValid) { try { if (FileUpload1.HasFile) { dp = FileUpload1.PostedFile.FileName; dp = "~/Uploaded/dp/" + dp; FileUpload1.PostedFile.SaveAs(Server.MapPath(dp)); } if (FileUpload2.HasFile) { map = FileUpload2.PostedFile.FileName; map = "~/Uploaded/map/" + map; FileUpload2.PostedFile.SaveAs(Server.MapPath(map)); } string sa = "insert into users(catid,spid,uname,uno,uemail,username,upass,sid,cid,address,udp,umap) values('" + DropDownList1.SelectedValue + "','" + DropDownList2.SelectedValue + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + DropDownList3.SelectedValue + "','" + DropDownList4.SelectedValue + "','" + TextBox7.Text + "','" + dp + "','" + map + "')"; cmd = new SqlCommand(sa, con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); Response.Write("<script>$(document).ready(function () { $('#signup').modal('show');});</script>"); Label14.Text = "You have successfully registered"; } catch (Exception ex) { Response.Write(ex.ToString()); } finally { con.Close(); DropDownList1.ClearSelection(); DropDownList2.ClearSelection(); TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; TextBox7.Text = ""; DropDownList3.ClearSelection(); DropDownList4.ClearSelection(); } } }
protected void Button1_Click(object sender, EventArgs e) { cmd.CommandText = "insert into transport_tb values(" + TextBox1.Text + ",'" + DropDownList3.Text + "','" + DropDownList2.Text + "','" + DropDownList4.Text + "','" + TextBox4.Text + "','" + DropDownList1.Text + "','" + TextBox14.Text + "','" + TextBox12.Text + "','" + TextBox13.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "')"; db.execute(cmd); Response.Write("<script>alert('successfully submitted')</script>"); cmd.CommandText = "select max (ID) from transport_tb"; TextBox1.Text = db.max_id(cmd).ToString(); TextBox4.Text = ""; TextBox14.Text = ""; TextBox12.Text = ""; TextBox6.Text = ""; TextBox7.Text = ""; TextBox13.Text = ""; DropDownList1.ClearSelection(); DropDownList2.ClearSelection(); DropDownList3.ClearSelection(); DropDownList4.ClearSelection(); }
public void ClearAll() { TextBox11.Text = string.Empty; TextBox12.Text = string.Empty; TextBox13.Text = string.Empty; TextBox14.Text = string.Empty; TextBox15.Text = string.Empty; TextBox16.Text = string.Empty; TextBox3.Text = string.Empty; TextBox4.Text = string.Empty; TextBox5.Text = string.Empty; TextBox6.Text = string.Empty; TextBox7.Text = string.Empty; TextBox8.Text = string.Empty; TextBoxFirst.Text = string.Empty; ListBox1.ClearSelection(); DropDownList1.ClearSelection(); DropDownList2.ClearSelection(); DropDownList4.ClearSelection(); DropDownList5.ClearSelection(); }
protected void Button1_Click(object sender, EventArgs e) { string dt1 = DropDownList1 + "/" + DropDownList2 + "/" + DropDownList3; string dt2 = DropDownList4 + "/" + DropDownList5 + "/" + DropDownList6; cmd.CommandText = "insert into Hotel_tb values(" + TextBox1.Text + ",'" + Session["id"] + "','" + DropDownList10.Text + "','" + DropDownList11.Text + "',,'" + dt1 + "','" + dt2 + "','" + DropDownList7.Text + "','" + DropDownList8.Text + "','" + DropDownList9 + "','" + TextBox4.Text + "')"; db.execute(cmd); Response.Write("<script>alert('Submitted')</script>"); cmd.CommandText = "select max (ID) from Hotel_tb"; TextBox1.Text = db.max_id(cmd).ToString(); TextBox4.Text = ""; DropDownList1.ClearSelection(); DropDownList2.ClearSelection(); DropDownList3.ClearSelection(); DropDownList4.ClearSelection(); DropDownList5.ClearSelection(); DropDownList6.ClearSelection(); DropDownList7.ClearSelection(); DropDownList8.ClearSelection(); DropDownList9.ClearSelection(); }
protected void Button2_Click(object sender, EventArgs e) { TextBox1.Text = null; TextBox4.Text = null; TextBox5.Text = null; TextBox6.Text = null; RadioButtonList1.SelectedIndex = -1; RadioButtonList1.Items.FindByValue("a1").Selected = true; RadioButtonList2.SelectedIndex = -1; RadioButtonList2.Items.FindByValue("b1").Selected = true; RadioButtonList3.SelectedIndex = -1; RadioButtonList3.Items.FindByValue("c1").Selected = true; RadioButtonList4.SelectedIndex = -1; RadioButtonList4.Items.FindByValue("d1").Selected = true; RadioButtonList5.SelectedIndex = -1; RadioButtonList5.Items.FindByValue("e1").Selected = true; DropDownList1.ClearSelection(); DropDownList2.ClearSelection(); DropDownList3.ClearSelection(); DropDownList4.ClearSelection(); DropDownList5.ClearSelection(); }
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 Button1_Click1(object sender, EventArgs e) { string Pri = null; int EstimatedMin = 0; if (DropDownList11.Text == "0 minutes") { EstimatedMin = 0; } else if (DropDownList11.Text == "5 minutes") { EstimatedMin = 5; } else if (DropDownList11.Text == "10 minutes") { EstimatedMin = 10; } else if (DropDownList11.Text == "15 minutes") { EstimatedMin = 15; } else if (DropDownList11.Text == "20 minutes") { EstimatedMin = 20; } else if (DropDownList11.Text == "25 minutes") { EstimatedMin = 25; } else if (DropDownList11.Text == "30 minutes") { EstimatedMin = 30; } else if (DropDownList11.Text == "35 minutes") { EstimatedMin = 35; } else if (DropDownList11.Text == "40 minutes") { EstimatedMin = 40; } else if (DropDownList11.Text == "45 minutes") { EstimatedMin = 45; } else if (DropDownList11.Text == "50 minutes") { EstimatedMin = 50; } else if (DropDownList11.Text == "55 minutes") { EstimatedMin = 55; } int EstimatedTime = (int)Char.GetNumericValue(DropDownList10.Text.ElementAt(0)) * 60 + EstimatedMin; if (DropDownList2.Text.Contains("1 - task requires <= 1 hour")) { Pri = "1"; } else if (DropDownList2.Text.Contains("2 - task requires <= 2 hours")) { Pri = "2"; } else if (DropDownList2.Text.Contains("3 - task requires <= 3 hours")) { Pri = "3"; } else if (DropDownList2.Text.Contains("4 - task requires <= 4 hours")) { Pri = "4"; } else if (DropDownList2.Text.Contains("5 - task requires <= 6 hours")) { Pri = "5"; } string Dif = DropDownList3.SelectedValue; string skill1; string skill2; string skill3; if (DropDownList7.SelectedValue == "Assembly") { skill1 = "ASSEMBLY"; } else if (DropDownList7.SelectedValue == "C++") { skill1 = "CPP"; } else if (DropDownList7.SelectedValue == "C#") { skill1 = "CSHARP"; } else if (DropDownList7.SelectedValue == "Java") { skill1 = "JAVA"; } else if (DropDownList7.SelectedValue == "JavaScript") { skill1 = "JAVASCRIPT"; } else if (DropDownList7.SelectedValue == "Python") { skill1 = "PYTHON"; } else if (DropDownList7.SelectedValue == "SQL") { skill1 = "DB"; } else { skill1 = DropDownList7.SelectedValue; } if (DropDownList8.SelectedValue == "Assembly") { skill2 = "ASSEMBLY"; } else if (DropDownList8.SelectedValue == "C++") { skill2 = "CPP"; } else if (DropDownList8.SelectedValue == "C#") { skill2 = "CSHARP"; } else if (DropDownList8.SelectedValue == "Java") { skill2 = "JAVA"; } else if (DropDownList8.SelectedValue == "JavaScript") { skill2 = "JAVASCRIPT"; } else if (DropDownList8.SelectedValue == "Python") { skill2 = "PYTHON"; } else if (DropDownList8.SelectedValue == "SQL") { skill2 = "DB"; } else { skill2 = DropDownList8.SelectedValue; } if (DropDownList9.SelectedValue == "Assembly") { skill3 = "ASSEMBLY"; } else if (DropDownList9.SelectedValue == "C++") { skill3 = "CPP"; } else if (DropDownList9.SelectedValue == "C#") { skill3 = "CSHARP"; } else if (DropDownList9.SelectedValue == "Java") { skill3 = "JAVA"; } else if (DropDownList9.SelectedValue == "JavaScript") { skill3 = "JAVASCRIPT"; } else if (DropDownList9.SelectedValue == "Python") { skill3 = "PYTHON"; } else if (DropDownList9.SelectedValue == "SQL") { skill3 = "DB"; } else { skill3 = DropDownList9.SelectedValue; } string skillr1 = DropDownList4.SelectedValue; string skillr2 = DropDownList5.SelectedValue; string skillr3 = DropDownList6.SelectedValue; if (DropDownList1.SelectedValue == " " || TextBox2.Text == "" || TextBox3.Text == "") { Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Please fill all the textboxes with the right data.');", true); } else if (skill1.Contains("-") && skill2.Contains("-") && skill3.Contains("-")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Please fill all the textboxes with the right data.');", true); } else if ((Pri == "1" && EstimatedTime >= 60) || (Pri == "2" && EstimatedTime >= 120) || (Pri == "3" && EstimatedTime >= 180) || (Pri == "4" && EstimatedTime >= 240) || (Pri == "5" && EstimatedTime >= 360)) { Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Estimated Time must corespond to Priority Level.');", true); } else { string mesage = "4" + DropDownList1.Text + "|" + TextBox2.Text + "|" + TextBox3.Text + "|" + Pri + "|" + Dif + "|" + EstimatedTime; int prim = 0; if (!skill1.Contains("-")) { if (skillr1 == "10") { skillr1 = "9"; } mesage += "|" + skill1 + ":" + skillr1 + ";"; prim++; } if (!skill2.Contains("-")) { if (skillr2 == "10") { skillr2 = "9"; } if (prim != 0) { mesage += skill2 + ":" + skillr2 + ";"; } if (prim == 0) { mesage += "|" + skill2 + ":" + skillr2 + ";"; prim++; } } if (!skill3.Contains("-")) { if (skillr3 == "10") { skillr3 = "9"; } if (prim != 0) { mesage += skill3 + ":" + skillr3 + ";"; } if (prim == 0) { mesage += "|" + skill3 + ":" + skillr3 + ";"; } } send_msg(tc, ns, mesage); string recv_mess = recv_msg(ns); string[] pop = recv_mess.Split(new Char[] { ':', ';' }); if (pop[0][0] == '1') { Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Task sent');", true); DropDownList1.ClearSelection(); TextBox2.Text = ""; TextBox3.Text = ""; DropDownList2.ClearSelection(); DropDownList3.ClearSelection(); DropDownList4.ClearSelection(); DropDownList5.ClearSelection(); DropDownList6.ClearSelection(); DropDownList7.ClearSelection(); DropDownList8.ClearSelection(); DropDownList9.ClearSelection(); DropDownList10.ClearSelection(); DropDownList11.ClearSelection(); //Response.Redirect("SendATask.aspx"); Response.AppendHeader("Refresh", "1"); } else { string aux = pop[0]; aux = aux.Remove(0, 1); pop[0] = aux; string mesaj = ""; for (int i = 0; i < pop.Length; i++) { string s = pop[i]; if (s.Trim() != "") { if (s.Contains("0") || s.Contains("1") || s.Contains("2") || s.Contains("3") || s.Contains("4") || s.Contains("5") || s.Contains("6") || s.Contains("7") || s.Contains("8") || s.Contains("9") || s.Contains("10")) { mesaj += ": " + s + "; "; } else if (s.Contains("ASSEMBLY")) { mesaj += "Assembly"; } else if (s.Contains("CPP")) { mesaj += "C++"; } else if (s.Contains("CSHARP")) { mesaj += "C#"; } else if (s.Contains("JAVA")) { mesaj += "Java"; } else if (s.Contains("JAVASCRIPT")) { mesaj += "JavaScript"; } else if (s.Contains("PYTHON")) { mesaj += "Python"; } else if (s.Contains("DB")) { mesaj += "SQL"; } else { mesaj += s; } } } string popup = "alert(' Closest skills are: " + mesaj + "');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", popup, true); //printez siru } } }