Esempio n. 1
0
        public JsonResult CheckUserName(string username, string email, string sodienthoai, string cmnd)
        {
            var isDuplicate = false;

            foreach (var user in _nhanVienKhoBus.GetAllUserName())
            {
                if (user.UserName == username)
                {
                    isDuplicate = true;
                }
                if (user.Email == email)
                {
                    isDuplicate = true;
                }
                if (user.SoDienThoai == sodienthoai)
                {
                    isDuplicate = true;
                }
                if (user.CMND == cmnd)
                {
                    isDuplicate = true;
                }
            }

            var jsonData = new { isDuplicate };

            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }