//Ham them bac si moi vao danh sach
        public bool ThemBacSi(BacSi bs)
        {
            string sql = string.Format(" exec sp_ThemBacSi '{0}','{1}', '{2}', '{3}', N'{4}', N'{5}', N'{6}', N'{7}', '{8}', '{9}', '{10}', N'{11}', N'{12}', N'{13}', N'{14}', N'{15}', N'{16}'   "
               , bs.MaBacSi, bs.MaPhongKham, bs.MaPhongBenh, bs.MaKhoa, bs.Ho, bs.Ten, bs.GioiTinh, bs.NgaySinh.ToString("MM/dd/yyyy"),
                bs.CMND, bs.Email, bs.SDT, bs.DiaChi, bs.NgayVaoLam.ToString("MM/dd/yyyy"), bs.ChucVu, bs.TrinhDo, bs.HocHam, bs.HocVi, bs.MaBacSi, bs.MaPhongKham);

            if (conn.ExcuteQuery(sql))
            {
                MessageBox.Show("Thêm Bác sĩ thành công!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return true;
            }
            else
                return false;
        }
        //Ham lay thong tin bac si trong event cua datagridview
        private BacSi LayThongTinBacSi()
        {
            BacSi bs = new BacSi();
            bs.MaBacSi = txtQLNS_MaBacSi.Text;
            bs.MaKhoa = cboQLNS_MaKhoaBS.SelectedValue.ToString();
            bs.MaPhongBenh = cboQLNS_PhongBenhBS.SelectedValue.ToString();
            bs.MaPhongKham = cboQLNS_PhongKhamBS.SelectedValue.ToString();
            bs.Ho = txtQLNS_HoBS.Text;
            bs.Ten = txtQLNS_TenBS.Text;
            bs.NgaySinh = Convert.ToDateTime(dtPickerQLNS_NgaySinh.Value.ToString());
            bs.GioiTinh = cboQLNS_GioiTinhBS.SelectedValue.ToString();
            bs.CMND = Convert.ToInt32(txtQLNS_CMNDBS.Text);
            bs.Email = txtQLNS_EmailBS.Text;
            bs.SDT = Convert.ToInt64(txtQLNS_SDTBS.Text);
            bs.DiaChi = txtQLNS_DiaChiBS.Text;
            bs.NgayVaoLam = Convert.ToDateTime(dtPickerQLNS_NgayVaoLamBS.Value.ToString());
            bs.MaKhoa = cboQLNS_MaKhoaBS.SelectedValue.ToString();
            bs.ChucVu = txtQLNS_ChucVuBS.Text;
            bs.TrinhDo = cboQLNS_TrinhDoBS.Text;
            bs.HocHam = cboQLNS_HocHamBS.Text;
            bs.HocVi = cboQLNS_HocViBS.Text;

            return bs;
        }
        /*      public bool ThemBacSi(BacSi bs)
          {
          string sql = string.Format("Insert into BACSI(STT, MaBacSi, MaKhoa,  Ho, Ten, GioiTinh, NgaySinh, CMND, Email, SDT, DiaChi, NgayVaoLam, ChucVu, TrinhDo,"
              + "HocHam, HocVi) values('{0}','{1}', '{2}', N'{3}', N'{4}', N'{5}', N'{6}', '{7}', '{8}', '{9}', N'{10}', N'{11}', N'{12}', N'{13}', N'{14}', N'{15}')",
              "0",bs.MaBacSi, bs.MaKhoa, bs.Ho, bs.Ten, bs.GioiTinh, bs.NgaySinh.ToString("MM/dd/yyyy"), bs.CMND, bs.Email, bs.SDT, bs.DiaChi, bs.NgayVaoLam.ToString("MM/dd/yyyy"),
           bs.ChucVu, bs.TrinhDo, bs.HocHam, bs.HocVi);

          if (conn.ExcuteQuery(sql))
          {
              MessageBox.Show("Thêm Bác sĩ thành công!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
              return true;
          }
          else
              return false;
          }
          */
        public bool SuaDoiBacSi(BacSi bs)
        {
            string sql = string.Format("Update BACSI set Ho = N'{0}', Ten = N'{1}', NgaySinh = N'{2}', GioiTinh = N'{3}', CMND ='{4}',"
              + "Email = '{5}', SDT = '{6}', DiaChi = N'{7}', NgayVaoLam = N'{8}', MaKhoa = N'{9}', ChucVu = N'{10}', "
              + "TrinhDo = N'{11}', HocHam = N'{12}', HocVi = N'{13}', MaPhongKham = '{14}', MaPhongBenh = '{15}'  where MaBacSi = '{16}'", bs.Ho, bs.Ten, bs.NgaySinh.ToString("MM/dd/yyyy"), bs.GioiTinh, bs.CMND,
              bs.Email, bs.SDT, bs.DiaChi, bs.NgayVaoLam.ToString("MM/dd/yyyy"), bs.MaKhoa, bs.ChucVu, bs.TrinhDo, bs.HocHam, bs.HocVi,bs.MaPhongKham, bs.MaPhongBenh, bs.MaBacSi);

              if(conn.ExcuteQuery(sql))
              {
              MessageBox.Show("Sửa đổi thông tin bác sĩ thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
              return true;
              }
              else
              return false;
        }