protected void Button1_Click(object sender, EventArgs e) { string n = TextBox1.Text; string a = TextBox2.Text; string mn = TextBox3.Text; string ei = TextBox4.Text; string p = TextBox5.Text; string cp = TextBox6.Text; string age = TextBox7.Text; string dob = TextBox8.Text; RegisterClass rc = new RegisterClass(); //string res = rc.saveRegistration(n, a, mn, ei, p, cp, age, dob); string res1 = rc.checkemailid(ei); if (res1 == "false") { string res = rc.saveregistration(n, a, mn, ei, p, cp, a, dob); Label1.Text = res; Response.Redirect("signup1.aspx?email=" + ei); } else { Label1.Text = "User with this email id already exists, please use some other emailid"; TextBox3.Text = ""; TextBox3.Focus(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TextBox3.Focus(); } }
protected void btnExcel2_Click(object sender, EventArgs e) { Label3.Visible = false; try { string reportname = TextBox3.Text; FpSpread1.Columns[4].Visible = false; if (reportname.ToString().Trim() != "") { if (FpSpread1.Visible == true) { da.printexcelreport(FpSpread1, reportname); } Label3.Visible = false; } else { Label3.Text = "Please Enter Your Report Name"; Label3.Visible = true; TextBox3.Focus(); } FpSpread1.Columns[4].Visible = true; } catch { } }
protected void TextBox3_TextChanged(object sender, EventArgs e) { try { ConnectDB cdb = new ConnectDB(); cdb.connectDataBase(); SqlConnection con = cdb.connect; con.Open(); SqlCommand com = cdb.command; com.CommandText = "SELECT user_id from [dbo].[user] where email =@email and role_name=@role_name"; com.Parameters.AddWithValue("@email", TextBox3.Text); com.Parameters.AddWithValue("@role_name", DropDownList1.SelectedItem.Text); SqlDataReader rdr; rdr = com.ExecuteReader(); if (rdr.Read()) { Label8.Visible = true; TextBox3.Text = ""; TextBox3.Focus(); } else { Label8.Visible = false; TextBox4.Focus(); } con.Close(); } catch (Exception exc) { Response.Redirect("Error.aspx"); } }
protected void Button2_Click(object sender, EventArgs e) { if (TextBox1.Text.Trim().Length == 0) { MessageBox.Show("Bạn phải nhập Tác Giả!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); TextBox1.Focus(); return; } if (TextBox2.Text.Trim().Length == 0) { MessageBox.Show("Bạn phải nhập Tên Tác Giả!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); TextBox2.Focus(); return; } if (TextBox3.Text.Trim().Length == 0) { MessageBox.Show("Bạn phải nhập Email!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); TextBox3.Focus(); return; } if (MessageBox.Show("Bạn có muốn Xóa không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { SqlConnection con = new SqlConnection("Data Source=ADMIN\\VIEWSOINC;Initial Catalog=Gioithieutintuc;Integrated Security=True"); SqlCommand cmd = new SqlCommand("delete from TacGia where TacGiaID='" + TextBox1.Text + "'", con); con.Open(); // mo ket noi cmd.ExecuteNonQuery(); // thuc thi con.Close(); Loadbang(); txbhienthi.Text = "Bạn đã xoá thành công!"; } }
protected void Button2_Click(object sender, EventArgs e) { try { string Name = TextBox2.Text.Trim(); string paw = TextBox3.Text.Trim(); SqlDataReader UserDr = UserManager.Login(Name, paw); if (UserDr.Read()) { Session["UserName"] = TextBox2.Text; Session["UserID"] = UserDr["UserID"].ToString(); Response.Redirect("index.aspx"); lblResult.Text = "登陆成功"; } else { lblResult.Text = "啊哦~用户名或者密码错误"; TextBox3.Text = ""; TextBox3.Focus(); } } catch (Exception ex) { Response.Write("错误原因:" + ex); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TextBox3.Focus(); getinvoiceno(); show_category(); BindData(); active(); created(); if (User.Identity.IsAuthenticated) { SqlConnection con1000 = new SqlConnection(ConfigurationManager.AppSettings["connection"]); SqlCommand cmd1000 = new SqlCommand("select * from user_details where company_name='" + User.Identity.Name + "'", con1000); SqlDataReader dr1000; con1000.Open(); dr1000 = cmd1000.ExecuteReader(); if (dr1000.Read()) { company_id = Convert.ToInt32(dr1000["com_id"].ToString()); } con1000.Close(); } } }
protected void Button3_Click(object sender, EventArgs e) { if (TextBox1.Text == "") { Response.Write("<script>alert('Please insert Name.');</script>"); TextBox1.Focus(); } else if (TextBox2.Text == "") { Response.Write("<script>alert('Please insert Contact Number');</script>"); TextBox2.Focus(); } else if (TextBox3.Text == "") { Response.Write("<script>alert('Please insert E-mail');</script>"); TextBox3.Focus(); } else if (TextBox4.Text == "") { Response.Write("<script>alert('Please insert Confirm E-mail');</script>"); TextBox4.Focus(); } else if (TextBox3.Text != TextBox4.Text) { Response.Write("<script>alert('Email is not same with Confirm Email. Please insert again.');</script>"); TextBox4.Focus(); } else { Response.Write("<script>alert('Payment is complete.');</script>"); } }
protected void Button1_Click(object sender, EventArgs e) { if (TextBox5.Text.Equals(TextBox4.Text) == false) { Label1.Text = "⚠ Passwords don't match..."; TextBox4.Text = ""; TextBox5.Text = ""; TextBox4.Focus(); return; } if (checkEmailAvailability() == false) { Label1.Text = "⚠ E-mail already taken..."; TextBox3.Text = ""; TextBox3.Focus(); return; } openConnection(); cmd.CommandText = "INSERT into UserInfo (FirstName,LastName,email,password) values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "')"; if (cmd.ExecuteNonQuery() >= 1) { ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Your account has been created.');window.location ='Login.aspx';", true); //Response.Redirect("Login.aspx"); } else { Label1.Text = "⚠ Cannot Signup"; } con.Close(); }
protected void Page_Load(object sender, EventArgs e) { Page.Title = "Insert"; Page.Form.Method = "post"; Label1.Text = "Add a receipt "; Label2.Text = "Name"; Label3.Text = "Company"; Label4.Text = "Number"; Label5.Text = "Arrears"; Label6.Text = "Suma"; TextBox2.Focus(); TextBox3.Focus(); TextBox4.Focus(); TextBox5.Focus(); TextBox6.Focus(); Button1.Text = "Ready"; Button1.Width = 125; TextBox2.Width = 140; RequiredFieldValidator2.ControlToValidate = "TextBox2"; RequiredFieldValidator2.ErrorMessage = "* fill Name"; RequiredFieldValidator3.ControlToValidate = "TextBox3"; RequiredFieldValidator3.ErrorMessage = "* fill Company "; RequiredFieldValidator4.ControlToValidate = "TextBox4"; RequiredFieldValidator4.ErrorMessage = "* fill Number"; RequiredFieldValidator5.ControlToValidate = "TextBox5"; RequiredFieldValidator5.ErrorMessage = "* fill Arrears"; RequiredFieldValidator6.ControlToValidate = "TextBox6"; RequiredFieldValidator6.ErrorMessage = "* fill Suma"; }
protected void Button1_Click(object sender, EventArgs e) { int result; if (Page.IsPostBack == true) { if (TextBox1.Text == "" || TextBox2.Text == "" || TextBox3.Text == "" || Calendar1.SelectedDate == null || DropDownList1.SelectedValue == "Select") { Label2.Text = "Fields can't be empty !!"; TextBox3.Focus(); } else { SqlConnection con1 = new SqlConnection(); con1.ConnectionString = ConfigurationManager.ConnectionStrings["GAIL"].ConnectionString; con1.Open(); string query = "insert into Queries values('" + TextBox1.Text + "','" + DropDownList1.Text + "','" + TextBox3.Text + "','" + Calendar1.SelectedDate + "','" + TextBox2.Text + "')"; SqlCommand cmd = new SqlCommand(query, con1); result = cmd.ExecuteNonQuery(); if (result > 0) { Label2.Text = "Query Submited we ll try to respond soon :)"; } else { Label2.Text = "Please try Again :("; } con1.Close(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (User.Identity.IsAuthenticated) { SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["connection"]); SqlCommand cmd = new SqlCommand("select * from user_details where Name='" + User.Identity.Name + "'", con); SqlDataReader dr; con.Open(); dr = cmd.ExecuteReader(); if (dr.Read()) { company_id = Convert.ToInt32(dr["com_id"].ToString()); } con.Close(); } TextBox3.Focus(); this.Form.DefaultButton = Button1.UniqueID; getinvoiceno(); show_category(); showrating(); BindData(); active(); created(); } }
protected void Page_Load(object sender, EventArgs e) { sql = "Select * From receipt"; NpgsqlDataAdapter dat = new NpgsqlDataAdapter(sql, WebForm3.conn); DataSet ds = new DataSet(); dat.Fill(ds); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); dat.Dispose(); Label1.Text = " Enter name of user and number of receipt which you whant to edit, please"; Label2.Text = "Name: "; TextBox2.Focus(); RequiredFieldValidator2.ControlToValidate = "TextBox2"; RequiredFieldValidator2.ErrorMessage = "* fill Name"; Label3.Text = "Number: "; TextBox3.Focus(); RequiredFieldValidator3.ControlToValidate = "TextBox3"; RequiredFieldValidator3.ErrorMessage = "* fill Number"; Button1.Text = "Edit"; Button2.Visible = false; Label4.Visible = Label5.Visible = Label6.Visible = Label7.Visible = Label8.Visible = Label9.Visible = false; TextBox5.Visible = TextBox6.Visible = TextBox7.Visible = TextBox8.Visible = TextBox9.Visible = false; RequiredFieldValidator5.Visible = RequiredFieldValidator6.Visible = RequiredFieldValidator7.Visible = RequiredFieldValidator8.Visible = RequiredFieldValidator9.Visible = false; }
private void TextBox2_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { TextBox3.Focus(); } }
protected void TextBox2_TextChanged(object sender, EventArgs e) { try { ConnectDB cdb = new ConnectDB(); cdb.connectDataBase(); SqlConnection con = cdb.connect; con.Open(); SqlCommand com = cdb.command; com.CommandText = "SELECT user_id from [dbo].[user] where user_id =@user_id UNION SELECT user_id from [dbo].[temp_user] where user_id =@user_id"; com.Parameters.AddWithValue("@user_id", TextBox2.Text); SqlDataReader rdr; rdr = com.ExecuteReader(); if (rdr.Read()) { TextBox2.Text = ""; Label7.Visible = true; TextBox2.Focus(); } else { Label7.Visible = false; TextBox3.Focus(); } rdr.Close(); con.Close(); } catch (Exception exc) { Response.Redirect("Error.aspx"); } }
//private void TextBox2_Leave(object sender, EventArgs e) //{ // Check_AlarmStatus(); // TextBox2.SelectAll(); //} //private void TextBox3_Leave(object sender, EventArgs e) //{ // Check_AlarmStatus(); // TextBox3.SelectAll(); //} //private void TextBox4_Leave(object sender, EventArgs e) //{ // Check_AlarmStatus(); // TextBox4.SelectAll(); //} private void Check_AlarmStatus() { try { if (TextBox1.BackColor != Color.LightGray) { if ((TextBox1.Text.Substring(0, 1).ToUpper() != "I") && (TextBox1.Text.Substring(0, 1).ToUpper() != "O")) { MessageBox.Show("Please select the \'Alarm\' Status for Lower set Low !"); TextBox1.ContextMenuStrip = contextMenuStrip2; TextBox1.Focus(); TextBox1.ContextMenuStrip.Show(TextBox1, new Point(0, TextBox1.Height)); //, ToolStripDropDownDirection.BelowRight); return; } } if (TextBox4.BackColor != Color.LightGray) { if ((TextBox4.Text.Substring(0, 1).ToUpper() != "I") && (TextBox4.Text.Substring(0, 1).ToUpper() != "O")) { MessageBox.Show("Please select the \'Alarm\' Status for Lower set Low !"); TextBox4.ContextMenuStrip = contextMenuStrip2; TextBox4.Focus(); TextBox4.ContextMenuStrip.Show(TextBox4, new Point(0, TextBox4.Height)); //, ToolStripDropDownDirection.BelowRight); return; } } // ******************//Check Alarm Status.... A if (TextBox2.BackColor != Color.LightGray) { if (TextBox2.Text.Substring(0, 1).ToUpper() != "A") { MessageBox.Show("Please select the \'Alarm\' Status for Lower set Low !"); TextBox2.ContextMenuStrip = contextMenuStrip2; TextBox2.Focus(); TextBox2.ContextMenuStrip.Show(TextBox2, new Point(0, TextBox2.Height)); //, ToolStripDropDownDirection.BelowRight); return; } } if (TextBox3.BackColor != Color.LightGray) { if (TextBox3.Text.Substring(0, 1).ToUpper() != "A") { MessageBox.Show("Please select the \'Alarm\' Status for Lower set Low !"); TextBox3.ContextMenuStrip = contextMenuStrip2; TextBox3.Focus(); TextBox3.ContextMenuStrip.Show(TextBox3, new Point(0, TextBox2.Height)); //, ToolStripDropDownDirection.BelowRight); return; } } } catch (Exception ex) { MessageBox.Show("Check_AlarmStatus @ Error Code:-7007 " + ex.Message); } }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { TextBox3.Focus(); //將游標指定在密碼位置 System.Windows.Input.InputMethod.SetIsInputMethodEnabled(TextBox3, false); //設置IME和輸入是否可以是中文 System.Windows.Input.InputMethod.SetIsInputMethodEnabled(TextBox4, false); //設置IME和輸入是否可以是中文 System.Windows.Input.InputMethod.SetIsInputMethodEnabled(TextBox6, false); //設置IME和輸入是否可以是中文 //startupUI(); }
protected void Button1_Click(object sender, EventArgs e) { SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings["FinanceDBConnectionString1"].ConnectionString); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "Select Userid from User_Registration_Form"; cmd1.Connection = con1; con1.Open(); cmd1.ExecuteNonQuery(); SqlDataReader dr = cmd1.ExecuteReader(); while (dr.Read()) { if (TextBox1.Text == "") { Response.Write("<script>alert('Please input User ID')</script>"); TextBox1.Focus(); } else if (TextBox3.Text == "") { Response.Write("<script>alert('Please input New password')</script>"); TextBox3.Focus(); } else if (dr["Userid"].ToString() != TextBox1.Text.Trim()) { Response.Write("<script>alert('Please input right Userid')</script>"); } else { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["FinanceDBConnectionString1"].ConnectionString); string sql = "UPDATE User_Registration_Form SET password=@password WHERE Userid=@Userid"; // string sq2 = "UPDATE LoginDetails SET password=@password WHERE LoginID=@Userid"; SqlCommand cmd = new SqlCommand(sql, con); // SqlCommand cmd = new SqlCommand("UPDATE User_Registration_Form SET password=@password WHERE Userid=@Userid)",con); cmd.Parameters.AddWithValue("@Userid", TextBox1.Text); cmd.Parameters.AddWithValue("@password", TextBox3.Text); con.Open(); cmd.ExecuteNonQuery(); con.Close(); Response.Write("<script>alert('password changes successfully..!!!')</script>"); HyperLink1.Visible = true; // TextBox1.Text = ""; // TextBox2.Text = ""; // TextBox3.Text = ""; } } }
protected void Button2_Click(object sender, EventArgs e) { TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; //DropDownList1.SelectedValue = ""; //RadioButtonList1.SelectedValue = ""; TextBox3.Focus(); }
private void TextBox3_MouseDown(object sender, MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Right) { TextBox3.ContextMenuStrip = contextMenuStrip2; TextBox3.Focus(); TextBox3.ContextMenuStrip.Show(TextBox3, new Point(0, TextBox1.Height)); //, ToolStripDropDownDirection.BelowRight); } }
protected void Button1_Click(object sender, EventArgs e) { Application["MSG"] = TextBox1.Text + ":" + TextBox3.Text; TextBox3.Text = ""; TextBox3.Focus(); if (!Timer1.Enabled) { Timer1.Enabled = true; } }
private void Cancel() { GridView1.SelectedIndex = -1; TextBox1.Text = ""; TextBox3.Focus(); TextBox2.Text = ""; TextBox3.Text = ""; LblHidden.ToolTip = ""; Button3.Text = "ثبت"; Label2.Visible = false; }
protected void LinkButton3_Click(object sender, EventArgs e) { string p_Liga = TextBox3.Text.ToString(); string p_havano = "no"; if (CheckBox3.Checked == true) { p_havano = "si"; } string CadConexion = WebConfigurationManager.ConnectionStrings["sql_conexion"].ToString(); SqlConnection Conexion = new SqlConnection(CadConexion); SqlCommand cmd = new SqlCommand("SP_insert_liga", Conexion); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@liga", SqlDbType.VarChar, 50)); cmd.Parameters["@liga"].Value = p_Liga; cmd.Parameters.Add(new SqlParameter("@habano", SqlDbType.VarChar, 2)); cmd.Parameters["@habano"].Value = p_havano; Conexion.Open(); try { cmd.ExecuteNonQuery(); Label3.Text = "La liga: '" + p_Liga + "' fue agregada correctamente."; TextBox3.Text = ""; class_rpr.TConexionGridProc("SP_see_liga", GridView3); } catch (SqlException ex) { string number_error = ex.Number.ToString(); switch (number_error) { case "2627": Label3.Text = "Esta Liga ya existe en la base de datos. No es posible repetirla"; TextBox3.Text = ""; TextBox3.Focus(); break; default: Label3.Text = ex.Number.ToString(); break; } } catch (Exception exT) { Label3.Text = exT.Message; } finally { Conexion.Close(); } }
//deactive linkbtn event protected void LinkButton4_Click(object sender, EventArgs e) { if (TextBox3.Text != "") { updateMemberStatus("Deactive"); } else { Response.Write("<script>alert('no value in member id');</script>"); TextBox3.Focus(); } }
private void TextBox3_Leave(object sender, EventArgs e) { if (TextBox3.Text == "") { EP.SetError(TextBox3, "Fill the Max Torque first"); TextBox3.Focus(); } else { EP.Clear(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!new Admin().CheckSecurity("Admin", decimal.Parse(Request.Cookies["ID_Admin"].Value))) { Response.Redirect("~/Administrator/index.aspx?Type=Accessdenied"); } fillgrid(); } TextBox3.Focus(); }
protected void Page_Load(object sender, EventArgs e) { Label1.Text = "Delete a receipt "; Label2.Text = "Name"; Label3.Text = "Number"; TextBox2.Focus(); TextBox3.Focus(); Button1.Text = "Ready"; Button1.Width = 125; RequiredFieldValidator2.ControlToValidate = "TextBox2"; RequiredFieldValidator2.ErrorMessage = "* fill Name"; RequiredFieldValidator3.ControlToValidate = "TextBox3"; RequiredFieldValidator3.ErrorMessage = "* fill Number "; }
protected void Button2_Click(object sender, EventArgs e) { TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; TextBox1.Focus(); TextBox2.Focus(); TextBox3.Focus(); TextBox4.Focus(); TextBox5.Focus(); TextBox6.Focus(); }
protected void Button2_Click(object sender, EventArgs e) { string CS = ConfigurationManager.ConnectionStrings["SudokuWarzConnectionString1"].ConnectionString; using (SqlConnection conn = new SqlConnection(CS)) { SqlDataAdapter da3 = new SqlDataAdapter("INSERT INTO [Chat] ([name], [text], [datetime]) VALUES ('" + lblusername.Text + "', @chatMessage, '" + DateTime.Now.ToString() + "')", conn); da3.SelectCommand.Parameters.AddWithValue("@chatMessage", TextBox3.Text); DataSet ds3 = new DataSet(); da3.Fill(ds3); } TextBox3.Text = ""; GridView1.DataSourceID = "SqlDataSource1"; TextBox3.Focus(); }
protected void Page_PreRender(object sender, EventArgs e) { if (Wizard1.ActiveStepIndex == 0) { TextBox1.Focus(); } if (Wizard1.ActiveStepIndex == 1) { TextBox2.Focus(); } if (Wizard1.ActiveStepIndex == 2) { TextBox3.Focus(); } }