Example #1
0
        public edWord_form(Form back)
        {
            _back = back;
            InitializeComponent();
            comboBox1.DataSource  = nikud.Clone();
            comboBox2.DataSource  = nikud.Clone();
            comboBox3.DataSource  = nikud.Clone();
            comboBox4.DataSource  = nikud.Clone();
            comboBox5.DataSource  = nikud.Clone();
            comboBox6.DataSource  = nikud.Clone();
            comboBox7.DataSource  = nikud.Clone();
            comboBox8.DataSource  = nikud.Clone();
            comboBox9.DataSource  = nikud.Clone();
            comboBox10.DataSource = nikud.Clone();
            comboBox11.DataSource = nikud.Clone();
            comboBox12.DataSource = nikud.Clone();
            comboBox13.DataSource = nikud.Clone();
            comboBox14.DataSource = nikud.Clone();
            db_connection k = new db_connection();

            list    = new List <string> [1];
            list[0] = new List <string>();
            list    = k.Word();
            if (list[0].Count > 0)
            {
                comboBox21.DataSource = list[0];
            }
        }
        //INSERT INTO `safali`.`userdetails` (`id`, `idNumber`, `userName`, `userGender`, `userAge`, `userCity`, `userStreet`, `userHouseNumber`, `userCellPhone`) VALUES ('1', '301467726', 'גיל בראון', 'זכר', '25', 'בני עטרות', 'משק 82', '077777', '099999');
        private void userList_SelectedIndexChanged(object sender, EventArgs e)
        {
            int indx = userList.SelectedIndex;

            _id                   = list[2].ElementAt(indx);
            gender.Enabled        = false;
            cellPhone.Enabled     = false;
            homePhone.Enabled     = false;
            street.Enabled        = false;
            city.Enabled          = false;
            nameAndFamily.Enabled = false;
            idNumber.Enabled      = false;
            age.Enabled           = false;
            //MessageBox.Show("id " + _id  + "");
            db_connection m = new db_connection();

            string[] arr = m.getUserData(_id);

            gender.SelectedIndex = gender.FindString(arr[3]);
            // gender.Text = arr[3];
            cellPhone.Text     = arr[8];
            homePhone.Text     = arr[7];
            street.Text        = arr[6];
            city.Text          = arr[5];
            nameAndFamily.Text = arr[2];
            idNumber.Text      = arr[1];
            age.Text           = arr[4];
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            db_connection k = new db_connection();

            bool ans = k.inser_user_details(_id, idNumber.Text, nameAndFamily.Text, gender.Text, age.Text, city.Text, street.Text, homePhone.Text, cellPhone.Text);

            MessageBox.Show(ans + "");
        }
Example #4
0
        public game(int userId)
        {
            _userId = userId;
            InitializeComponent();
            db_connection k = new db_connection();
            int           j = k.getCurrentClass(_userId);

            MessageBox.Show(j + "");
        }
