Esempio n. 1
0
        public JsonResult ValidateEmail(string EmployeeID, string WorkEmail)
        {
            if (EmployeeID == "undefined")
            {
                if (_validateService.CheckEmail(WorkEmail))
                {
                    return(Json(" is in use", JsonRequestBehavior.AllowGet));
                }

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

            if (_validateService.CheckEmail(WorkEmail) && _validateService.CheckEmailOwner(WorkEmail, EmployeeID))
            {
                return(Json(" is in use", JsonRequestBehavior.AllowGet));
            }

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