private void Button1_Click(object sender, RoutedEventArgs e)
        {
            int    counter = 0;
            string word    = null;

            if (string.IsNullOrWhiteSpace(TextBox1.Text))
            {
                TextBlock1.Text = "Molim vas unesite tekst";
                return;
            }



            string[] words = TextBox2.Text.Split(" ".ToCharArray());

            foreach (var sentence in words)
            {
                if (!string.IsNullOrEmpty(sentence) && (TextBox1.Text.Contains(sentence)))
                {
                    counter++;
                    word += " " + sentence;
                }
            }

            TextBox1.Clear();
            TextBox2.Clear();
            TextBox1.Focus();

            TextBlock1.Text = $"The same word's are {word} \n and their number is: {counter} ";
        }
Esempio n. 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection("Data Source=ANDREW-PC\\SQLEXPRESS;Integrated Security=True");

            conn.Open();
            SqlCommand cmd = conn.CreateCommand();

            cmd.CommandText = @"SELECT [fname], [email], [addr]
                             FROM [BookGeeks].[dbo].[users]
                               WHERE [Uname]='" + username.Text + "'AND [password]='" + TextBox2.Text + "'";

            SqlDataReader rdr = cmd.ExecuteReader();

            if (rdr.Read())
            {
                Fname   = rdr[0].ToString();
                email   = rdr[1].ToString();
                address = rdr[2].ToString();
                this.Hide();
                MainMenu m = new MainMenu(Fname, email, address);
                Details  d = new Details(Fname);
                m.Show();
            }

            else
            {
                MessageBox.Show("Incorrect username or password,Please Try again!");
            }
            TextBox2.Clear();
        }
Esempio n. 3
0
        private void Button2_Click(object sender, EventArgs e)
        {
            if (c.cnn.State == ConnectionState.Open)
            {
                c.cnn.Close();
            }
            c.cnn.Open();

            if (TextBox1.Text == "" || TextBox2.Text == "" || TextBox3.Text == "")
            {
                MessageBox.Show("Fill the form properly", "Reset", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                sqlcom             = c.cnn.CreateCommand();
                sqlcom.CommandText = "select * from adlogin where AdmName='" + TextBox1.Text + "' and APassword='******'";
                sqldr = sqlcom.ExecuteReader();
                if (sqldr.Read())
                {
                    if (c.cnn.State == ConnectionState.Open)
                    {
                        c.cnn.Close();
                    }
                    c.cnn.Open();
                    sqlcom             = c.cnn.CreateCommand();
                    sqlcom.CommandText = "update adlogin set APassword='******' where AdmName='" + TextBox1.Text + "'";
                    sqldr = sqlcom.ExecuteReader();

                    TextBox1.Clear();
                    TextBox2.Clear();
                    TextBox3.Clear();
                }
            }
        }
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            if (!File.Exists("Märkmed.xml"))
            {
                MessageBox.Show("Fail puudub");
            }
            else
            {
                string      xmlfilepath = @"D:\programs\Visual Studio 2017\XML Märkmed\MärkmeteHarjutus\MärkmeteHarjutus\bin\Debug\Märkmed.xml";
                XmlDocument doc         = new XmlDocument();
                doc.Load(xmlfilepath);

                XmlNode node1 = doc.SelectSingleNode("/Märkmik/Märge/Pealkiri");
                node1.InnerText = TextBox1.Text;
                XmlNode node2 = doc.SelectSingleNode("/Märkmik/Märge/Sisu");
                node2.InnerText = TextBox2.Text;

                XmlNode node3 = doc.SelectSingleNode("/Märkmik/Märge/Pealkiri");
                TextBox3.Text = node3.InnerText;
                XmlNode node4 = doc.SelectSingleNode("/Märkmik/Märge/Sisu");
                TextBox4.Text = node4.InnerText;

                doc.Save("Märkmed.xml");


                MessageBox.Show("Märge Lisatud");
                //TextBox4.Text = File.ReadAllText("Märkmed.xml");

                TextBox1.Clear();
                TextBox2.Clear();
            }
        }
 private void temizle()
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
 }
Esempio n. 6
0
 private void button9_Click(object sender, EventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     textBox5.Clear();
 }
