예제 #1
0
        public SV coverStudentViewModelToSV(StudentViewModel model)
        {
            SV      sv      = new SV();
            KhoaBLL khoaBLL = new KhoaBLL();

            sv.TenSV    = model.TenSV;
            sv.GioiTinh = model.GioiTinh;
            sv.HoKhau   = model.HoKhau;
            sv.MSSV     = model.MSSV;
            sv.NgaySinh = model.NgaySinh;
            sv.QueQuan  = model.QueQuan;
            sv.MaKhoa   = model.MaKhoa;
            sv.Khoa     = khoaBLL.findById(model.MaKhoa.GetValueOrDefault());

            return(sv);
        }
예제 #2
0
        public StudentViewModel coverSVToStudentViewModel(SV sv)
        {
            SVDAL            svDAL   = new SVDAL();
            KhoaBLL          khoaBLL = new KhoaBLL();
            StudentViewModel model   = new StudentViewModel();

            if (sv == null)
            {
                return(null);
            }

            model.TenSV    = sv.TenSV;
            model.GioiTinh = sv.GioiTinh;
            model.HoKhau   = sv.HoKhau;
            model.MSSV     = sv.MSSV;
            model.NgaySinh = sv.NgaySinh;
            model.QueQuan  = sv.QueQuan;
            model.DiemTB   = sv.DiemTB;
            model.TenKhoa  = sv.Khoa.Ten;

            return(model);
        }