Beispiel #1
0
        public async Task <IActionResult> Create([Bind("ID,HoTen,Email,Dia_chi,Ngay_sinh,Sdt,Admin,Da_xoa")] NguoiDungModel nguoiDungModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(nguoiDungModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(nguoiDungModel));
        }
        public async Task <IActionResult> Create([Bind("IdLoaiPhim,TenLoaiPhim")] LoaiPhimModel loaiPhimModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(loaiPhimModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(loaiPhimModel));
        }
Beispiel #3
0
        public async Task <IActionResult> Create([Bind("Id,TenRapChieu,TongSoPhong,ThanhPho,QuanHuyen")] RapChieuPhimModel rapChieuPhimModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rapChieuPhimModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(rapChieuPhimModel));
        }
        public async Task <IActionResult> Create([Bind("IdCTHD,IdHoaDon,idSanPham,SoLuong")] ChiTietHoaDonModel chiTietHoaDonModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(chiTietHoaDonModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(chiTietHoaDonModel));
        }
Beispiel #5
0
        public async Task <IActionResult> Create([Bind("IdColor,Name,Status")] ColorModel colorModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(colorModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(colorModel));
        }
        public async Task <IActionResult> Create([Bind("IdMaGiamGia,PhanTram")] GiamGiaModel giamGiaModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(giamGiaModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(giamGiaModel));
        }
 public IActionResult Register([Bind("Name,Email,Password,Phone,Total_Spending,Status")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         customer.Password = StringProcessing.CreateMD5(customer.Password);
         _context.Add(customer);
         _context.SaveChangesAsync();
         return(View("Index"));
     }
     return(View("Index"));
 }
        public async Task <IActionResult> Create([Bind("Id,Name")] ProductType productType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(productType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View("Index"));
        }
Beispiel #9
0
        public async Task <IActionResult> Create([Bind("IdType,Name,Description,Status")] TypeShoeModel typeShoeModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(typeShoeModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(typeShoeModel));
        }
Beispiel #10
0
        public async Task <IActionResult> Create([Bind("IdMaterial,Name,Description")] MaterialModel materialModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(materialModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(materialModel));
        }
