예제 #1
0
        void UpdateWorkArea_Poz_List()
        {
            workarealist.Clear();
            workpozlist.Clear();
            Connection_user connect_to_DB = new Connection_user();

            connection = Mysql_Connect(connection);

            MySqlCommand    cmd = new MySqlCommand(connect_to_DB.Return_All_WorkArea_Query(), connection);
            MySqlDataReader dbr = cmd.ExecuteReader();

            while (dbr.Read())
            {
                workarealist.Add(new WorkArea {
                    work_Area = dbr[0].ToString()
                });
            }
            dbr.Close();

            cmd = new MySqlCommand(connect_to_DB.Return_All_WorkPoz_Query(), connection);
            dbr = cmd.ExecuteReader();

            while (dbr.Read())
            {
                workpozlist.Add(new WorkPoz {
                    work_Poz = dbr[0].ToString()
                });
            }
            dbr.Close();
        }
예제 #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            Connection_user connect_to_db = new Connection_user();

            connection = Mysql_Connect(connection);
            MySqlCommand cmd = new MySqlCommand(connect_to_db.Create_login_Table_Query(), connection);

            cmd.ExecuteNonQuery();
        }
예제 #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            Connection_user connect_to_db = new Connection_user();

            connection = Mysql_Connect(connection);
            MySqlCommand cmd = new MySqlCommand(connect_to_db.Delete_ALL_Table_Values("mezun"), connection);

            cmd.ExecuteNonQuery();
            connection.Close();
        }
예제 #4
0
파일: Form2.cs 프로젝트: KylHA/VeriTOdevi
        private void button2_Click(object sender, EventArgs e)
        {
            Connection_user connect_to_db = new Connection_user();

            connection = Mysql_Connect(connection);

            MySqlCommand    cmd = new MySqlCommand(connect_to_db.Return_UserName_Query(U_Name.Text), connection);
            MySqlDataReader dbr;

            dbr = cmd.ExecuteReader();

            int count = 0;

            while (dbr.Read())
            {
                count = count + 1;
            }
            if (count == 1)
            {
                MessageBox.Show("This user name already exists");
                dbr.Close();
            }
            else
            {
                dbr.Close();

                if (U_Name.Text == "" || Pass.Text == "")
                {
                    MessageBox.Show("* This areas cannot be empty");
                }
                else
                {
                    string u_id = "";
                    cmd = new MySqlCommand(connect_to_db.Insert_UserName_and_Password_Query(U_Name.Text, Pass.Text), connection);
                    cmd.ExecuteNonQuery();
                    cmd = new MySqlCommand(connect_to_db.Return_UserID_Query(U_Name.Text), connection);
                    MySqlDataReader new_dbr;
                    new_dbr = cmd.ExecuteReader();
                    while (new_dbr.Read())
                    {
                        u_id = new_dbr[0].ToString();
                    }
                    new_dbr.Close();
                    int id = Int32.Parse(u_id);
                    cmd = new MySqlCommand(connect_to_db.Insert_Mezun_Query(id, NAME.Text, SURNAME.Text, Id_Box.Text, Date_P.Value.ToString(), Email_Box.Text, Okul_box.Text,
                                                                            Dep_Box.Text, Phone_Box.Text, Firma_Box.Text, Pos_Box.Text, Area_Box.Text, Lang_Box.Text, Cert_Box.Text), connection);
                    cmd.ExecuteNonQuery();
                    login_form.Update_user_login_list();
                    connection.Close();
                }
            }
        }
예제 #5
0
파일: Form2.cs 프로젝트: KylHA/VeriTOdevi
        MySqlConnection Mysql_Connect(MySqlConnection connect)
        {
            Connection_user connect_to_db = new Connection_user();

            connect = new MySqlConnection(connect_to_db.Connect_to_DB());
            try
            {
                connect.Open();
            }
            catch (MySqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(connect);
        }
예제 #6
0
파일: Form1.cs 프로젝트: KylHA/VeriTOdevi
        }//debug icin disable edildi tekrar ac...

        public void Update_user_login_list()
        {
            user_list.Clear();
            Connection_user connect_to_DB = new Connection_user();

            connection = Mysql_Connect(connection);
            MySqlCommand    cmd = new MySqlCommand(connect_to_DB.Return_All_login_Query(), connection);
            MySqlDataReader dbr = cmd.ExecuteReader();

            while (dbr.Read())
            {
                user_list.Add(new user_login_list {
                    user_id = dbr[0].ToString(), user_Name = dbr[1].ToString(), user_Password = dbr[2].ToString()
                });
            }
            dbr.Close();
        }
예제 #7
0
        void executeSQLcommend_Insert_University()
        {
            Connection_user connect_to_db = new Connection_user();

            connection = new MySqlConnection(connect_to_db.Connect_to_DB());

            try
            {
                connection.Open();
            }
            catch (MySqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
            MySqlCommand cmd;

            string University_fileName = @"C:\Users\KylHA\Documents\GitHub\VeriTOdevi\VeriTabaniOdevi\Üniversiteler.txt";
            string bolumler_fileName   = @"C:\Users\KylHA\Documents\GitHub\VeriTOdevi\VeriTabaniOdevi\bolumler_edited.txt";

            string[] University_file = File.ReadAllLines(University_fileName);
            string[] Dep_file        = File.ReadAllLines(bolumler_fileName);
            int      k = 0;

            foreach (string item in University_file)
            {
                University_file[k] = item.Split('\t')[0];
                k++;
            }

            for (int i = 0; i < Dep_file.Length; i++)
            {
                if (i < University_file.Length)
                {
                    cmd = new MySqlCommand(connect_to_db.Insert_University_name_and_dep_NN_Query(University_file[i], Dep_file[i]), connection);
                }
                else
                {
                    cmd = new MySqlCommand(connect_to_db.Insert_University_name_and_dep_NN_Query(null, Dep_file[i]), connection);
                }

                cmd.ExecuteNonQuery();
            }
            connection.Close();
        }
예제 #8
0
        void AddWorkArea_Pos_Update()
        {
            Connection_user connect_to_DB = new Connection_user();

            connection = Mysql_Connect(connection);
            MySqlCommand cmd;

            listView1.Clear();
            listView2.Clear();

            if (textBox1.Text != "")
            {
                cmd = new MySqlCommand(connect_to_DB.Insert_Work_Area_Query(textBox1.Text), connection);
                cmd.ExecuteNonQuery();
            }

            if (textBox2.Text != "")
            {
                cmd = new MySqlCommand(connect_to_DB.Insert_Work_Pos_Query(textBox2.Text), connection);
                cmd.ExecuteNonQuery();
            }

            UpdateWorkArea_Poz_List();

            foreach (var item in workarealist)
            {
                listView1.Items.Add(item.work_Area);
            }

            foreach (var item in workpozlist)
            {
                listView2.Items.Add(item.work_Poz);
            }

            textBox1.Text = "";
            textBox2.Text = "";
        }