public async Task <Loai> Create(Loai request) { request.NgayTao = DateTime.Now; _context.Loais.Add(request); await _context.SaveChangesAsync(); return(request); }
public async Task <KHCreateRequest> Create(KHCreateRequest request) { var khachHang = new KhachHang() { MaKH = request.MaKH, TenKH = request.TenKH, DiaChi = request.DiaChi, Email = request.Email, NgaySinh = request.NgaySinh, SDT = request.SDT }; _context.KhachHangs.Add(khachHang); await _context.SaveChangesAsync(); return(request); }
public async Task <NVCreateRequest> Create(NVCreateRequest request) { var nhanVien = new NhanVien() { MaNV = request.MaNV, TenNV = request.TenNV, DiaChi = request.DiaChi, ChucVu = request.ChucVu, Email = request.Email, NgaySinh = request.NgaySinh, SDT = request.SDT }; _context.NhanViens.Add(nhanVien); await _context.SaveChangesAsync(); return(request); }
public async Task <int> Create(YeuCauCreateRequest request) { var yeuCau = new YeuCau() { MaLoai = request.MaLoai, MaTrangThai = request.MaTrangThai, MaMucDo = request.MaMucDo, MaNV = request.MaNV, MaKH = request.MaKH, NgayTiepNhan = DateTime.Now, Noidung = request.Noidung, DiaDiem = request.DiaDiem, MoTa = request.MoTa }; _context.YeuCaus.Add(yeuCau); await _context.SaveChangesAsync(); return(request.MaYeuCau); }