public async Task <IActionResult> Create([Bind("Id,Gio")] GioKham gioKham) { if (ModelState.IsValid) { _context.Add(gioKham); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(gioKham)); }
public async Task <IActionResult> Create([Bind("Id,HoVaTen,DienThoaiNha,DienThoaiDiDong,Email,NoiDung,NgayGui,DaXem,FkNguoiXem,NgayXem,TieuDe")] LienHeKhachHang lienHeKhachHang) { if (ModelState.IsValid) { _context.Add(lienHeKhachHang); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["FkNguoiXem"] = new SelectList(_context.User, "UserName", "UserName", lienHeKhachHang.FkNguoiXem); return(View(lienHeKhachHang)); }
public async Task <IActionResult> Create([Bind("Id,TieuDeKhoa,TenKhoaPhong,GioiThieu,NoiDung,NgayCapNhat,UserModify,FkLoaiKhoaPhong,FkNgonNgu,HinhAnhDaiDien,HenKhamBenh,Stt,LuotXem")] KhoaPhong khoaPhong) { if (ModelState.IsValid) { _context.Add(khoaPhong); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["FkLoaiKhoaPhong"] = new SelectList(_context.LoaiKhoaPhong, "Id", "Id", khoaPhong.FkLoaiKhoaPhong); ViewData["FkNgonNgu"] = new SelectList(_context.NgonNgu, "Id", "Id", khoaPhong.FkNgonNgu); return(View(khoaPhong)); }
public async Task <IActionResult> Create([Bind("FkNgonNgu,FkNoiDungTinh,TieuDe,GioiThieu,NoiDung,HinhAnh,NgayChinhSua,FkUserChinhsua,Id,LuotXem")] NoiDungTinhChiTiet noiDungTinhChiTiet) { if (ModelState.IsValid) { _context.Add(noiDungTinhChiTiet); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["FkNgonNgu"] = new SelectList(_context.NgonNgu, "Id", "Id", noiDungTinhChiTiet.FkNgonNgu); ViewData["FkNoiDungTinh"] = new SelectList(_context.NoiDungTinh, "Id", "Id", noiDungTinhChiTiet.FkNoiDungTinh); ViewData["FkUserChinhsua"] = new SelectList(_context.User, "UserName", "UserName", noiDungTinhChiTiet.FkUserChinhsua); return(View(noiDungTinhChiTiet)); }
public async Task <IActionResult> Create([Bind("Id,NgayKham,MaSoBenhNhan,HoVaTen,Email,NgaySinh,GioiTinh,DienThoai,NoiDung,NgayGui,DaXem,FkLoaiPhanHoi,FkNgonNgu,NoiDungTraLoi,NgayTraLoi,FkUserTraLoi,DiaChi,IsShow,TieuDe")] PhanHoi phanHoi) { if (ModelState.IsValid) { var listNgonNgu = await GetListNgonNguAsync(); ViewBag.ListNgonNgu = listNgonNgu; _context.Add(phanHoi); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["FkNgonNgu"] = new SelectList(_context.NgonNgu, "Id", "Id", phanHoi.FkNgonNgu); ViewData["FkUserTraLoi"] = new SelectList(_context.User, "UserName", "UserName", phanHoi.FkUserTraLoi); return(View(phanHoi)); }
public async Task <IActionResult> Create([Bind("Id,TieuDe,NoiDungCauHoi,HoTenNguoiHoi,GioiTinh,FkNamSinh,NoiDungTraLoi,NgayGuiCauHoi,NgayTraLoi,NguoiTraLoi,IsShow,FkChuyenKhoa,FkUserTraLoi,DaTraLoi,Email,DiaChi,SoDienThoai")] HoiDapYkhoa hoiDapYkhoa) { if (ModelState.IsValid) { var listNamSinh = await GetListNamSinhAsync(); ViewBag.ListNamSinh = listNamSinh; var listChuyenKhoa = await GetListChuyenKhoaAsync(); ViewBag.ListChuyenKhoa = listChuyenKhoa; _context.Add(hoiDapYkhoa); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["FkChuyenKhoa"] = new SelectList(_context.LoaiCauHoi, "Id", "Id", hoiDapYkhoa.FkChuyenKhoa); ViewData["FkNamSinh"] = new SelectList(_context.NamSinh, "Id", "Id", hoiDapYkhoa.FkNamSinh); ViewData["FkUserTraLoi"] = new SelectList(_context.User, "UserName", "UserName", hoiDapYkhoa.FkUserTraLoi); return(View(hoiDapYkhoa)); }