Пример #1
0
        public CHocvien timHV(string malop, string mahv)
        {
            CLopHoc  a  = tim(malop);
            CHocvien hv = null;

            if (a != null)
            {
                hv = (CHocvien)a.Dmhv[mahv];
            }
            return(hv);
        }
Пример #2
0
        public bool xoa(string ma)
        {
            CHocvien a = tim(ma);

            if (a != null)
            {
                m_dmhv.Remove(ma);
                return(true);
            }
            return(false);
        }
Пример #3
0
 private void btnThemHSVL_Click(object sender, EventArgs e)
 {
     foreach (int i in lvwDSLH.SelectedIndices)
     {
         foreach (int j in lvwDSHV.SelectedIndices)
         {
             CHocvien hv = xlhv.tim(lvwDSHV.Items[j].Text);
             CLopHoc  cr = xllop.tim(lvwDSLH.Items[i].Text);
             cr.Dmhv.Add(hv.SMaHV, hv);
             hienthiHV();
             break;
         }
         break;
     }
 }
Пример #4
0
        public bool sua(CHocvien hv)
        {
            CHocvien a = tim(hv.SMaHV);

            if (a != null)
            {
                a.SHoTen    = hv.SHoTen;
                a.DNgaySinh = hv.DNgaySinh;
                a.BGioiTinh = hv.BGioiTinh;
                a.FDiem1    = hv.FDiem1;
                a.FDiem2    = hv.FDiem2;
                return(true);
            }
            return(false);
        }
Пример #5
0
        public void hienthiHV(string ma)
        {
            CHocvien hv = xl.tim(ma);

            if (hv != null)
            {
                txtMaHV.Text  = hv.SMaHV;
                txtHT.Text    = hv.SHoTen;
                dtpNS.Value   = hv.DNgaySinh;
                chkGT.Checked = hv.BGioiTinh;
                txtD1.Text    = hv.FDiem1.ToString();
                txtD1.Text    = hv.FDiem1.ToString();
                txtKQ.Text    = hv.KetQua().ToString();
            }
        }
Пример #6
0
 public bool them(CHocvien hv)
 {
     try
     {
         CHocvien a = tim(hv.SMaHV);
         if (a == null)
         {
             m_dmhv.Add(hv.SMaHV, hv);
             return(true);
         }
         return(false);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #7
0
 public bool themHV(string malop, CHocvien hv)
 {
     try
     {
         CLopHoc a = tim(malop);
         if (a != null)
         {
             a.Dmhv.Add(hv.SMaHV, hv);
             return(true);
         }
         return(false);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #8
0
 public bool xoaHV(string malop, string mahv)
 {
     try
     {
         CHocvien hv = timHV(malop, mahv);
         if (hv != null)
         {
             CdmHocVien xl = new CdmHocVien();
             xl.xoa(mahv);
             return(true);
         }
         return(false);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #9
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            CHocvien hv = new CHocvien();

            hv.SMaHV     = txtMaHV.Text;
            hv.SHoTen    = txtHT.Text;
            hv.DNgaySinh = dtpNS.Value;
            hv.BGioiTinh = chkGT.Checked;
            hv.FDiem1    = float.Parse(txtD1.Text);
            hv.FDiem2    = float.Parse(txtD2.Text);
            txtKQ.Text   = hv.KetQua();
            if (xl.them(hv))
            {
                hienthi();
            }
            else
            {
                MessageBox.Show("Thêm bị lỗi.", "Error");
            }
        }