Esempio n. 7
0
 private void TextBox2_TextChanged(object sender, TextChangedEventArgs e)         //Аналогично на второй TextBox, тоже проверяем и ругаемся!
 {
     if (System.Text.RegularExpressions.Regex.IsMatch(TextBox2.Text, "[^0-9]"))
     {
         MessageBox.Show("В данном поле разрешены только цифры (╯°□°)╯┻━┻");
         TextBox2.Clear();
     }
 }
Esempio n. 8
0
 private void DeliteRecord_Click(object sender, RoutedEventArgs e)
 {
     AllRecords.RemoveAt(ListView1.SelectedIndex);
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     MessageBox.Show("Complite!");
 }
Esempio n. 9
0
 private void ResetRecord()
 {
     DateTimePicker1.Value = DateTime.Now;
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     btnadd.Text = "Add";
     DateTimePicker1.Focus();
 }
Esempio n. 10
0
        private void Button1_Click(object sender, RoutedEventArgs e)
        {
            TextBox2.Clear();
            int n = Convert.ToInt32(TextBox1.Text);

            for (int i = 0; i < n; i = i + 2)
            {
                TextBox2.Text = TextBox2.Text + " " + Convert.ToString(i);
            }
        }
Esempio n. 11
0
        private void button3_Click(object sender, EventArgs e)
        {
            textBox1.Clear();
            TextBox2.Clear();
            txtInterestRate.Clear();
            lblMonthlyPayment.Text = " ";
            label7.Text            = " ";
            richTextBox1.Clear();

            btnReceiptSystem.Enabled = false;
        }
 private void Button3_Click(object sender, EventArgs e)
 {
     TextBox2.Clear();
     ComboBox1.Text = "";
     TextBox4.Clear();
     TextBox1.Clear();
     TextBox3.Clear();
     TextBox5.Clear();
     textBox6.Clear();
     TextBox2.Focus();
 }
Esempio n. 13
0
 public void ClearTextBoxes()
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
     TextBox8.Clear();
     TextBoxID.Clear();
 }
 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);
 }
Esempio n. 15
0
 private void ChangeRecord_Click(object sender, RoutedEventArgs e)
 {
     if (Check())
     {
         AllRecords.RemoveAt(ListView1.SelectedIndex);
         AllRecords.Add(new Record(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text));
         TextBox1.Clear();
         TextBox2.Clear();
         TextBox3.Clear();
         TextBox4.Clear();
         MessageBox.Show("Complite!");
     }
 }
        /*private void Button_Click_3(object sender, RoutedEventArgs e)
         * {
         *  try
         *  {
         *      Text1.Clear();
         *  }
         *  catch
         *  {
         *  }
         * }*/

        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            try
            {
                TextBox1.Clear();
                TextBox2.Clear();
                TextBox3.Clear();
                TextBox4.Clear();
            }
            catch
            {
            }
        }
Esempio n. 17
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;
 }
Esempio n. 18
0
        private void Button1_Click(object sender, RoutedEventArgs e)
        {
            if (!double.TryParse(TextBox1.Text, out double a))
            {
                MessageBox.Show("Enter number");
                TextBox1.Clear();
                TextBox1.Focus();
                return;
            }
            if (!double.TryParse(TextBox2.Text, out double b))
            {
                MessageBox.Show("Enter number");
                TextBox2.Clear();
                TextBox2.Focus();
                return;
            }
            Func <double, double, double> f1 = null;
            string op = "";

            if (RadioSaberi.IsChecked == true)
            {
                f1 = (x, y) => x + y;
                op = "+";
            }
            else if (RadioOduzmi.IsChecked == true)
            {
                f1 = (x, y) => x - y;
                op = "-";
            }
            else if (RadioPomnozi.IsChecked == true)
            {
                f1 = (x, y) => x * y;
                op = "*";
            }
            else if (RadioPodeli.IsChecked == true)
            {
                f1 = (x, y) => x / y;
                op = "/";
            }
            else
            {
                MessageBox.Show("Pick operation");
                return;
            }
            double rezultat = f1(a, b);

            TextBox3.AppendText($"{a} {op} {b} = {rezultat}\n");
        }
Esempio n. 19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(TextBox2.Text))
     {
         return;
     }
     if (WA != null)
     {
         if (WA.ConnectionStatus == ApiBase.CONNECTION_STATUS.LOGGEDIN)
         {
             WA.SendMessage(TextBox1.Text, TextBox2.Text);
             TextBox3.Text += string.Format("\r\n{0} :{1}", USER.Nickname, TextBox2.Text);
             TextBox2.Clear();
             TextBox2.Focus();
         }
     }
 }