Example #5
0
 public login(string username, string Password)
 {
     try {
         db_connection k   = new db_connection();
         string        stm = "SELECT * from userlist where username='******'and password='******'";
         ans = (int)k.Select(stm, 1);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #6
0
        private void selectWord_Load(object sender, EventArgs e)
        {
            db_connection m = new db_connection();

            list    = new List <string> [1];
            list[0] = new List <string>();
            list    = m.selectWord_withWhere(_where);
            if (list[0].Count > 0)
            {
                checkedListBox1.DataSource = list[0];
            }
        }
Example #7
0
        private void okButton_Click(object sender, EventArgs e)
        {
            string chek = "no";

            if (adminCheckBox.Checked)
            {
                chek = "yes";
            }
            string username = userNameTextbox.Text;
            string Password = passwordTextbox.Text;

            try
            {
                db_connection k = new db_connection();
                bool          m = k.same_user(username);

                if (m)
                {
                    DialogResult dialogResult = MessageBox.Show(" למחוק משתמש?", "מחיקה", MessageBoxButtons.YesNo);
                    if (dialogResult == DialogResult.Yes)
                    {
                        //k = new db_connection();
                        bool ans = k.remove_user(username);
                        MessageBox.Show((ans ? ("הוסר") : ("לא הוסר")));
                    }
                    else
                    {
                        DialogResult dialogResult2 = MessageBox.Show(" לדרוס משתמש?", "לדרוס משתמש", MessageBoxButtons.YesNo);
                        if (dialogResult2 == DialogResult.Yes)
                        {
                            //overwrites user
                            bool ans = k.remove_user(username);
                            k   = new db_connection();
                            ans = k.insert_user(username, Password, chek);
                            MessageBox.Show((ans ? ("נדרס") : ("לא נדרס")));
                        }
                    }
                }
                else
                {
                    //insert the user!

                    bool ans = k.insert_user(username, Password, chek);
                    MessageBox.Show((ans ? ("הוכנס") : ("לא הוכנס")));
                }
            }
            catch { }
        }
        private void addRemoveUserDetail_form_Load(object sender, EventArgs e)
        {
            gender.Items.Add("נקבה");
            gender.Items.Add("זכר");

            db_connection k = new db_connection();

            list    = new List <string> [3];
            list[0] = new List <string>();
            list[1] = new List <string>();
            list[2] = new List <string>();
            list    = k.SelectUser();
            if (list[0].Count > 0)
            {
                userList.DataSource = list[0];
            }
        }
Example #9
0
        private void patitionetSelect_Form_Load(object sender, EventArgs e)
        {
            db_connection k = new db_connection();

            list    = new List <string> [5];
            list[0] = new List <string>();
            list[1] = new List <string>();
            list[2] = new List <string>();
            list[3] = new List <string>();
            list[4] = new List <string>();

            list = k.SelectUser();
            if (list[0].Count > 0)
            {
                userlist.DataSource = list[0];
            }
            int indx = userlist.SelectedIndex;
        }
Example #10
0
        private void removeButton_Click(object sender, EventArgs e)
        {
            string username = userNameTextbox.Text;

            try
            {
                db_connection k = new db_connection();
                bool          m = k.same_user(username);

                if (m)
                {
                    bool ans = k.remove_user(username);
                    if (ans)
                    {
                        MessageBox.Show(ans?"נמחק":"לא נמחק");
                    }
                }
            }
            catch {}
        }
Example #11
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (listBox2.Items.Count <= 0)
     {
         MessageBox.Show("חייב להיות מילים להכניס.");
     }
     else
     {
         //the insertation
         //_userid
         bool j = false;
         foreach (string element in listBox2.Items)
         {
             //class
             //user id
             //word id MessageBox.Show(list[1].ElementAt(list[0].IndexOf(element))+"");
             db_connection m = new db_connection();
             j = m.insert_words_to_class(0, Convert.ToInt32(list[1].ElementAt(list[0].IndexOf(element))), _userId, _classNumber);
         }
         MessageBox.Show(j + "");
     }
 }
Example #12
0
        private void button1_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            //syllable
            int f = 0;

            _where = " where";
            if (NumOfSyl.Text != null && NumOfSyl.Text != "")
            {
                _where = _where + " syllable='" + NumOfSyl.Text + "'";
                f      = 1;
            }
            //openClose
            if (openSyl.Text != null && openSyl.Text != "")
            {
                string b;
                if (f == 1)
                {
                    _where = _where + " AND";
                }
                if (openSyl.Text == "כן")
                {
                    b = "Open";
                }
                else
                {
                    b = "Close";
                }
                _where = _where + " openClose='" + b + "'";
                f      = 1;
            }
            //p_cut
            if (comboBox15.SelectedItem != null && comboBox15.SelectedItem != "")
            {
                if (f == 1)
                {
                    _where = _where + " AND";
                }
                _where = _where + " p_cut='" + comboBox15.SelectedItem + "'";
                f      = 1;
            }
            //agaia
            if (comboBox16.SelectedItem != null && comboBox16.SelectedItem != "")
            {
                if (f == 1)
                {
                    _where = _where + " AND";
                }
                _where = _where + " agaia='" + comboBox16.SelectedItem + "'";
                f      = 1;
            }

            //koliut
            if (comboBox17.SelectedItem != null && comboBox17.SelectedItem != "'")
            {
                if (f == 1)
                {
                    _where = _where + " AND";
                }
                _where = _where + " koliut='" + comboBox17.SelectedItem + "'";
                f      = 1;
            }
            //atama
            if (comboBox18.SelectedItem != null && comboBox18.SelectedItem != "")
            {
                if (f == 1)
                {
                    _where = _where + " AND";
                }
                _where = _where + " atama='" + comboBox18.SelectedItem + "'";
                f      = 1;
            }

            //diber
            if (comboBox19.SelectedItem != null && comboBox19.SelectedItem != "")
            {
                if (f == 1)
                {
                    _where = _where + " AND";
                }
                _where = _where + " diber='" + comboBox19.SelectedItem + "'";
                f      = 1;
            }

            //tzlil_place
            if (comboBox20.SelectedItem != null && comboBox20.SelectedItem != "")
            {
                if (f == 1)
                {
                    _where = _where + " AND";
                }
                _where = _where + " tzlil_place='" + comboBox20.SelectedItem + "'";
            }
            _where = _where + ";";

            //selectWord m = new selectWord(_where);
            //m.Show();
            db_connection m = new db_connection();

            list    = new List <string> [2];
            list[0] = new List <string>();
            list    = m.selectWord_withWhere(_where);
            if (list[0].Count > 0)
            {
                foreach (string element in list[0])
                {
                    listBox1.Items.Add(element);
                }
            }
        }
