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());
 }
        public ActionResult TicketPrice()
        {
            QuanLyClass.InitDataCheck();
            ViewBag.GiaVe_Day     = database.gia_ve.Find("WEEKDAY").don_gia ?? default(int);
            ViewBag.GiaVe_End     = database.gia_ve.Find("WEEKEND").don_gia ?? default(int);
            ViewBag.GiaGhe_Normal = database.loai_ghe.Find("NORMAL").phu_thu ?? default(int);
            ViewBag.GiaGhe_VIP    = database.loai_ghe.Find("VIP").phu_thu ?? default(int);
            ViewBag.DDP_2D        = database.dinh_dang_phim.Find("2d").phu_thu ?? default(int);
            ViewBag.DDP_3D        = database.dinh_dang_phim.Find("3d").phu_thu ?? default(int);

            return(View());
        }
        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()));
        }
        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());
        }
 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)));
     }
 }
 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)));
     }
 }
 public ActionResult Login()
 {
     InitDataCheckAccount();
     QuanLyClass.InitDataCheck();
     return(View());
 }