Exemplo n.º 1
0
        //
        // GET: /Admin/BuyTicket/
        public ActionResult Index(string tkstring, int?k = 1, int page = 1, int pagesize = 10)
        {
            int tk  = 1;
            var dao = new TicketCommon();

            if (k == 1)
            {
                ViewBag.tit = "Danh sách vé thanh toán";
                tk          = 1;
            }
            else if (k == 2)
            {
                ViewBag.tit = "Danh sách vé chưa thanh toán";
                tk          = 2;
            }
            else
            {
                ViewBag.tit = "Danh sách vé chưa GỬI ĐI";
                tk          = 3;
            }
            var model = dao.ListBuyTicket(tkstring, page, pagesize, tk);

            ViewBag.tk = tkstring;
            return(View(model));
        }
Exemplo n.º 2
0
        //
        // GET: /Admin/Ticket/
        public ActionResult Index(string tkstring, int page = 1, int pagesize = 5)
        {
            var model = new TicketCommon().ListTicket(tkstring, page, pagesize);

            ViewBag.tk = tkstring;
            return(View(model));
        }
Exemplo n.º 3
0
        public ActionResult DaGui(int id)
        {
            var  dao = new TicketCommon();
            bool kt  = dao.DaGui(id);

            if (kt)
            {
                ModelState.AddModelError("", "Sửa thành công!");
            }
            else
            {
                ModelState.AddModelError("", "sửa không thành công");
            }
            return(RedirectToAction("Index", "BuyTicket"));
        }
Exemplo n.º 4
0
        public ActionResult Delete(int id)
        {
            TicketCommon dao    = new TicketCommon();
            bool         result = dao.Delete(id);

            if (result)
            {
                ModelState.AddModelError("", "Xóa Thành công!");
            }
            else
            {
                ModelState.AddModelError("", "xóa không thành công");
            }
            return(RedirectToAction("Index", "Ticket"));
        }
Exemplo n.º 5
0
 public ActionResult Create(Ve eve)
 {
     if (ModelState.IsValid)
     {
         TicketCommon ticket = new TicketCommon();
         if (ticket.Add(eve))
         {
             ModelState.AddModelError("", "Thêm Thành công!");
             return(Redirect("/Admin/Ticket/Index"));
         }
         else
         {
             ModelState.AddModelError("", "sửa Thành công!");
             return(View());
         }
     }
     return(View());
 }
Exemplo n.º 6
0
        public ActionResult DaThanhToan(int id)
        {
            var dao = new TicketCommon();
            int kt  = dao.DaThanhToan(id);

            if (kt == 1)
            {
                ModelState.AddModelError("", "Sửa thành công!");
            }
            else
            {
                if (kt == 0)
                {
                    ModelState.AddModelError("", "sửa không thành công");
                }
                else
                {
                    ModelState.AddModelError("", "Vé đã được thanh toán trước đó");
                }
            }
            return(RedirectToAction("Index", "BuyTicket"));
        }
Exemplo n.º 7
0
        public ActionResult Edit(int id)
        {
            Ve model = new TicketCommon().GetVeByID(id);

            return(View(model));
        }