Ejemplo n.º 1
0
        void AddHD()
        {
            HOPDONG hd = HopdongBLL.Get(x => x.Mahd == txtMaHD.Text);

            if (hd == null)
            {
                hd = new HOPDONG()
                {
                    Mahd        = txtMaHD.Text,
                    MaNV        = txtMaNV.Text,
                    Masv        = txtMaSV.Text,
                    Sophong     = txtSoPhong.Text,
                    Ngaybatdau  = dtpStart.Value,
                    Ngayketthuc = dtpTheEnd.Value
                };
                HopdongBLL.Add(hd);
            }
            else
            {
                MessageBox.Show("Mã hợp đồng đã tồn tại");
            }
        }
Ejemplo n.º 2
0
        void EditHD()
        {
            HOPDONG  hd    = db.HOPDONGs.Where(p => p.Mahd == txtMaHD.Text).SingleOrDefault();
            SINHVIEN sv    = db.SINHVIENs.Where(p => p.Masv == hd.Masv).SingleOrDefault();
            PHONG    phong = db.PHONGs.Where(p => p.Sophong == txtSoPhong.Text).SingleOrDefault();

            MessageBox.Show(sv.Gioitinh + "chuyển sang phòng" + phong.LoaiPhong);
            if (sv.Gioitinh == phong.LoaiPhong)
            {
                hd.MaNV        = txtMaNV.Text;
                hd.Masv        = txtMaSV.Text;
                hd.Ngaybatdau  = dtpStart.Value;
                hd.Ngayketthuc = dtpTheEnd.Value;
                hd.Sophong     = txtSoPhong.Text;


                MessageBox.Show("Sửa hợp đồng thành công");
            }
            else
            {
                MessageBox.Show("Kiểm tra lại thông tin vừa thay đổi");
            }
        }
Ejemplo n.º 3
0
        void DeleteHD()
        {
            HOPDONG hd = HopdongBLL.Get(p => p.Mahd == txtMaHD.Text);

            HopdongBLL.Delete(hd);
        }