コード例 #1
0
 private void btn_xem_Click(object sender, EventArgs e)
 {
     if (txt_nhapmagv.Text == "" || txt_nhapnamhoc.Text == "" || txt_nhaphocki.Text == "")
     {
         MessageBox.Show("Mời bạn điền đủ thông tin!");
     }
     else
     {
         try {
             Object_GiangVien  gv  = new Object_GiangVien();
             Object_LopHocPhan lhp = new Object_LopHocPhan();
             gv.MaGV    = txt_nhapmagv.Text;
             lhp.Namhoc = txt_nhapnamhoc.Text;
             lhp.Hocki  = txt_nhaphocki.Text;
             dgr_lichgiangday.DataSource = Bus.GetLichDay(gv, lhp);
             dgr_lichgiangday.AutoResizeColumns();
             dgr_lichgiangday.AutoResizeRows();
             DoiTen();
         }
         catch (Exception ex)
         {
             MessageBox.Show("record empty!");
         }
     }
 }
コード例 #2
0
 //XÓA GV
 public static int XoaGiangVien(Object_GiangVien gv)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@magv", gv.MaGV)
     };
     return(DataProvider.ExecuteNonQuery("xoagiangvien", para));
 }
コード例 #3
0
 // Lịch giảng dạy
 public static DataTable GetLichDay(Object_GiangVien gv, Object_LopHocPhan lhp)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@magv", gv.MaGV),
         new SqlParameter("@namhoc", lhp.Namhoc),
         new SqlParameter("@hocki", lhp.Hocki)
     };
     return(DataProvider.GetDatadk("xemlichgiangday", para));
 }
コード例 #4
0
 //SỬA GV
 public static int SuaGiangVien(Object_GiangVien gv, Object_Khoa kh)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@magv", gv.MaGV),
         new SqlParameter("@tengv", gv.TenGV),
         new SqlParameter("@gioitinhgv", gv.GioiTinhGV),
         new SqlParameter("@sdt", gv.Sdt),
         new SqlParameter("@tenkhoa", kh.TenKhoa)
     };
     return(DataProvider.ExecuteNonQuery("suagv", para));
 }
コード例 #5
0
        //Xóa
        private void btn_xoa1_Click(object sender, EventArgs e)
        {
            Object_GiangVien gv = new Object_GiangVien();

            gv.MaGV = txt_magv.Text;
            if (MessageBox.Show(string.Format("Xóa giảng viên có mã {0}", gv.MaGV), "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
            {
                if (Bus.XoaGiangVien(gv) > 0)
                {
                    MessageBox.Show("Xóa Thành Công!");
                    Admin_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("Xóa Thất Bại!");
                }
            }
        }
コード例 #6
0
        // Lưu
        private void btn_luu1_Click(object sender, EventArgs e)
        {
            Object_Khoa      kh = new Object_Khoa();
            Object_GiangVien gv = new Object_GiangVien();

            gv.MaGV       = txt_magv.Text;
            gv.TenGV      = txt_tengv.Text;
            gv.Sdt        = txt_sdt.Text;
            gv.GioiTinhGV = rbt_nam1.Checked ? "Nam" : "Nu";
            kh.TenKhoa    = txt_khoa.Text;
            if (MessageBox.Show(string.Format("Thêm giảng viên có mã {0}", gv.MaGV), "Xóa", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                if (Bus.ThemGiangVien(gv, kh) > 0)
                {
                    MessageBox.Show("Thêm Thành Công!");
                    Admin_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("Thêm Thất Bại!");
                }
            }
        }
コード例 #7
0
 public static int SuaGiangVien(Object_GiangVien gv, Object_Khoa kh)
 {
     return(Dao.SuaGiangVien(gv, kh));
 }
コード例 #8
0
 //-----------GIẢNG VIÊN----------------
 //
 public static DataTable GetLichDay(Object_GiangVien gv, Object_LopHocPhan lhp)
 {
     return(Dao.GetLichDay(gv, lhp));
 }
コード例 #9
0
 public static int XoaGiangVien(Object_GiangVien gv)
 {
     return(Dao.XoaGiangVien(gv));
 }