Exemple #1
0
        public void TestCase3()
        {
            DateTime ngaybd = new DateTime();
            DateTime ngaykt = new DateTime(2019, 2, 2);

            HocSinhSinhVienDTO hssv = new HocSinhSinhVienDTO("HS0000102", "123486789010", "Đại học Công Nghệ Thông Tin",
                                                             "Tân Lập, Đông Hòa, Dĩ An, Bình Dương", ngaybd, ngaykt, "");

            Assert.AreEqual(true, hocsinhsinhvienBus.Add(hssv));
        }
Exemple #2
0
        public void TestCase7()
        {
            DateTime ngaybd = new DateTime(2019, 1, 1);
            DateTime ngaykt = new DateTime(2019, 12, 12);
            string   mahssv = null;

            HocSinhSinhVienDTO hssv = new HocSinhSinhVienDTO(mahssv, "123486789013", "Đại học Công Nghệ Thông Tin",
                                                             "Tân Lập, Đông Hòa, Dĩ An, Bình Dương", ngaybd, ngaykt, "");

            Assert.AreEqual(false, hocsinhsinhvienBus.Add(hssv));
        }
Exemple #3
0
        public void TestCase6()
        {
            DateTime ngaybd     = new DateTime(2019, 1, 1);
            DateTime ngaykt     = new DateTime();
            string   madinhdanh = null;

            HocSinhSinhVienDTO hssv = new HocSinhSinhVienDTO("HS0000105", madinhdanh, "Đại học Công Nghệ Thông Tin",
                                                             "Tân Lập, Đông Hòa, Dĩ An, Bình Dương", ngaybd, ngaykt, "");

            Assert.AreEqual(false, hocsinhsinhvienBus.Add(hssv));
        }
Exemple #4
0
        public void TestCase5()
        {
            DateTime ngaybd = new DateTime(2019, 1, 1);
            DateTime ngaykt = new DateTime(2019, 12, 12);
            string   truong = null;

            HocSinhSinhVienDTO hssv = new HocSinhSinhVienDTO("HS0000104", "123486789010", truong,
                                                             "Tân Lập, Đông Hòa, Dĩ An, Bình Dương", ngaybd, ngaykt, "");

            Assert.AreEqual(false, hocsinhsinhvienBus.Add(hssv));
        }
Exemple #5
0
        public void TestCase4()
        {
            DateTime ngaybd = new DateTime(2019, 1, 1);
            DateTime ngaykt = new DateTime(2019, 12, 12);
            string   diachi = null;

            HocSinhSinhVienDTO hssv = new HocSinhSinhVienDTO("HS0000103", "123486789013", "Đại học Công Nghệ Thông Tin",
                                                             diachi, ngaybd, ngaykt, "");

            Assert.AreEqual(false, hocsinhsinhvienBus.Add(hssv));
        }
        private void button_sua_Click(object sender, EventArgs e)
        {
            string   mssv       = textBox_mssv.Text.ToString();
            string   madinhdanh = textBox_madinhdanh.Text.ToString();
            string   truong     = textBox_truong.Text.ToString();
            string   diachi     = textBox_diachithuongtru.Text.ToString();
            DateTime tgbd       = date_batdau.Value.Date;
            DateTime tgkt       = date_ketthuc.Value.Date;
            string   vipham     = textBox_vipham.Text.ToString();

            hssvdto = new HocSinhSinhVienDTO(mssv, madinhdanh, truong, diachi, tgbd, tgkt, vipham);
            if (hssvbus.Update(hssvdto, -1))
            {
                MessageBox.Show("Sửa thành công");
            }
            else
            {
                MessageBox.Show("Sửa không thành công");
            }
            //clearData();
        }