コード例 #1
0
        // 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());
        }
コード例 #2
0
        public ActionResult themdoan(Doans doans)
        {
            int iddoan = _doanService.Add(doans);

            nguoidiRepo.Add(new NguoiDis()
            {
                DoanId           = iddoan,
                Danhsachnhanvien = "0",
                Danhsachkhach    = "0"
            });
            return(Redirect("Index"));
        }
コード例 #3
0
 public ActionResult Edit(Doans doans)
 {
     try
     {
         _doanService.Update(doans);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
コード例 #4
0
 public bool Update(Doans d)
 {
     _context.Doans.Update(d);
     return(_context.SaveChanges() != 0);
 }
コード例 #5
0
 public int Add(Doans d)
 {
     _context.Add(d);
     _context.SaveChanges();
     return(d.DoanId);
 }
コード例 #6
0
 public bool Update(Doans d)
 {
     throw new NotImplementedException();
 }