Esempio n. 20
0
        private void Button4_Click(object sender, EventArgs e)
        {
            ID = TextBox1.Text;
            string dbpath = "DBMS.mdb";                //宣告資料庫所在的路徑變數
            string Source;                             //宣告連線的字串

            Source = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dbpath;
            OleDbConnection conn;                      //宣告連線的物件

            conn = new OleDbConnection(Source);        //連線
            conn.Open();                               //開啟資料庫
            string       DeleteCmd = "Delete From 學生資料表 WHERE 學號='" + ID + "'";
            OleDbCommand Cmd       = new OleDbCommand(DeleteCmd, conn);

            Cmd.ExecuteNonQuery();
            conn.Close();                             // 關閉資料庫
            MessageBox.Show("刪除成功!");
            TextBox1.Clear();
            TextBox2.Clear();
            Show_Record();
        }
Esempio n. 21
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();
 }
Esempio n. 22
0
        private void button5_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(@"Data Source=(localdb)\v11.0;Initial Catalog=hekim1;Integrated Security=SSPI");

            con.Open();
            SqlCommand cmd = new SqlCommand("UPDATE bilgiler1 SET tedavi=@tedavi,adi=@adi,soyadi=@soyadi,ilet=@ilet,dipnot=@dipnot", con);

            cmd.Parameters.AddWithValue("tedavi", ComboBox1.Text);
            cmd.Parameters.AddWithValue("adi", TextBox1.Text);
            cmd.Parameters.AddWithValue("soyadi", TextBox2.Text);
            cmd.Parameters.AddWithValue("ilet", TextBox3.Text);
            cmd.Parameters.AddWithValue("dipnot", TextBox4.Text);
            cmd.Parameters.AddWithValue("tc", textBox5.Text);
            cmd.ExecuteNonQuery();
            con.Close();
            MessageBox.Show("Kayıt Düzeltilmiştir");
            TextBox1.Clear();
            TextBox2.Clear();
            TextBox3.Clear();
            TextBox4.Clear();
        }
Esempio n. 23
0
 private void Clear(object sender, MouseEventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
 }
Esempio n. 24
0
 private void Button2_Click(object sender, EventArgs e)
 {
     TextBox1.Text = "";
     TextBox2.Clear();
     TextBox1.Focus();
 }
Esempio n. 25
0
        private void Button1_Click(object sender, RoutedEventArgs e)
        {
            Generator generator = new Generator();


            string readnum = TextBox1.Text;           //Записываем количество паролей из формы в переменную

            if (String.IsNullOrEmpty(TextBox1.Text))  //Проверяем пустая строка или нет?
            {
                TextBox1.Clear();
                TextBox1.AppendText("");
                readnum = "-1";
            }

            int pnum = 0;

            try
            {
                pnum = Convert.ToInt32(readnum);      //Конвертируем количество паролей в int
            }
            catch (OverflowException)
            {
                MessageBox.Show("Слишком большое число, ты переполняешь мою память\n(〃∇〃 )");
                TextBox1.Clear();
            }


            string readlen = TextBox2.Text;           //Записываем длину паролей из формы в переменную

            if (String.IsNullOrEmpty(TextBox2.Text))  //Проверяем пустая строка или нет?
            {
                TextBox2.Clear();
                TextBox2.AppendText("");
                readlen = "-1";
            }

            int plength = 0;

            try
            {
                plength = Convert.ToInt32(readlen);   //Конвертируем длину паролей в int
            }
            catch (OverflowException)
            {
                MessageBox.Show("Слишком большое число, ты переполняешь мою память\n(〃∇〃 )");
                TextBox2.Clear();
            }

            //
            // Генерация паролей
            //
            richBoxText1.Clear(); //Очищаем box


            if (Convert.ToBoolean(checkbox1.IsChecked))                           //Проверка checkbox'a
            {
                for (int y = 0; y < pnum; y++)                                    //Цикл работающий по количеству паролей
                {
                    richBoxText1.AppendText(y + 1 + ") ");                        //Добавляем нумерацию
                    string[] pswdsexit      = generator.GenPasswd(pnum, plength); //Вызываем генератор
                    string   pswdsConverted = Convert.ToString(pswdsexit[y]);     //Конвертируем 1 пароль из массива в строчное
                    richBoxText1.AppendText(pswdsConverted);                      //Выводим 1 пароль
                    richBoxText1.Text += Environment.NewLine;                     //Переходим на новую строку
                }
            }
            else
            {
                for (int y = 0; y < pnum; y++)                                    //Цикл работающий по количеству паролей
                {
                    string[] pswdsexit      = generator.GenPasswd(pnum, plength); //Вызываем генератор
                    string   pswdsConverted = Convert.ToString(pswdsexit[y]);     //Конвертируем 1 пароль из массива в строчное
                    richBoxText1.AppendText(pswdsConverted);                      //Выводим 1 пароль
                    richBoxText1.Text += Environment.NewLine;                     //Переходим на новую строку
                }
            }
        }
