コード例 #1
0
        public ActionResult ChinhSuaLoTrinh(string MaLT)
        {
            ViewBag.MaKH  = KhachHangQueries.DanhSachKhachHang();
            ViewBag.model = LoTrinhQueries.ChiTiet_LoTrinh(MaLT);
            var model = LoTrinhQueries.LayDanhSachLoTrinh();

            return(View(model));
        }
コード例 #2
0
 public ActionResult TraCuuDonHang(string maHopDong)
 {
     if (maHopDong != null)
     {
         ViewBag.KhachHangDat   = KhachHangQueries.TimKhachHang(maHopDong);
         ViewBag.TimKiemHopDong = HopDongQueries.TimHopDong(maHopDong);
     }
     return(View());
 }
コード例 #3
0
        public ActionResult ChinhsuaGia(string id)
        {
            var bg = BangGiaQueries.LayChiTietGia(id);

            ViewBag.MaLoaiXe  = LoaiXeQueries.LayDanhSachLoaiXe();
            ViewBag.MaKH      = KhachHangQueries.LayDanhSachKhachHangThanThiet();
            ViewBag.MaLoTrinh = LoTrinhQueries.LayDanhSachLoTrinh();
            return(View(bg));
        }
コード例 #4
0
        public ActionResult ChinhSuaHopDong(String SoHopDong)
        {
            ViewBag.CTCPPS    = ChiTietChiPhiPhatSinhQueries.LayDanhSachCTCPPhatSinhTheoSoHopDong(SoHopDong);
            ViewBag.ChiPhi    = ChiPhiPhatSinhQueries.DanhSachChiPhiPhatSinh();
            ViewBag.LoTrinh   = LoTrinhQueries.LayDanhSachLoTrinh();
            ViewBag.KhachHang = KhachHangQueries.LayDanhSachKhachHangThanThiet();
            var model = HopDongQueries.LayThongTinHopDong(SoHopDong);

            return(View(model));
        }
コード例 #5
0
        public ActionResult MenuThemLoTrinh(LoTrinhViewModel lotrinh)
        {
            ViewBag.MaKH = KhachHangQueries.DanhSachKhachHang();
            LoTrinh x = (new QuanLyThueXeEntities()).LoTrinhs.SingleOrDefault(n => n.TenLoTrinh == lotrinh.TenLoTrinh && n.MaKH == lotrinh.MaKH && n.Dang == true);

            if (x != null)
            {
                @ViewBag.ThongBaoTrungTen = "Lộ trình này đã có";
                return(View());
            }
            LoTrinhQueries.ThemLoTrinh(lotrinh);
            return(RedirectToAction("MenuDanhSachLoTrinh", "LoTrinh"));
        }
コード例 #6
0
 public ActionResult DangNhap(KhachHangDangNhapViewModel model)
 {
     if (ModelState.IsValid)
     {
         KhachHangViewModel khachHang = KhachHangQueries.DangNhap(model);
         if (khachHang != null)
         {
             ViewBag.ThongBao = "Đăng nhập thành công";
             Session[Constants.Constants.LOGIN_KHACHHANG] = khachHang;
             return(RedirectToAction("Index", "TrangChu"));
         }
     }
     ViewBag.ThongBao = "Đăng nhập thất bại";
     return(View());
 }
コード例 #7
0
        public ActionResult ChinhSuaKhachHang(KhachHangViewModel khachHang)
        {
            var model = KhachHangQueries.LayThongTinChiTiet(khachHang.MaKH);

            //
            ViewBag.MaLoaiKH = new SelectList(LoaiKhachHangQueries.LayDanhSachLoaiKhachHang(), "MaLoaiKH", "TenLoaiKH", model.MaLoaiKH);
            if (model.MaLoaiKH == "LKH2")
            {
                KhachHangQueries.CapNhatThongTinKhachHangThanThiet(khachHang);
                return(RedirectToAction("MenuDanhSachKhachHangThanThiet", "KhachHang"));
            }
            else
            {
                KhachHangQueries.CapNhatThongTinKhachHang(khachHang);
                return(RedirectToAction("MenuDanhSachKhachHang", "KhachHang"));
            }
        }
コード例 #8
0
 public ActionResult MenuThemBangGia(BangGiaViewModel BG)
 {
     ViewBag.MaLoaiXe  = LoaiXeQueries.LayDanhSachLoaiXe();
     ViewBag.MaKH      = KhachHangQueries.DanhSachKhachHang();
     ViewBag.MaLoTrinh = LoTrinhQueries.LayDanhSachLoTrinh();
     if (BangGiaQueries.Kiemtra(BG))
     {
         BangGiaQueries.ThemBangGia(BG);
         ViewBag.BangGia = "Thêm thành công";
         return(View());
     }
     else
     {
         ViewBag.BangGia = "Thêm thất bại.Bảng giá nãy đã tồn tại";
         return(View());
     }
 }
