// GET: DoanController/Details/5 public ActionResult Details(int id) { idND = id; string strId = nguoidiRepo.getKH(id); string strIdnv = nguoidiRepo.getNV(id); Doans d = _doanService.Get(id); idTours = d.TourId; ViewBag.doan = d; ViewBag.kh = khachhangRepo.GetAll(strId); ViewBag.nv = nhanVienRepo.GetAllId(strIdnv); ViewBag.nvs = nhanVienRepo.GetAll(); ViewBag.khall = khachhangRepo.GetAlll(); ViewBag.gia = gia.Get(Convert.ToInt32(d.TourId)); ViewBag.slKh = nguoidiRepo.CountKH(strId); ViewBag.slNV = nguoidiRepo.CountNV(strIdnv); try { ViewBag.tongtien = tongTien(); } catch (System.Exception ex) { ViewBag.tongtien = 0; } ViewBag.tour = tour.Get(d.TourId); return(View()); }
public ActionResult themdoan(Doans doans) { int iddoan = _doanService.Add(doans); nguoidiRepo.Add(new NguoiDis() { DoanId = iddoan, Danhsachnhanvien = "0", Danhsachkhach = "0" }); return(Redirect("Index")); }
public ActionResult Edit(Doans doans) { try { _doanService.Update(doans); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public bool Update(Doans d) { _context.Doans.Update(d); return(_context.SaveChanges() != 0); }
public int Add(Doans d) { _context.Add(d); _context.SaveChanges(); return(d.DoanId); }
public bool Update(Doans d) { throw new NotImplementedException(); }