Пример #1
0
        public MainWindow()
        {
            InitializeComponent();
            TextBox1.SetBinding(TextBox.TextProperty, new Binding("[0]")
            {
                Source = mode.NamesList, Mode = BindingMode.OneWay
            });
            TextBox2.SetBinding(TextBox.TextProperty, new Binding("[2]")
            {
                Source = mode.NamesList, Mode = BindingMode.OneWay
            });
            TextBox3.SetBinding(TextBox.TextProperty, new Binding("[2].Length")
            {
                Source = mode.NamesList, Mode = BindingMode.OneWay
            });

            TextBox4.SetBinding(TextBox.TextProperty, new Binding("[0]")
            {
                Source = mode.Ctry.Province[0].City[0].Person[0].name, Mode = BindingMode.OneWay
            });
            TextBox5.SetBinding(TextBox.TextProperty, new Binding("[1]")
            {
                Source = mode.Ctry.Province[0].City[0].Person[0].name, Mode = BindingMode.OneWay
            });
            TextBox6.SetBinding(TextBox.TextProperty, new Binding("[2]")
            {
                Source = mode.Ctry.Province[0].City[0].Person[0].name, Mode = BindingMode.OneWay
            });
        }
Пример #2
0
 protected void Button6_Click(object sender, EventArgs e)
 {
     TextBox5.Text = string.Empty;
     TextBox6.Text = string.Empty;
     TextBox5.Focus();
     Button5.Text = "Submit";
 }
Пример #3
0
 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";
 }
Пример #4
0
 // 檢查驗證碼 & 儲存資料
 protected void Button2_Click(object sender, EventArgs e)
 {
     MultiView1.ActiveViewIndex = 1;
     if (TextBox5.Text == "")
     {
         Label11.Text = "請輸入驗證碼";
         return;
     }
     if (TextBox5.Text == Global2.隨機驗證碼.ToString())
     {
         long 會員編號 = getMaxNum("會員編號", "會員");
         會員編號++;
         string sqlcmd = "Insert Into 會員 Values({0}, '{1}', '{2}', '{3}', '{4}', '{5}', N'~/上傳的檔案/smallflower_pblue.png')";
         sqlcmd = string.Format(sqlcmd, 會員編號, Global2.帳號, Global2.密碼, Global2.暱稱, Global2.信箱, Global2.生日.ToString());
         if (TryDoSql(sqlcmd))
         {
             MasterPage.Global.登入   = true;
             MasterPage.Global.暱稱   = Global2.暱稱;
             MasterPage.Global.會員編號 = (int)會員編號;
             Response.Write("<script>alert('註冊成功!將為您導向首頁');location.href='Home.aspx';</script>");
         }
         else
         {
             Label11.Text = "註冊失敗!";
         }
     }
     else
     {
         Label11.Text  = "驗證碼錯誤";
         TextBox5.Text = "";
         TextBox5.Focus();
     }
 }
