public ActionResult MenuDanhSachNV()
        {
            var lst = NhanVienQueries.LayDanhSachNhanVien();

            ViewBag.NhanVien = LoaiNhanVienQueries.DanhSachLoaiNhanVien();
            return(View(lst));
        }
Example #2
0
        public PartialViewResult InfoPartial()
        {
            TaiKhoanViewModel TaiKhoan = Session["TaiKhoan"] as TaiKhoanViewModel;
            var model = NhanVienQueries.LayThongTinChiTiet(TaiKhoan.MaNV);

            return(PartialView(model));
        }
        public ActionResult ChinhsuaNV(NhanVienViewModel nv, HttpPostedFileBase HinhAnhNV)
        {
            ViewBag.MaLoaiNV = LoaiNhanVienQueries.DanhSachLoaiNhanVien();
            ViewBag.MaTinh   = Tinh_TPQueries.LayDanhSachTinh_TP();
            ViewBag.MaBang   = LoaiBangQueries.LayDanhSachLoaiBang();

            var entity   = new QuanLyThueXeEntities();
            var nhanvien = entity.NhanViens.SingleOrDefault(n => n.MaNV == nv.MaNV);

            if (HinhAnhNV == null)
            {
                nv.HinhAnh = nhanvien.HinhAnh;
                var model = NhanVienQueries.ChinhsuaNV(nv);
                return(RedirectToAction("MenuDanhSachNV", "NhanVien"));
            }
            if (HinhAnhNV != null)
            {
                if (HinhAnhNV.ContentType != "image/jpeg" && HinhAnhNV.ContentType != "image/png" && HinhAnhNV.ContentType != "image/gif" && HinhAnhNV.ContentType != "image/jpg")
                {
                    ViewBag.upload += "Hình ảnh không hợp lệ <br />";
                }
                else
                {
                    var fileName = Path.GetFileName(HinhAnhNV.FileName);
                    //Lấy hình ảnh chuyển vào thư mục hình ảnh
                    var path = Path.Combine(Server.MapPath("~/Content/HinhNV"), fileName);
                    HinhAnhNV.SaveAs(path);
                }
                nv.HinhAnh = HinhAnhNV.FileName;
            }
            NhanVienQueries.ChinhsuaNV(nv);
            return(RedirectToAction("MenuDanhSachNV", "NhanVien"));
        }
 public ActionResult ChinhsuaTK(TaiKhoanViewModel tk)
 {
     ViewBag.MaNV    = new SelectList(NhanVienQueries.LayDanhSachNhanVien(), "MaNV", "HoTen", tk.MaNV);
     ViewBag.MaQuyen = new SelectList(QuyenQueries.LayDanhSachQuyen(), "MaQuyen", "TenQuyen", tk.MaQuyen);
     TaiKhoanQueries.ChinhsuaTaiKhoan(tk);
     return(RedirectToAction("MenuDanhSachTaiKhoan", "TaiKhoan"));
 }
Example #5
0
        public ActionResult ChinhsuaXe(XeViewModel xe, HttpPostedFileBase HinhAnhXe)
        {
            ViewBag.MaLoaiXe     = LoaiXeQueries.LayDanhSachLoaiXe();
            ViewBag.MaCongTy     = CongTiesQueries.LayDanhSachCongTy();
            ViewBag.MaThuongHieu = ThuongHieuQueries.LayDanhSachThuongHieu();
            ViewBag.MaNV         = NhanVienQueries.LayDanhSachNhanVien();

            var entity = new QuanLyThueXeEntities();
            var Xe     = entity.Xes.SingleOrDefault(n => n.MaXe == xe.MaXe);

            if (HinhAnhXe == null)
            {
                xe.HinhAnh = Xe.HinhAnh;
                var model = XeQueries.ChinhSuaXe(xe);
                return(RedirectToAction("MenuDanhSachXe", "Xe"));
            }
            if (HinhAnhXe != null)
            {
                if (HinhAnhXe.ContentType != "image/jpeg" && HinhAnhXe.ContentType != "image/png" && HinhAnhXe.ContentType != "image/gif" && HinhAnhXe.ContentType != "image/jpg")
                {
                    ViewBag.upload += "Hình ảnh không hợp lệ <br />";
                }
                else
                {
                    var fileName = Path.GetFileName(HinhAnhXe.FileName);
                    //Lấy hình ảnh chuyển vào thư mục hình ảnh
                    var path = Path.Combine(Server.MapPath("~/Content/HinhXe"), fileName);
                    HinhAnhXe.SaveAs(path);
                }
                xe.HinhAnh = HinhAnhXe.FileName;
            }
            XeQueries.ChinhSuaXe(xe);
            return(RedirectToAction("MenuDanhSachXe", "Xe"));
        }
        public ViewResult MenuTaoTaiKhoan()
        {
            var model = NhanVienQueries.LayDanhSachNhanVien();

            ViewBag.Quyen = QuyenQueries.LayDanhSachQuyen();
            return(View(model));
        }
        public ActionResult ChinhsuaTK(string id)
        {
            var tk = TaiKhoanQueries.LayChiTietTaiKhoan(id);

            ViewBag.MaNV    = new SelectList(NhanVienQueries.LayDanhSachNhanVien(), "MaNV", "HoTen", tk.MaNV);
            ViewBag.MaQuyen = new SelectList(QuyenQueries.LayDanhSachQuyen(), "MaQuyen", "TenQuyen", tk.MaQuyen);
            return(View(tk));
        }
