コード例 #1
0
 public List <LichLamViecDTO> GetLichLamViecs()
 {
     return(db.SP_LichLamViec_GetAllOrID(null).Select(q => new LichLamViecDTO
     {
         CreaterDate = q.CreaterDate,
         Creater_Id = q.Creater_Id,
         Date = q.Date,
         IDLich = q.IDLich,
         IDPhongKham = q.IDPhongKham,
         IDTimeSlot = q.IDTimeSlot,
         NhanVien_Id = q.NhanVien_Id,
         Registers = null,
         Status = q.LichLamViec_Status,
         TimeSlot = new TimeSlotDTO
         {
             Name = q.Name,
             HourEnd = q.HourEnd,
             HourStart = q.HourStart,
             Status = q.TimeSlot_Status,
             IDTimeSlot = q.IDTimeSlot ?? 0,
         },
         Doctor = new DoctorDTO
         {
             FullName = q.TenNhanVien,
             IDDoctor = q.NhanVien_Id ?? 0,
             PhongBan = new PhongBanDTO
             {
                 IDChuyenKhoa = q.IDChuyenKhoa,
                 TenPhongBan = q.TenPhongBan,
                 IDPhongBan = q.IDPhongBan,
                 PhongBan_Id = q.IDPhongBan,
                 ChuyenKhoa = new ChuyenKhoaDTO
                 {
                     IDChuyenKhoa = q.IDChuyenKhoa,
                     Name = q.ChuyenKhoa_Name
                 }
             }
         },
     }).ToList());
 }