コード例 #9
0
        public ActionResult MenuThemHopDong(HopDongViewModel HD, CT_HopDongViewModel CTHD, KhachHangViewModel KH, TuyenDuongMoiViewModel tuyenDuongMoi, string LoaiXe, string strSoLuong, string strMaChiPhi, string strSoLuongCP, string iNgayLech = "1")
        {
            TaiKhoanViewModel taiKhoan = Session["TaiKhoan"] as TaiKhoanViewModel;

            HD.MaNV           = taiKhoan.MaNV;
            ViewBag.LoTrinh   = LoTrinhQueries.LayDanhSachLoTrinh();
            ViewBag.LoaiXe    = LoaiXeQueries.LayDanhSachLoaiXe();
            ViewBag.KhachHang = KhachHangQueries.DanhSachKhachHang();
            if (String.IsNullOrEmpty(LoaiXe))
            {
                var model = HopDongQueries.ThemHopDongTuyenDuongMoi(HD, CTHD, KH, tuyenDuongMoi);
            }
            else
            {
                var model = HopDongQueries.ThemHopDong(HD, CTHD, KH, LoaiXe, strSoLuong, strMaChiPhi, strSoLuongCP, iNgayLech);
            }
            return(RedirectToAction("MenuDanhSachHopDong", "HopDong"));
        }
コード例 #10
0
        public ActionResult LuuThongTinFacebook(KhachHangViewModel model)
        {
            KhachHangViewModel khachHang = (KhachHangViewModel)Session[Constants.Constants.LOGIN_KHACHHANG];

            if (ModelState.IsValid)
            {
                khachHang.TenKH  = model.TenKH;
                khachHang.SoDT   = model.SoDT;
                khachHang.DiaChi = model.DiaChi;
                if (!KhachHangQueries.KiemTraTaiKhoanFacebook(khachHang.MaKH))
                {
                    KhachHangQueries.DangKyBangFacebook(khachHang);
                }
                else
                {
                    KhachHangQueries.SuaThongTinKhachHang(khachHang);
                }
                Session[Constants.Constants.LOGIN_KHACHHANG] = khachHang;
            }
            return(RedirectToAction("GioHang", "GioHang"));
        }
コード例 #11
0
        public ActionResult FacebookCallback(string code)
        {
            var     fb     = new FacebookClient();
            dynamic result = fb.Post("oauth/access_token", new
            {
                client_id     = ConfigurationManager.AppSettings["FacebookAppID"],
                client_secret = ConfigurationManager.AppSettings["FacebookAppSecret"],
                redirect_uri  = RediredtUri.AbsoluteUri,
                code          = code
            });
            var accessToken = result.access_token;

            fb.AccessToken = accessToken;
            dynamic me = fb.Get("me?fields=link,first_name,currency,last_name,email,gender,locale,timezone,verified,picture,age_range,birthday,address");

            //Xu lí thong tin Facebook
            if (!KhachHangQueries.KiemTraTaiKhoanFacebook(me.id))//thua
            {
                KhachHangViewModel model = new KhachHangViewModel()
                {
                    DiaChi   = me.address,
                    Email    = me.email,
                    GioiTinh = me.gender,
                    MaKH     = me.id,
                    TenKH    = me.first_name + " " + me.last_name
                };
                KhachHangQueries.DangKyBangFacebook(model);//thua
                Session[Constants.Constants.LOGIN_KHACHHANG] = model;
            }
            else
            {
                Session[Constants.Constants.LOGIN_KHACHHANG] = KhachHangQueries.TimKhachHangTheoMa(me.id);
            }
            Session[Constants.Constants.HINH_LOGIN] = me.picture.data.url;
            return(RedirectToAction("Index", "TrangChu"));
        }
コード例 #12
0
 public ActionResult MenuThemLoTrinh()
 {
     ViewBag.MaKH = KhachHangQueries.LayDanhSachKhachHangThanThiet();
     return(View());
 }
コード例 #13
0
        public ActionResult ThongTinChiTiet_KTT(string MaKH)
        {
            var model = KhachHangQueries.LayThongTinChiTiet(MaKH);

            return(View(model));
        }
コード例 #14
0
        /// <summary>
        /// Danh sach khang hang than thiet
        /// </summary>
        /// <returns>list<KhachHangViewModel></returns>
        public ActionResult MenuDanhSachKhachHangThanThiet()
        {
            var model = KhachHangQueries.LayDanhSachKhachHangThanThiet();

            return(View(model));
        }
コード例 #15
0
 public ActionResult ThemKhachHangThanThiet(KhachHangViewModel khachHang)
 {
     KhachHangQueries.ThemKhachHangThanThiet(khachHang);
     return(RedirectToAction("MenuDanhSachKhachHangThanThiet", "KhachHang"));
 }
コード例 #16
0
 public ActionResult XoaKHTT(String MaKH)
 {
     KhachHangQueries.XoaKH(MaKH);
     return(RedirectToAction("MenuDanhSachKhachHangThanThiet", "KhachHang"));
 }
コード例 #17
0
        public JsonResult GetThongTinKH(String maKhachHang)
        {
            var data = KhachHangQueries.LayThongTinChiTiet(maKhachHang);

            return(Json(new { data = data }, JsonRequestBehavior.AllowGet));
        }