Example #8
0
 public ActionResult MenuThemXe()
 {
     ViewBag.MaLoaiXe     = LoaiXeQueries.LayDanhSachLoaiXe();
     ViewBag.MaCongTy     = CongTiesQueries.LayDanhSachCongTy();
     ViewBag.MaThuongHieu = ThuongHieuQueries.LayDanhSachThuongHieu();
     ViewBag.MaNV         = NhanVienQueries.LayDanhSachNhanVien();
     return(View());
 }
Example #9
0
        public ActionResult ChiTietDieuPhoiTaiXe(int SoCTHopDong)
        {
            var model = CT_HopDongQueries.LayThongTinChiTietCTHD(SoCTHopDong);

            ViewBag.TaiXe = NhanVienQueries.LayDSNVDangChoTheoMaLoaiNV("LNV2");
            ViewBag.PhuXe = NhanVienQueries.LayDanhSachNhanVien();
            return(View(model));
        }
        public ActionResult LockScreen()
        {
            TaiKhoanViewModel TaiKhoan = Session["TaiKhoan"] as TaiKhoanViewModel;

            ViewBag.TaiKhoanNV = TaiKhoan.TaiKhoanNV;
            var model = NhanVienQueries.LayThongTinChiTiet(TaiKhoan.MaNV);

            return(View(model));
        }
        public ActionResult ChinhsuaNV(string id)
        {
            var nv = NhanVienQueries.LayThongTinChiTiet(id);

            ViewBag.MaLoaiNV = LoaiNhanVienQueries.DanhSachLoaiNhanVien();
            ViewBag.MaTinh   = Tinh_TPQueries.LayDanhSachTinh_TP();
            ViewBag.Bang     = LoaiBangQueries.LayDanhSachLoaiBang();
            return(View(nv));
        }
Example #12
0
        public ActionResult ChinhsuaXe(string id)
        {
            var xe = XeQueries.LayThongTinChiTietXe(id);

            ViewBag.MaLoaiXe     = new SelectList(LoaiXeQueries.LayDanhSachLoaiXe().ToList(), "MaLoaiXe", "TenLoaiXe", xe.MaLoaiXe);
            ViewBag.MaCongTy     = new SelectList(CongTiesQueries.LayDanhSachCongTy().ToList(), "MaCongTy", "TenCongTy", xe.MaCongTy);
            ViewBag.MaThuongHieu = new SelectList(ThuongHieuQueries.LayDanhSachThuongHieu().ToList(), "MaThuongHieu", "TenThuongHieu", xe.MaThuongHieu);
            ViewBag.MaNV         = NhanVienQueries.LayDanhSachNhanVien();
            return(View(xe));
        }
Example #13
0
        public ThaoTacTourViewModel(string maTour)
        {
            TourChiTietViewModel tour = TourQueries.TimTour(maTour);

            Tour          = tour.Tour;
            DiemDis       = DiaDiemQueries.LoadDiaDiem(tour.Tour.MaDiaDiemDi.ToString());
            DiemDens      = DiaDiemQueries.LoadDiaDiem(tour.Tour.MaDiaDiemDen.ToString());
            KhachSans     = KhachSanQueries.LayDsKhachSan(tour.MaKS);
            LoaiTours     = TourQueries.LoadLoaiTour(tour.Tour.LoaiTour);
            HuongDanViens = NhanVienQueries.LoadHuongDanVien(tour.Tour.MaHDV);
        }
