コード例 #1
0
        public IHttpActionResult CheckEmailExists(EmailCheckDTO Email)
        {
            ResultReponse MyResultReponse = new ResultReponse();
            UserDTO       UserInfo        = new UserDTO();

            try
            {
                MyUELHelpers.Info(typeof(RegisterController).ToString(), "CheckEmailExists", "Started " + DateTime.Now.ToString());

                UserInfo = m_IRegisterBusiness.CheckEmailExists(Email.Email);
                if (UserInfo != null)
                {
                    if (UserInfo.Id > 0)
                    {
                        MyResultReponse.Status     = "EMAILEXISTS";
                        MyResultReponse.StatusCode = "EMAILEXISTS";
                        MyResultReponse.Message    = "Email already exists";
                    }
                    else
                    {
                        MyResultReponse.Status     = "EMAILNOTEXISTS";
                        MyResultReponse.StatusCode = "EMAILNOTEXISTS";
                        MyResultReponse.Message    = "Email not exists";
                    }
                }
                else
                {
                    MyResultReponse.Status     = "EMAILNOTEXISTS";
                    MyResultReponse.StatusCode = "EMAILNOTEXISTS";
                    MyResultReponse.Message    = "Email not exists";
                }
                MyUELHelpers.Info(typeof(RegisterController).ToString(), "CheckEmailExists", "Done " + DateTime.Now.ToString());

                return(Json(MyResultReponse));
            }
            catch (Exception Ex)
            {
                MyUELHelpers.ErrorLog(typeof(RegisterController).ToString(), "CheckEmailExists", Ex.ToString());
            }
            return(null);
        }