Пример #5
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     //sql = "Select * From receipt where name = '" + TextBox2.Text + "' and number = '" + TextBox3.Text + "'";
     Label4.Visible   = Label5.Visible = Label6.Visible = Label7.Visible = Label8.Visible = Label9.Visible = true;
     TextBox5.Visible = TextBox6.Visible = TextBox7.Visible = TextBox8.Visible = TextBox9.Visible = true;
     RequiredFieldValidator5.Visible = RequiredFieldValidator6.Visible = RequiredFieldValidator7.Visible = RequiredFieldValidator8.Visible = RequiredFieldValidator9.Visible = true;
     RequiredFieldValidator5.Visible = true;
     Button2.Visible = true;
     Label4.Text     = " Enter new  receipt";
     Label5.Text     = " Name: ";
     TextBox5.Focus();
     RequiredFieldValidator5.ControlToValidate = "TextBox5";
     RequiredFieldValidator5.ErrorMessage      = "* fill Name";
     Label6.Text = " Company: ";
     TextBox6.Focus();
     RequiredFieldValidator6.ControlToValidate = "TextBox6";
     RequiredFieldValidator6.ErrorMessage      = "* fill Company";
     Label7.Text = " Number: ";
     TextBox7.Focus();
     RequiredFieldValidator7.ControlToValidate = "TextBox7";
     RequiredFieldValidator7.ErrorMessage      = "* fill Number";
     Label8.Text = " Arrears: ";
     TextBox8.Focus();
     RequiredFieldValidator8.ControlToValidate = "TextBox8";
     RequiredFieldValidator8.ErrorMessage      = "* fill Arrears";
     Label9.Text = " Suma: ";
     TextBox9.Focus();
     RequiredFieldValidator9.ControlToValidate = "TextBox9";
     RequiredFieldValidator9.ErrorMessage      = "* fill Suma";
     Button2.Text = "Ready ";
 }
        private void BtnExaminar_Click(object sender, EventArgs e)
        {
            try
            {
                MySqlCommand    cm = new MySqlCommand("select*from clientes where dni='" + TextBox5.Text + "'", cn.obtenerConeccion());
                MySqlDataReader dr = cm.ExecuteReader();
                if (dr.Read() == true)
                {
                    TextBox4.Text = dr["nombres"].ToString();
                    Label10.Text  = dr["idclientes"].ToString();
                    // Label9.Text = dr["idclientes"].ToString();

                    TextBox5.Text = dr["DNI"].ToString();
                    // textBox6ext = dr["Stock"].ToString();
                    textBox1.Text = "";
                    textBox1.Focus();
                }
                else
                {
                    MessageBox.Show("Cliente no Encontrado", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    TextBox5.Text = "";
                    TextBox5.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                cn.DescargarConexion();
            }
        }
 private void button4_Click(object sender, EventArgs e)
 {
     try
     {
         MySqlCommand    cm = new MySqlCommand("select*from producto where idproducto='" + textBox1.Text + "'", cn.obtenerConeccion());
         MySqlDataReader dr = cm.ExecuteReader();
         if (dr.Read() == true)
         {
             textBox2.Text = dr["Nombre"].ToString();
             // Label10.Text = dr["idclientes"].ToString();
             textBox6.Text       = dr["stock"].ToString();
             textBox3.Text       = dr["precio_venta"].ToString();
             textBox1.Text       = dr["idproducto"].ToString();
             maskedTextBox1.Text = "1";
             maskedTextBox1.Focus();
         }
         else
         {
             MessageBox.Show("Cliente no Encontrado", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             TextBox5.Text = "";
             TextBox5.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         cn.DescargarConexion();
     }
 }
 private void Button4_Click(object sender, EventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
 }
    protected void ontext(object sender, EventArgs e)
    {
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            System.Web.UI.WebControls.CompareValidator cv = (System.Web.UI.WebControls.CompareValidator)GridView1.Rows[i].FindControl("CompareValidator7");
            cv.ValueToCompare = TextBox4.Text;
        }

        TextBox5.Focus();
    }
Пример #10
0
 private void Button3_Click(object sender, EventArgs e)
 {
     TextBox2.Clear();
     ComboBox1.Text = "";
     TextBox4.Clear();
     TextBox1.Clear();
     TextBox3.Clear();
     TextBox5.Clear();
     textBox6.Clear();
     TextBox2.Focus();
 }
Пример #11
0
 private void TextBox5_Leave(object sender, EventArgs e)
 {
     if (TextBox5.Text == "")
     {
         EP.SetError(TextBox5, "Fill the Blank text first");
         TextBox5.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Пример #12
0
 public void ClearTextBoxes()
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
     TextBox8.Clear();
     TextBoxID.Clear();
 }
        protected void reset_Click(object sender, EventArgs e)
        {
            TextBox1.Text = string.Empty;
            TextBox2.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;

            TextBox5.Focus();
        }
Пример #14
0
 private void metroButton3_Click(object sender, EventArgs e)
 {
     if (listBox1.Items.Count > 2)
     {
         metroButton3.Hide();
         timer1.Start();
         Game();
     }
     else
     {
         TextBox5.AppendText("(系統) : 必須要兩個人以上的玩家 。 \r\n");
     }
 }
 private void Button2_Click(object sender, EventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
     MessageBox.Show("Se ha eliminado el reporte.",
                     "Importante",
                     MessageBoxButtons.OK,
                     MessageBoxIcon.Exclamation,
                     MessageBoxDefaultButton.Button1);
 }
Пример #16
0
 private void Button3_Click(object sender, EventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
     TextBox8.Clear();
     TextBox9.Clear();
     ComboBox1.Items.Clear();
     RadioButton1.Checked = false;
     RadioButton2.Checked = false;
 }
Пример #17
0
 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();
 }
Пример #18
0
    protected void katcd_TextChanged(object sender, EventArgs e)
    {
        DataTable sel_kat = new DataTable();

        sel_kat = DBCon.Ora_Execute_table("select * from KW_Ref_Pembekal where Ref_no_syarikat = '" + TextBox5.Text + "'");
        if (sel_kat.Rows.Count != 0)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Pendaftaran Syarikat Kod Telah Wujud.');", true);
            TextBox5.Text = "";
            TextBox5.Focus();
        }
        else
        {
            TextBox1.Focus();
        }
    }
Пример #19
0
 protected void TextBox2_TextChanged(object sender, EventArgs e)
 {
     cn.Open();
     cmd = new OleDbCommand("select * from Login where[Pass]='" + TextBox2.Text + "'", cn);
     dtr = cmd.ExecuteReader();
     if (dtr.Read())
     {
         Panel1.Visible = true;
         TextBox5.Focus();
     }
     else
     {
         Label1.Text = "Username or Password is incorrect";
     }
     dtr.Close();
     cn.Close();
 }
Пример #20
0
        private void Button1_Click(object sender, EventArgs e)
        {
            Control.CheckForIllegalCrossThreadCalls = false; //忽略跨執行緒操作的錯誤
            User = textBox3.Text;                            //使用者名稱
            string IP   = textBox1.Text;                     //伺服器IP
            int    Port = int.Parse(textBox2.Text);          //伺服器Port

            try
            {
                if (button1.Text.Equals("Sign in"))
                {
                    IPEndPoint EP = new IPEndPoint(IPAddress.Parse(IP), Port); //建立伺服器端點資訊
                    T = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                    T.Connect(EP);                                             //連上Server的EP端點(類似撥號連線)
                    Th = new Thread(Listen)
                    {
                        IsBackground = true //設定為背景執行緒
                    };                      //建立監聽執行緒
                    Th.Start();             //開始監聽
                    TextBox5.AppendText("(系統) : 已連線伺服器! \r\n");
                    Send("L" + User);
                    button1.Text = "Sign out";
                }
                else if (button1.Text.Equals("Sign out"))
                {
                    Send("9" + User);
                    T.Close(); //關閉網路通訊器
                    metroButton3.Show();
                    timer1.Stop();
                    metroProgressBar1.Value = 100;
                    button1.Text            = "Sign in";
                    gm_btu.Enabled          = false;
                    oth_btu.Enabled         = false;
                }
            }
            catch
            {
                metroButton3.Show();
                timer1.Stop();
                metroProgressBar1.Value = 100;
                button1.Text            = "Sign in";
                gm_btu.Enabled          = false;
                oth_btu.Enabled         = false;
                TextBox5.AppendText("(系統) : " + User + " 無法連上伺服器! \r\n");
            }
        }
    protected void LinkButton5_Click(object sender, EventArgs e)
    {
        string        p_Client    = TextBox5.Text.ToString();
        string        CadConexion = WebConfigurationManager.ConnectionStrings["sql_conexion"].ToString();
        SqlConnection Conexion    = new SqlConnection(CadConexion);
        SqlCommand    cmd         = new SqlCommand("INSERT INTO tb_entrepot_jamaica_cliente (client) VALUES (@client)", Conexion);

        cmd.Parameters.Add(new SqlParameter("@client", SqlDbType.VarChar, 50));
        cmd.Parameters["@client"].Value = p_Client;
        Conexion.Open();

        try
        {
            cmd.ExecuteNonQuery();
            Label4.Text = "The client: '" + p_Client + "' added";

            class_rpr.TConexionGridProc("SP_see_client_jamaica", GridView6);
        }

        catch (SqlException ex)
        {
            string number_error = ex.Number.ToString();
            switch (number_error)
            {
            case "2627": Label4.Text = "This client exist already";
                TextBox4.Text        = "";
                TextBox4.Focus();
                break;

            default: Label4.Text = ex.Number.ToString();
                break;
            }
        }
        catch (Exception exT)
        {
            Label4.Text = exT.Message;
        }

        finally
        {
            Conexion.Close();
            TextBox5.Text = "";
            TextBox5.Focus();
        }
    }
        private void TextBox4_PreviewTextInput(object sender, TextCompositionEventArgs e)
        {
            char c = Convert.ToChar(e.Text);

            if (Char.IsControl(c))
            {
                TextBox5.Focus();
                return;
            }
            if (Char.IsSurrogate(c) || Char.IsDigit(c))
            {
                e.Handled = false;
            }
            else
            {
                e.Handled = true;
            }
        }
    protected void Button2_Click(object sender, EventArgs e)
    {
        DataSet ds5 = new DataSet();
        string  l   = "select pass from providers where pid='" + Session["pid"] + "'";

        ds5 = dc.getdata(l);

        if (ds5.Tables[0].Rows[0][0].ToString() == TextBox5.Text)
        {
            Panel1.Visible = false;
            Panel2.Visible = true;
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Incorrect Password');", true);
            // Response.Write("<script>alert('Incorrect Password')</script>");
            TextBox5.Text = "";
            TextBox5.Focus();
        }
    }
Пример #24
0
 private void Button2_Click(object sender, EventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
     TextBox8.Clear();
     TextBox9.Clear();
     TextBox10.Clear();
     ComboBox1.Text       = "Selecione...";
     ComboBox2.Text       = "Selecione...";
     CheckBox1.Checked    = false;
     CheckBox2.Checked    = false;
     CheckBox3.Checked    = false;
     RadioButton1.Checked = false;
     RadioButton2.Checked = false;
     TextBox1.Focus();
 }
Пример #25
0
    protected void TextBox1_TextChanged(object sender, EventArgs e)
    {
        cn.Open();
        cmd = new OleDbCommand("select * from Login where [Uname]='" + TextBox1.Text + "'", cn);
        dtr = cmd.ExecuteReader();
        if (dtr.Read())
        {
            Label2.Visible = true;
            Label2.Text    = (string)dtr["Question"];
            TextBox5.Focus();
        }
        else
        {
            Label1.Visible = true;
            Label1.Text    = "Username Not Found";

            // TextBox1.Text = " ";
        }
        dtr.Close();
        cn.Close();
    }
        void nuevo()
        {
            textBox2.Text       = "";
            maskedTextBox1.Text = "0";
            textBox3.Text       = "";
            textBox6.Text       = "";
            textBox8.Text       = "";

            TextBox4.Text = "";
            Label10.Text  = "";
            textBox6.Text = "";

            // label26.Text = "";
            //DataGridView1.Rows.Clear();
            btnguardar.Enabled = true;
            lbltotal.Text      = "";

            //limpiar listas agregados
            listView1.Items.Clear();
            textBox1.Text = "";
            TextBox5.Text = "";
            TextBox5.Focus();
        }
Пример #27
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (TextBox5.Text == TextBox6.Text)
     {
         SqlConnection con = new SqlConnection("Data Source=IITC-SRV-SQL14; Database=OfcAssignment; Integrated Security=true");
         con.Open();
         SqlCommand cmd = new SqlCommand("INSERT INTO signups(FirstName,LastName,Gender,UserNAme,Password,EmailId) VALUES('" + TextBox1.Text + "','" + TextBox2.Text + "','" + DropDownList1.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox3.Text + "')", con);
         cmd.ExecuteNonQuery();
         con.Close();
         TextBox1.Text = "";
         TextBox2.Text = "";
         TextBox3.Text = "";
         TextBox4.Text = "";
         TextBox5.Text = "";
         TextBox6.Text = "";
         LblMsg2.Text  = "<script>alert('User created successfully')</script>";
     }
     else
     {
         LblMsg2.Text = "<script>alert('Password did not match')</script>";
         TextBox5.Focus();
     }
 }
        private void btnguardar_Click(object sender, EventArgs e)
        {
            if (TextBox5.Text == "")
            {
                MessageBox.Show("Ingrese el cliente");
                TextBox5.Text = "";
                TextBox5.Focus();
            }
            else
            {
                String          query = "insert into venta values('" + textBox8.Text + "','" + Label9.Text + "','" + "1" + "','" + Label10.Text + "','" + lbltotal.Text + "')";
                MySqlCommand    cm    = new MySqlCommand(query, cn.obtenerConeccion());
                MySqlDataReader dr;


                dr = cm.ExecuteReader();
                guardadetalle();
                MessageBox.Show("Datos Guardados Corectamente", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information);


                nuevo();
            }
        }
Пример #29
0
        void AddNumber()
        {
            engine.RecognizeAsyncCancel();
            ohannah.Speak("Please spell your number");
            TextBox5.Focus();
            //TextBox5.Text = "";

            engine2 = new SpeechRecognitionEngine();
            try
            {
                engine2.SpeechRecognized += engine6_SpeechRecognized;
                Choices  texts    = new Choices();
                string[] commands = File.ReadAllLines(Environment.CurrentDirectory + "\\alphabetsRegistration.txt");
                texts.Add(commands);
                Grammar words = new Grammar(new GrammarBuilder(texts));
                engine2.LoadGrammar(words);
                engine2.SetInputToDefaultAudioDevice();
                engine2.RecognizeAsync(RecognizeMode.Multiple);
            }
            catch (Exception e)
            {
                MessageBox.Show("Can not find the command.\n" + e.Message);
            }
        }
    public void fill_list()
    {
        DropDownList2.Items.Clear();
        DropDownList3.Items.Clear();
        DropDownList2.Items.Add("Select");
        DropDownList3.Items.Add("Select");
        //string s = Request.Cookies["fdet"].Values["city"];
        //Response.Write(s);

        string        cnstr = @"Data Source=.\sqlexpress;AttachDbFilename=E:\projects\FIR\fir_sys\fir.mdf;Integrated Security=True";
        SqlConnection con   = new SqlConnection();
        SqlCommand    cmd   = new SqlCommand();

        con.ConnectionString = cnstr;
        cmd.Connection       = con;
        string query = "select distinct zone from stations where city='" + DropDownList1.SelectedItem.ToString() + "'";

        con.Open();


        cmd.CommandText = query;
        SqlDataReader r = cmd.ExecuteReader();

        while (r.Read())
        {
            ListItem z = new ListItem();

            z.Text = r[0].ToString();

            DropDownList2.Items.Add(z);

            //DropDownList2.Items.Add(r[0].ToString);
        }
        con.Close();
        TextBox5.Focus();
    }