Example #14
0
        public ThaoTacTourViewModel()
        {
            DiemDis = DiaDiemQueries.LoadDiaDiem();
            //DiemDis.SelectedValue = DiemDis.FirstOrDefault().Value;
            int?maDiemDi = int.Parse(DiemDis.SelectedValue.ToString());

            DiemDens      = DiaDiemQueries.TimDiemDen2(maDiemDi);//
            KhachSans     = KhachSanQueries.LayDsKhachSan();
            LoaiTours     = TourQueries.LoadLoaiTour();
            HuongDanViens = NhanVienQueries.LoadHuongDanVien();//
        }
        public ActionResult MenuTaoTaiKhoan(TaiKhoanViewModel taiKhoan)
        {
            var model = NhanVienQueries.LayDanhSachNhanVien();

            ViewBag.Quyen = QuyenQueries.LayDanhSachQuyen();
            if (!TaiKhoanQueries.TaoTaiKhoan(taiKhoan))
            {
                ViewBag.TrungTK   = "Tài khoản đã được sử dụng";
                ViewBag.ThanhCong = "Tạo tài khoản thất bại";
                return(View(model));
            }
            else
            {
                TaiKhoanQueries.TaoTaiKhoan(taiKhoan);
                ViewBag.ThanhCong = "Tạo tài khoản thành công";
                return(View(model));
            }
        }
Example #16
0
        public ActionResult ChiTietDieuPhoiTaiXe(CT_HopDongViewModel CTHD, string MaTaiXeCu, string MaPhuXeCu)
        {
            CT_HopDongViewModel model = CT_HopDongQueries.LayThongTinChiTietCTHD(CTHD.SoCTHopDong);
            var taixe = NhanVienQueries.LayThongTinChiTiet(CTHD.MaTaiXe);
            var phuxe = NhanVienQueries.LayThongTinChiTiet(CTHD.PhuXe);

            if (taixe != null)
            {
                if (taixe.Status == "1")
                {
                    DieuPhoiQueries.CapNhatTaiXeBiTrung(taixe.MaNV, model);
                }
                else
                {
                    DieuPhoiQueries.CapNhatNhanVienBoChon(model.MaTaiXe);
                }
            }

            if (phuxe != null)
            {
                if (phuxe.Status == "1")
                {
                    DieuPhoiQueries.CapNhatTaiXeBiTrung(phuxe.MaNV, model);
                }
                else
                {
                    DieuPhoiQueries.CapNhatNhanVienBoChon(model.PhuXe);
                }
            }
            if (String.IsNullOrEmpty(CTHD.MaTaiXe) && String.IsNullOrEmpty(CTHD.TaiXeNgoai))
            {
                DieuPhoiQueries.CapNhatNhanVienBoChon(MaTaiXeCu);
            }
            if (String.IsNullOrEmpty(CTHD.PhuXe))
            {
                DieuPhoiQueries.CapNhatNhanVienBoChon(MaPhuXeCu);
            }
            CT_HopDongQueries.CapNhatDieuPhoiTaiXe(CTHD);
            TrangThaiQueries.CapNhatTrangThaiPhuXeDangCho(CTHD.PhuXe);
            TrangThaiQueries.CapNhatTrangThaiTaiXeDangCho(CTHD.MaTaiXe);
            return(RedirectToAction("MenuLichTheoNgay", "Home"));
        }
