Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            string    ten     = txtten.Text;
            string    mota    = txtmota.Text;
            string    ma      = txtmadt.Text;
            string    khoa    = cbkhoa.Text;
            string    sql     = "select * from khoa where k_ten ='" + khoa + "'";
            DataTable data    = func.getdata(sql);
            int       id_khoa = 0;

            foreach (DataRow row in data.Rows)
            {
                id_khoa = Convert.ToInt32(row["k_id"]);
            }
            sql = "update daotao set dt_ten = '" + ten + "', dt_mota ='" + mota + "', k_id =" + id_khoa + " where dt_ma = '" + ma + "'";
            func.setdata(sql);

            MessageBox.Show("Chương trình đào tạo đã cập nhật", "Lỗi");
            load();
        }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            string    email    = txtemail.Text;
            string    hoten    = txthoten.Text;
            int       gioitinh = (txtgioitinh.Text == "Nam") ? 1 : 0;
            string    ngaysinh = txtngaysinh.Value.ToString();
            string    sdt      = txtsdt.Text;
            string    diachi   = txtdiachi.Text;
            string    khoa     = txtkhoa.Text;
            string    sql      = "select * from khoa where k_ten ='" + khoa + "'";
            DataTable data     = func.getdata(sql);
            int       id_khoa  = 0;

            foreach (DataRow row in data.Rows)
            {
                id_khoa = Convert.ToInt32(row["k_id"]);
            }
            sql = "update nhanvien set nv_hoten = '" + hoten + "',nv_gioitinh = " + gioitinh + ", nv_diachi ='" + diachi + "', nv_dienthoai = '" + sdt + "', k_id =" + id_khoa + " where nv_tentaikhoan ='" + email + "'";
            func.setdata(sql);
            load();
        }
        private void NDongY_Click(object sender, EventArgs e)
        {
            DialogResult check = MessageBox.Show("Bạn muốn thay đổi?", "Thông báo", MessageBoxButtons.YesNo);

            if (check == DialogResult.Yes)
            {
                int    id        = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["iddk"].Value.ToString());
                string trangthai = cbtrangthai.Text;
                string sql       = "update dangky set dk_trangthai ='" + trangthai + "' where dk_id = '" + id + "'";
                func.setdata(sql);
                MessageBox.Show("Đã xong", "Thông báo");
                load();
            }
        }
Beispiel #4
0
        private void NDongY_Click(object sender, EventArgs e)
        {
            string hoten = this.txthoten.Text;
            //var ngaysinh = this.txtmgaysinh.Value;
            string sdt      = this.txtsdt.Text;
            int    gioitinh = (this.txtgioitinh.Text == "Nam")? 1 :0;
            string diachi   = this.txtdiachi.Text;
            string email    = this.txtemail.Text;
            string sql      = "update nhanvien set nv_hoten = '" + hoten + "' , nv_gioitinh = " + gioitinh + ",";

            sql += " nv_dienthoai = '" + sdt + "', nv_email ='" + email + "', nv_diachi ='" + diachi + "' where nv_id =" + id;
            func.setdata(sql);
            MessageBox.Show("Cập nhật thành công!", "Thành công");
            show_data();
        }