Example #1
0
 private void btn_dong_Click(object sender, EventArgs e)
 {
     if (NotifiationUtils.NotificationClose() == DialogResult.Yes)
     {
         Close();
     }
 }
Example #2
0
        private void btn_Xoa_Click(object sender, EventArgs e)
        {
            String sql  = "DELETE FROM HOCSINH WHERE MaHS =  '" + txt_Mahs.Text + "' ";
            int    temp = connectionDB.NonQueryCommand(sql);

            NotifiationUtils.NotificationCRUD(temp, CRUD.XOA);
            loadDataGridView();
        }
 private void btn_Them_Click(object sender, EventArgs e)
 {
     try
     {
         string sql  = "INSERT INTO BANGDIEM VALUES('" + dgv_DanhSachHocSinh.CurrentRow.Cells["MaHS"].Value.ToString() + "','" + cb_MonHoc.SelectedValue + "'," + txt_DiemMieng.Text + "," + txt_Diem15Phut.Text + "," + txt_Diem1Tiet.Text + "," + txt_DiemHK.Text + ",'" + cb_HocKy.SelectedValue + "')";
         int    temp = connectionDB.NonQueryCommand(sql);
         NotifiationUtils.NotificationCRUD(temp, CRUD.THEM);
         loadBangDiem();
     }
     catch (NullReferenceException) { }
 }
 private void btn_Xoa_Click(object sender, EventArgs e)
 {
     try
     {
         string sql  = "DELETE FROM BANGDIEM WHERE MaHK = '" + cb_HocKy.SelectedValue + "' AND MaHS ='" + dgv_DanhSachHocSinh.CurrentRow.Cells["MaHS"].Value.ToString() + "' AND MaMH='" + cb_MonHoc.SelectedValue + "'";
         int    temp = connectionDB.NonQueryCommand(sql);
         NotifiationUtils.NotificationCRUD(temp, CRUD.XOA);
         loadBangDiem();
     }
     catch (NullReferenceException) { }
 }
 private void btn_Sua_Click(object sender, EventArgs e)
 {
     try
     {
         string sql  = "UPDATE BANGDIEM SET DiemMieng=" + txt_DiemMieng.Text + ",Diem15Phut=" + txt_Diem15Phut.Text + ",Diem1Tiet=" + txt_Diem1Tiet.Text + ",DiemHK=  " + txt_DiemHK.Text + " WHERE MaHK = '" + cb_HocKy.SelectedValue + "' AND MaHS ='" + dgv_DanhSachHocSinh.CurrentRow.Cells["MaHS"].Value.ToString() + "' AND MaMH='" + cb_MonHoc.SelectedValue + "' ";
         int    temp = connectionDB.NonQueryCommand(sql);
         NotifiationUtils.NotificationCRUD(temp, CRUD.SUA);
         loadBangDiem();
     }
     catch (NullReferenceException) { }
 }
        private void btn_Sua_Click(object sender, EventArgs e)
        {
            string sql  = "UPDATE TAIKHOAN SET MaPhanQuyen=" + cb_Quyen.SelectedValue + " WHERE MaGV='" + cb_MaGiaoVien.SelectedValue + "'";
            int    temp = connectionDB.NonQueryCommand(sql);

            if (temp > 0)
            {
                NotifiationUtils.NotificationCRUD(temp, CRUD.SUA);
            }
            loadBang();
        }
        private void btn_Them_Click(object sender, EventArgs e)
        {
            string sql  = "INSERT INTO LOP VALUES ('" + txt_MaLop.Text + "',N'" + txt_TenLop.Text + "','" + cb_MaGiaoVien.SelectedValue + "','" + cb_Khoi.SelectedValue + "','" + cb_NamHoc.SelectedValue + "')";
            int    temp = connectionDB.NonQueryCommand(sql);

            if (temp > 0)
            {
                NotifiationUtils.NotificationCRUD(temp, CRUD.THEM);
            }
            loadBang();
        }
