예제 #1
0
 public ActionResult DetailsVe(string id)
 {
     QuanLyClass.TicketCheck();
     if (!AuthCheck("nhanvien"))
     {
         return(RedirectToAction("Index"));
     }
     return(View(db.ve_ban.Where(s => s.id == id).FirstOrDefault()));
 }
 // GET: QLThongKe
 public ActionResult Index()
 {
     QuanLyClass.TicketCheck();
     if (!AuthCheck("admin"))
     {
         return(RedirectToAction("Index", "QLHome"));
     }
     return(View());
 }
예제 #3
0
        public ActionResult DetailsBatchVe(string id)
        {
            QuanLyClass.TicketCheck();
            if (!AuthCheck("nhanvien"))
            {
                return(RedirectToAction("Index"));
            }
            var ves = from ve in db.ve_dat
                      join vedat in db.ve_dat_chi_tiet on ve.id equals vedat.ve_dat_id
                      join veban in db.ve_ban on vedat.id equals veban.id
                      where ve.id == id && veban.trang_thai == "Book"
                      select veban;

            ViewBag.BatchId = id;
            return(View(ves.ToList()));
        }
예제 #4
0
        public ActionResult TicketList()
        {
            QuanLyClass.TicketCheck();
            List <List <ve_ban> > dsVe = new List <List <ve_ban> >();
            var khach_hang_id          = Convert.ToInt32(Session["Id"]);

            var veDat = database.ve_dat.Where(vd => vd.khach_hang_id == khach_hang_id).ToList();

            foreach (var vd in veDat)
            {
                dsVe.Add(database.ve_ban.Where(vb => vb.ve_dat_chi_tiet.ve_dat_id == vd.id && vb.trang_thai == "Book").ToList());
            }
            ViewBag.DsVe = dsVe;

            return(View());
        }
예제 #5
0
 public ActionResult QLVe(string idVe, string trangthaiVe, int?page)
 {
     QuanLyClass.TicketCheck();
     if (!AuthCheck("nhanvien"))
     {
         return(RedirectToAction("Index"));
     }
     else
     {
         var ves = from ve in db.ve_ban
                   select ve;
         if (!String.IsNullOrEmpty(idVe))
         {
             ves = ves.Where(ve => ve.id.ToString().Contains(idVe));
         }
         if (!String.IsNullOrEmpty(trangthaiVe))
         {
             ves = ves.Where(ve => ve.trang_thai == trangthaiVe);
         }
         ViewBag.TrangThaiList = new SelectList(new List <SelectListItem> {
             new SelectListItem {
                 Selected = false, Text = "Book", Value = "Book"
             },
             new SelectListItem {
                 Selected = false, Text = "Sold", Value = "Sold"
             },
             new SelectListItem {
                 Selected = false, Text = "Cancelled", Value = "Cancelled"
             },
         }, "Value", "Text");
         ViewBag.CurrTT = trangthaiVe;
         ViewBag.CurrId = idVe;
         var listVe  = ves.ToList();
         int pageNum = (page ?? 1);
         return(View(listVe.ToPagedList(pageNum, pageSize)));
     }
 }
예제 #6
0
 public ActionResult QLBatchVe(string idVe, int?page)
 {
     QuanLyClass.TicketCheck();
     if (!AuthCheck("nhanvien"))
     {
         return(RedirectToAction("Index"));
     }
     else
     {
         int pageNum = (page ?? 1);
         var ves     = from ve in db.ve_dat
                       join vedat in db.ve_dat_chi_tiet on ve.id equals vedat.ve_dat_id
                       join veban in db.ve_ban on vedat.id equals veban.id
                       where veban.trang_thai == "Book"
                       select ve;
         if (!String.IsNullOrEmpty(idVe))
         {
             ves = ves.Where(ve => ve.id.ToString().Contains(idVe));
         }
         var listVe = ves.ToList().Distinct();
         ViewBag.CurrId = idVe;
         return(View(listVe.ToPagedList(pageNum, pageSize)));
     }
 }