Example #13
0
        private void okButton_Click(object sender, EventArgs e)
        {
            byte[]       imageBT = null;
            FileStream   fstream = new FileStream(picpath, FileMode.Open, FileAccess.Read);
            BinaryReader br      = new BinaryReader(fstream);

            imageBT = br.ReadBytes((int)fstream.Length);

            try
            {
                milaAlgo m   = new milaAlgo(word);
                string   nos = "" + m.MisparHavarot();
                string   oc  = "";
                if (m._havaraPtuha.Equals("") && !m._havaraSgura.Equals(""))
                {
                    oc = "Open";
                }
                else
                {
                    oc = "Close";
                }
                db_connection k   = new db_connection();
                bool          ans = k.insert_word(word, nos, oc, comboBox15.Text, comboBox16.Text, comboBox17.Text, comboBox18.Text, comboBox19.Text, comboBox20.Text, im);

                if (ans)
                {
                    MessageBox.Show("Insert");
                }
                else
                {
                    MessageBox.Show("Not insert");
                }
            }
            catch { }
            DialogResult dialogResult = MessageBox.Show("להכניס מילה נוספת?", "הוספת מילה", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                NumOfSyl.ResetText();
                ClodeSyl.ResetText();
                openSyl.ResetText();
                pictureBox1.Image = null;
                comboBox1.ResetText(); textBox1.ResetText();
                comboBox2.ResetText(); textBox2.ResetText();
                comboBox3.ResetText(); textBox3.ResetText();
                comboBox4.ResetText(); textBox4.ResetText();
                comboBox5.ResetText(); textBox5.ResetText();
                comboBox6.ResetText(); textBox6.ResetText();
                comboBox7.ResetText(); textBox7.ResetText();
                comboBox8.ResetText(); textBox8.ResetText();
                comboBox9.ResetText(); textBox9.ResetText();
                comboBox10.ResetText(); textBox10.ResetText();
                comboBox11.ResetText(); textBox11.ResetText();
                comboBox12.ResetText(); textBox12.ResetText();
                comboBox13.ResetText(); textBox13.ResetText();
                comboBox14.ResetText(); textBox14.ResetText();
                comboBox15.ResetText();
                comboBox16.ResetText();
                comboBox17.ResetText();
                comboBox18.ResetText();
                comboBox19.ResetText();
                comboBox20.ResetText();
            }
            else if (dialogResult == DialogResult.No)
            {
                _back.Show();
                this.Dispose();
            }
        }