Example #8
0
        private void btn_Them_Click(object sender, EventArgs e)
        {
            string sql  = "INSERT INTO NAMHOC VALUES('" + txt_MaNamHoc.Text + "',N'" + txt_TenNamHoc.Text + "')";
            int    temp = connectionDB.NonQueryCommand(sql);

            if (temp > 0)
            {
                NotifiationUtils.NotificationCRUD(temp, CRUD.THEM);
            }
            loadBang();
        }
Example #9
0
        private void btn_Sua_Click(object sender, EventArgs e)
        {
            string sql  = "UPDATE NAMHOC SET TenNamHoc=N'" + txt_TenNamHoc.Text + "' WHERE MaNamHoc ='" + txt_MaNamHoc.Text + "'";
            int    temp = connectionDB.NonQueryCommand(sql);

            if (temp > 0)
            {
                NotifiationUtils.NotificationCRUD(temp, CRUD.SUA);
            }
            loadBang();
        }
        private void btn_Sua_Click(object sender, EventArgs e)
        {
            string sql  = "UPDATE LOP SET TenLop=N'" + txt_TenLop.Text + "',MaGV='" + cb_MaGiaoVien.SelectedValue + "',MaKhoi='" + cb_Khoi.SelectedValue + "',MaNamHoc='" + cb_NamHoc.SelectedValue + "' WHERE MaLop='" + txt_MaLop.Text + "'";
            int    temp = connectionDB.NonQueryCommand(sql);

            if (temp > 0)
            {
                NotifiationUtils.NotificationCRUD(temp, CRUD.SUA);
            }
            loadBang();
        }
        private void btn_Them_Click(object sender, EventArgs e)
        {
            string sql  = "INSERT INTO TAIKHOAN VALUES ('" + txt_TenDangNhap.Text + "','" + txt_MatKhau.Text + "','" + cb_Quyen.SelectedValue + "','" + cb_MaGiaoVien.SelectedValue + "')";
            int    temp = connectionDB.NonQueryCommand(sql);

            if (temp > 0)
            {
                NotifiationUtils.NotificationCRUD(temp, CRUD.THEM);
            }
            loadBang();
        }
Example #12
0
        private void btn_Sua_Click(object sender, EventArgs e)
        {
            String sql = "UPDATE HOCSINH SET TenHS = N'" + txt_Hoten.Text
                         + "',MaLop = '" + txt_Mahs.Text
                         + "',NgaySinh = CONVERT(datetime,'" + dtp_NgaySinh.Text + "',103)," +
                         "GioiTinh = N'" + gioiTinh
                         + "' ,DiaChi = N'" + txt_DiaChi.Text + "' WHERE MaHS = '" + txt_Mahs.Text + "'";
            int temp = connectionDB.NonQueryCommand(sql);

            NotifiationUtils.NotificationCRUD(temp, CRUD.SUA);
            loadDataGridView();
        }
Example #13
0
        private void btn_Them_Click(object sender, EventArgs e)
        {
            String sql = "INSERT INTO HOCSINH VALUES ('" + txt_Mahs.Text + "',N'"
                         + txt_Hoten.Text + "','"
                         + cb_Lop.SelectedValue + "',CONVERT(datetime,'" + dtp_NgaySinh.Text + "',103),N'"
                         + gioiTinh + "',N'"
                         + txt_DiaChi.Text + "',N'" + txt_HinhAnh.Text + "')";
            int temp = connectionDB.NonQueryCommand(sql);

            NotifiationUtils.NotificationCRUD(temp, CRUD.THEM);
            loadDataGridView();
        }