Esempio n. 26
0
 private void TextBox3_KeyPress(object sender, KeyPressEventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
     Util.CheckEditSymbol(sender, e);
 }
Esempio n. 27
0
 private void Button1_Click(object sender, EventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
 }
 private void TextBox2_MouseDoubleClick(object sender, RoutedEventArgs e)
 {
     TextBox2.Clear();
 }
Esempio n. 29
0
 private void Button2_Click(object sender, RoutedEventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
 }
Esempio n. 30
0
        private void Button1_Click(object sender, EventArgs e)
        {
            if (textBox5.Text.Trim() == "")
            {
                MessageBox.Show("TC KİMLİK NUMARASI BOŞ OLAMAZ");
                textBox5.Focus();
                return;
            }
            if (TextBox1.Text.Trim() == "")
            {
                MessageBox.Show("AD BOŞ OLAMAZ");
                textBox5.Focus();
                return;
            }

            if (true)
            {
            }


            bilgiler uye = new bilgiler();

            uye.ad     = TextBox1.Text;
            uye.soyad  = TextBox2.Text;
            uye.ilet   = TextBox3.Text;
            uye.dipnot = TextBox4.Text;
            uye.tc     = Convert.ToInt32(textBox5.Text);
            uye.tedavi = ComboBox1.Text;
            uye.tarih  = dateTimePicker1.Value.Date;
            uye.saat   = comboBox2.Text;
            uye.kutu   = checkBox1.Checked;
            uye.kutu1  = checkBox2.Checked;
            uye.kutu2  = checkBox3.Checked;
            uye.kutu3  = checkBox4.Checked;
            uye.kutu4  = checkBox5.Checked;
            uye.kutu5  = checkBox6.Checked;
            uye.kutu6  = checkBox7.Checked;
            uye.kutu7  = checkBox8.Checked;
            uye.kutu8  = checkBox9.Checked;
            uye.kutu9  = checkBox10.Checked;
            uye.kutu10 = checkBox11.Checked;
            uye.kutu11 = checkBox12.Checked;
            uye.kutu12 = checkBox13.Checked;
            uye.kutu13 = checkBox14.Checked;
            uye.kutu14 = checkBox15.Checked;
            uye.kutu15 = checkBox16.Checked;
            uye.kutu16 = checkBox17.Checked;
            uye.kutu17 = checkBox18.Checked;
            uye.kutu18 = checkBox19.Checked;
            uye.kutu19 = checkBox20.Checked;
            uye.kutu20 = checkBox21.Checked;
            uye.kutu21 = checkBox22.Checked;
            uye.kutu22 = checkBox23.Checked;
            uye.kutu23 = checkBox24.Checked;
            uye.kutu24 = checkBox25.Checked;
            uye.kutu25 = checkBox26.Checked;
            uye.kutu26 = checkBox27.Checked;
            uye.kutu27 = checkBox28.Checked;
            uye.kutu28 = checkBox29.Checked;
            uye.kutu29 = checkBox30.Checked;
            uye.kutu30 = checkBox31.Checked;
            uye.kutu31 = checkBox32.Checked;



            db.bilgilers.InsertOnSubmit(uye);
            db.SubmitChanges();
            MessageBox.Show("RANDEVU KAYIT EDİLDİ");


            TextBox1.Clear();
            TextBox2.Clear();
            TextBox3.Clear();
            TextBox4.Clear();
            textBox5.Clear();
            comboBox4.Items.Clear();
        }