Example #14
0
        private void comboBox21_SelectedIndexChanged(object sender, EventArgs e)
        {
            int indx = comboBox21.SelectedIndex;

            _id = list[0].ElementAt(indx);

            /*  textBox1.Enabled = false; comboBox1.Enabled = false;
             * textBox2.Enabled = false; comboBox2.Enabled = false;
             * textBox3.Enabled = false; comboBox3.Enabled = false;
             * textBox4.Enabled = false; comboBox4.Enabled = false;
             * textBox5.Enabled = false; comboBox5.Enabled = false;
             * textBox6.Enabled = false; comboBox6.Enabled = false;
             * textBox7.Enabled = false; comboBox7.Enabled = false;
             * textBox8.Enabled = false; comboBox8.Enabled = false;
             * textBox9.Enabled = false; comboBox9.Enabled = false;
             * textBox10.Enabled = false; comboBox10.Enabled = false;
             * textBox11.Enabled = false; comboBox11.Enabled = false;
             * textBox12.Enabled = false; comboBox12.Enabled = false;
             * textBox13.Enabled = false; comboBox13.Enabled = false;
             * textBox14.Enabled = false; comboBox14.Enabled = false;
             * comboBox15.Enabled = false; comboBox16.Enabled = false;
             * comboBox17.Enabled = false; comboBox18.Enabled = false;
             * comboBox19.Enabled = false; comboBox20.Enabled = false;
             * pictureBox1.Enabled = false;
             * NumOfSyl.Enabled = false; openSyl.Enabled = false; ClodeSyl.Enabled = false;*/

            //MessageBox.Show("id " + _id  + "");
            db_connection m = new db_connection();

            string[] arr = m.getWordData(_id, pictureBox1);
            textBox1.Text = "" + arr[1];
            string word  = arr[1];
            string w     = "";
            string nikud = "";

            int[] count = new int[14];
            for (int i = 0; i < 14; i++)
            {
                count[i] = -1;
            }
            int Textb = 1;
            int Comb  = 1;

            for (int i = 0; i < word.Length; i++)
            {
                if (word[i] >= 'א' && word[i] <= 'ת')
                {
                    w += word[i];
                    string    mi = "TextBox" + (Textb) + "";
                    Control[] t  = Controls.Find(mi, true);
                    if (t.Length >= 0 && t[0].GetType() == typeof(TextBox))
                    {
                        ((TextBox)(t[0])).Text = word[i] + "";
                        Textb++;
                    }
                    if ((i + 1) < word.Length)
                    {
                        if (word[(i + 1)] >= 'א' && word[(i + 1)] <= 'ת')
                        {
                        }
                        else
                        {
                            string    cb = "ComboBox" + (Textb - 1) + "";
                            Control[] t1 = Controls.Find(cb, true);
                            if (t1.Length >= 0 && t1[0].GetType() == typeof(ComboBox))
                            {
                                //MessageBox.Show(word[i] + "");
                                ((ComboBox)(t1[0])).Text = word[i + 1] + "";
                            }
                        }
                    }
                }
            }


            NumOfSyl.Text   = "" + arr[2]; openSyl.Text = arr[3];
            comboBox15.Text = arr[4]; comboBox16.Text = arr[5];
            comboBox17.Text = arr[6]; comboBox18.Text = arr[7];
            comboBox19.Text = arr[8]; comboBox20.Text = arr[9];
        }