Example #17
0
        public ActionResult MenuThemXe(XeViewModel xe, HttpPostedFileBase HinhXe)
        {
            if (HinhXe != null)
            {
                if (HinhXe.ContentType != "image/jpeg" && HinhXe.ContentType != "image/png" && HinhXe.ContentType != "image/gif" && HinhXe.ContentType != "image/jpg")
                {
                    ViewBag.upload += "Hình ảnh không hợp lệ <br />";
                }
                else
                {
                    var link = Path.GetFileName(HinhXe.FileName);

                    //cắt chuỗi local
                    string[] pathArr    = link.Split('\\');
                    string   tenHinhAnh = pathArr.Last().ToString();

                    if (System.IO.File.Exists("~/Content/HinhXe/" + tenHinhAnh))
                    {
                        ;
                    }
                    {
                        //cắt chuỗi tên hình ảnh
                        string[] nameArr  = tenHinhAnh.Split('.');
                        string   first    = nameArr.First().ToString();
                        string   fileName = first + "(Copy)" + "." + nameArr.Last().ToString();
                        tenHinhAnh = fileName;
                    }
                    //Lấy hình ảnh chuyển vào thư mục hình ảnh
                    var path = Path.Combine(Server.MapPath("~/Content/HinhXe"), tenHinhAnh);
                    HinhXe.SaveAs(path);
                    xe.HinhAnh = tenHinhAnh;
                }
            }
            ViewBag.MaLoaiXe     = LoaiXeQueries.LayDanhSachLoaiXe();
            ViewBag.MaCongTy     = CongTiesQueries.LayDanhSachCongTy();
            ViewBag.MaThuongHieu = ThuongHieuQueries.LayDanhSachThuongHieu();
            ViewBag.MaNV         = NhanVienQueries.LayDanhSachNhanVien();
            XeQueries.ThemXe(xe);
            return(RedirectToAction("MenuDanhSachXe", "Xe"));
        }
        public ActionResult MenuThemNV(NhanVienViewModel Nhanvien, HttpPostedFileBase HinhNV)
        {
            ViewBag.MaLoaiNV = LoaiNhanVienQueries.DanhSachLoaiNhanVien();
            ViewBag.MaTinh   = Tinh_TPQueries.LayDanhSachTinh_TP();
            ViewBag.MaBang   = LoaiBangQueries.LayDanhSachLoaiBang();

            if (HinhNV != null)
            {
                if (HinhNV.ContentType != "image/jpeg" && HinhNV.ContentType != "image/png" && HinhNV.ContentType != "image/gif" && HinhNV.ContentType != "image/jpg")
                {
                    ViewBag.upload += "Hình ảnh không hợp lệ <br />";
                }
                else
                {
                    var link = Path.GetFileName(HinhNV.FileName);

                    //cắt chuỗi local
                    string[] pathArr    = link.Split('\\');
                    string   tenHinhAnh = pathArr.Last().ToString();

                    if (System.IO.File.Exists("~/Content/HinhNV/" + tenHinhAnh))
                    {
                        //cắt chuỗi tên hình ảnh
                        string[] nameArr = tenHinhAnh.Split('.');
                        string   first   = nameArr.First().ToString();

                        string fileName = first + "(Copy)" + "." + nameArr.Last().ToString();
                        tenHinhAnh = fileName;
                    }
                    //Lấy hình ảnh chuyển vào thư mục hình ảnh
                    var path = Path.Combine(Server.MapPath("~/Content/HinhNV"), tenHinhAnh);
                    HinhNV.SaveAs(path);

                    Nhanvien.HinhAnh = tenHinhAnh;
                }
            }
            NhanVienQueries.ThemNhanVien(Nhanvien);
            return(RedirectToAction("MenuDanhSachNV", "NhanVien"));
        }
        //thông tin chi tiết nhân viên
        public ActionResult Details(string manv)
        {
            var nv = NhanVienQueries.LayThongTinChiTiet(manv);

            return(View(nv));
        }
Example #20
0
 public String TestingSite()
 {
     return(NhanVienQueries.TestingSiteMethod() + "");
 }
 public ActionResult XoaNV(String MaNV)
 {
     NhanVienQueries.XoaNV(MaNV);
     return(RedirectToAction("MenuDanhSachNV", "NhanVien"));
 }
        public JsonResult TimNhanVienTheoLoaiNV(String MaLoaiNV)
        {
            var data = NhanVienQueries.LayDSNhanVienTheoMaLoaiNV(MaLoaiNV);

            return(Json(new { data = data }, JsonRequestBehavior.AllowGet));
        }
Example #23
0
 public ActionResult MenuThemPhieuThu()
 {
     ViewBag.MaNV = NhanVienQueries.LayDanhSachNhanVien();
     return(View());
 }
Example #24
0
 public ActionResult MenuThemPhieuThu(PhieuThuViewModel PT)
 {
     ViewBag.MaNV = NhanVienQueries.LayDanhSachNhanVien();
     PhieuThuQueries.ThemPhieuThu(PT);
     return(RedirectToAction("MenuDanhSachPhieuThu", "ThuChi"));
 }