コード例 #1
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"));
            }
        }