Beispiel #11
0
        public async Task <IActionResult> Create([Bind("IdSize,NumSize")] SizeModel sizeModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sizeModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sizeModel));
        }
        public async Task <IActionResult> Create([Bind("ID,Ngay,Da_xoa,RapPhim_ID")] LichChieuModel lichChieuModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(lichChieuModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RapPhim_ID"] = new SelectList(_context.Set <RapPhimModel>(), "ID", "ID", lichChieuModel.RapPhim_ID);
            return(View(lichChieuModel));
        }
Beispiel #13
0
        public async Task <IActionResult> Create([Bind("IdRap,TenRap,DiaChiRap,MaQuanHuyen")] RapModel rapModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rapModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MaQuanHuyen"] = new SelectList(_context.quanHuyenModels, "IdQuanHuyen", "TenQuanHuyen", rapModel.MaQuanHuyen);
            return(View(rapModel));
        }
Beispiel #14
0
        public async Task <IActionResult> Create([Bind("IDRap,TenRap,TrangThai,IDTP")] RapModel rapModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rapModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IDTP"] = new SelectList(_context.ThanhPho, "IDTP", "IDTP", rapModel.IDTP);
            return(View(rapModel));
        }
Beispiel #15
0
        public async Task <IActionResult> Create([Bind("IdAdmin,FullName,Address,Phone,IdAccount")] AdminModel adminModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(adminModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdAccount"] = new SelectList(_context.Account, "AccountName", "AccountName", adminModel.IdAccount);
            return(View(adminModel));
        }
        public async Task <IActionResult> Create([Bind("Id,NgayLap,TongTien,MaThanhVien,TrangThai")] HoaDonModel hoaDonModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(hoaDonModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MaThanhVien"] = new SelectList(_context.tb_ThanhVien, "Id", "Email", hoaDonModel.MaThanhVien);
            return(View(hoaDonModel));
        }
Beispiel #17
0
        public async Task <IActionResult> Create([Bind("IdPhong,TenPhong,MaRap")] PhongModel phongModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(phongModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MaRap"] = new SelectList(_context.rapModels, "IdRap", "DiaChiRap", phongModel.MaRap);
            return(View(phongModel));
        }
Beispiel #18
0
        public async Task <IActionResult> Create([Bind("IdChiTietDatVe,TenGhe,GiaVe,MaDatVe")] ChiTietDatVeModel chiTietDatVeModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(chiTietDatVeModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MaDatVe"] = new SelectList(_context.datVeModels, "IdDatVe", "IdDatVe", chiTietDatVeModel.MaDatVe);
            return(View(chiTietDatVeModel));
        }
Beispiel #19
0
        public async Task <IActionResult> Create([Bind("IDPhong,SoPhong,TrangThai,IDRap")] PhongModel phongModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(phongModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IDRap"] = new SelectList(_context.Rap, "IDRap", "IDRap", phongModel.IDRap);
            return(View(phongModel));
        }
Beispiel #20
0
        public async Task <IActionResult> Create([Bind("IdOrder,IdUser,Date,Status")] OrderModel orderModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(orderModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdUser"] = new SelectList(_context.User, "IdUser", "Address", orderModel.IdUser);
            return(View(orderModel));
        }
        public async Task <IActionResult> Create([Bind("IDCTHD,IDHD,TenRap,TenPhim,GioChieu,NgayChieu,PhongChieu,TenGhe,SoLuong,GiaLG")] ChiTietHoaDonModel chiTietHoaDonModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(chiTietHoaDonModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IDHD"] = new SelectList(_context.HoaDon, "IDHD", "IDHD", chiTietHoaDonModel.IDHD);
            return(View(chiTietHoaDonModel));
        }
Beispiel #22
0
        public async Task <IActionResult> Create([Bind("Id,Name,ProductTypeId")] Category category)
        {
            if (ModelState.IsValid)
            {
                _context.Add(category);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            _construct();
            return(View(category));
        }
Beispiel #23
0
        public async Task <IActionResult> Create([Bind("IdUser,Username,Password,HoTen,NgaySinh,GioiTinh,DiaChi,SDT,LoaiTaiKhoan")] UserModel userModel)
        {
            if (ModelState.IsValid)
            {
                userModel.Password = StringProcess.CreateMD5Hash(userModel.Password).ToString();
                _context.Add(userModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(userModel));
        }
Beispiel #24
0
        public async Task <IActionResult> Create([Bind("IdQuanHuyen,TenQuanHuyen,MaThanhPho")] QuanHuyenModel quanHuyenModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(quanHuyenModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MaThanhPho"] = new SelectList(_context.thanhPhoModels, "IdThanhPho", "TenThanhPho", quanHuyenModel.MaThanhPho);
            return(View(quanHuyenModel));
        }
        public async Task <IActionResult> Create([Bind("Id,Username,Password,Name,Image,Address,Phone,Email,Catid")] Account account)
        {
            if (ModelState.IsValid)
            {
                _context.Add(account);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Catid"] = new SelectList(_context.typeAccount, "Id", "Id", account.Catid);
            return(View(account));
        }
Beispiel #26
0
        public async Task <IActionResult> Create([Bind("ID,Name,Capacity,Length,Width,Status,Cinema_ID")] Room room)
        {
            Middleware.CheckStafLogin(HttpContext);
            if (ModelState.IsValid)
            {
                _context.Add(room);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(RedirectToAction(nameof(Index)));
        }
        public async Task <IActionResult> Create([Bind("IdUser,UserName,PassWord,AnhDaiDien,MoTa,NgayLap,IdLoaiUser")] UserModel userModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userModel);

                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(userModel));
        }
        public async Task <bool> Create([Bind("Id,NgayChieu,ThoiGianBatDau,TrangThai,MaPhong,MaPhim")] SuatChieuModel suatChieuModel)
        {
            if (ModelState.IsValid)
            {
                suatChieuModel.TrangThai = true;
                _context.Add(suatChieuModel);
                await _context.SaveChangesAsync();

                return(true);
            }
            return(false);
        }
Beispiel #29
0
        public async Task <IActionResult> Create([Bind("Id,IdPhong,NgayChieu")] LichChieuModel lichChieuModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(lichChieuModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdPhong"] = new SelectList(_context.Phong, "Id", "TenPhong", lichChieuModel.IdPhong);
            return(View(lichChieuModel));
        }
Beispiel #30
0
        public async Task <IActionResult> Create([Bind("IDPhim,IDPhong,AnhPhim,TenPhim,TenDienVien,TenNgonNgu,TheLoai,TenPhuDe,DaoDien,KhoiChieu,ThoiLuong,Rated,TrangThai")] PhimModel phimModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(phimModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IDPhong"] = new SelectList(_context.Phong, "IDPhong", "IDPhong", phimModel.IDPhong);
            return(View(phimModel));
        }