Example #14
0
        private void btn_Them_Click(object sender, EventArgs e)
        {
            string sql  = "INSERT INTO GIAOVIEN VALUES (N'" + txt_MaGV.Text + "',N'" + txt_HoTen.Text + "',CONVERT(datetime,'" + dtp_NgaySinh.Text + "',103),N'" + gioiTinh + "','" + txt_SoDienThoai.Text + "',N'" + txt_DiaChi.Text + "',N'" + txt_HinhAnh.Text + "')";
            int    temp = connectionDB.NonQueryCommand(sql);

            try
            {
                pb_AnhNhanVien.Image.Save(duongdan + txt_HinhAnh.Text);
            }
            catch (System.Runtime.InteropServices.ExternalException) { }
            NotifiationUtils.NotificationCRUD(temp, CRUD.THEM);
            loadBang();
        }
Example #15
0
        private void btn_Sua_Click(object sender, EventArgs e)
        {
            string sql  = "UPDATE GIAOVIEN SET TenGV=N'" + txt_HoTen.Text + "',NgaySinh=CONVERT(datetime,'" + dtp_NgaySinh.Text + "',103),GioiTinh=N'" + gioiTinh + "',SoDienThoai='" + txt_SoDienThoai.Text + "',DiaChi=N'" + txt_DiaChi.Text + "',HinhAnh=N'" + txt_HinhAnh.Text + "' WHERE MaGV='" + txt_MaGV.Text + "'";
            int    temp = connectionDB.NonQueryCommand(sql);

            try
            {
                pb_HinhAnh.Image.Save(duongdan + txt_HinhAnh.Text);
            }catch (System.Runtime.InteropServices.ExternalException)
            {
            }
            NotifiationUtils.NotificationCRUD(temp, CRUD.SUA);
            loadBang();
        }
Example #16
0
        private void btn_Xoa_Click(object sender, EventArgs e)
        {
            string       sql = "DELETE FROM NAMHOC WHERE MaNamHoc='" + txt_MaNamHoc.Text + "'";
            DialogResult dl  = MessageBox.Show("Bạn thật sự có xóa hay không ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dl == DialogResult.Yes)
            {
                int temp = connectionDB.NonQueryCommand(sql);
                if (temp > 0)
                {
                    NotifiationUtils.NotificationCRUD(temp, CRUD.XOA);
                }
            }
            loadBang();
        }
Example #17
0
        private void btn_Xoa_Click(object sender, EventArgs e)
        {
            string       sql1 = "DELETE FROM TAIKHOAN WHERE MaGV='" + txt_MaGV.Text + "'";
            string       sql2 = "DELETE FROM GIAOVIEN WHERE MaGV='" + txt_MaGV.Text + "'";
            DialogResult dl   = MessageBox.Show("Bạn thật sự có xóa hay không ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dl == DialogResult.Yes)
            {
                int temp1 = connectionDB.NonQueryCommand(sql1);
                int temp2 = connectionDB.NonQueryCommand(sql2);
                if (temp1 > 0)
                {
                    if (temp2 > 0)
                    {
                        File.Delete(duongdan + txt_HinhAnh.Text);
                        NotifiationUtils.NotificationCRUD(temp2, CRUD.XOA);
                    }
                }
            }
            loadBang();
        }
Example #18
0
        private void btn_Sua_Click(object sender, EventArgs e)
        {
            String sql = "UPDATE HOCSINH SET TenHS = N'" + txt_Hoten.Text
                         + "',MaLop = '" + cb_Lop.SelectedValue
                         + "',NgaySinh = CONVERT(datetime,'" + dtp_NgaySinh.Text + "',103)," +
                         "GioiTinh = N'" + gioiTinh
                         + "' ,DiaChi = N'" + txt_DiaChi.Text + "',HinhAnh=N'" + txt_HinhAnh.Text + "' WHERE MaHS = '" + txt_Mahs.Text + "'";
            int temp = connectionDB.NonQueryCommand(sql);

            if (temp > 0)
            {
                NotifiationUtils.NotificationCRUD(temp, CRUD.SUA);
                try
                {
                    pb_HinhAnh.Image.Save(duongdan + txt_HinhAnh.Text);
                }
                catch (System.Runtime.InteropServices.ExternalException)
                {
                }
            }
            loadDataGridView();
        }