Ejemplo n.º 1
0
        //Check whether username is existing
        public JsonResult IsUserEmailExisting(string chkUserEmail)
        {
            FormsAuthenticationTicket ticket = null;

            try
            {
                _UserDetailsBusinessLogic = new UserDetailsBusinessLogic();
                HttpCookie authCookie = System.Web.HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName];
                ticket = authCookie == null?null:FormsAuthentication.Decrypt(authCookie.Value);

                bool isExisting = _UserDetailsBusinessLogic.IsUserEmailExisting(chkUserEmail);

                return(Json(isExisting));
            }
            catch (Exception ex)
            {
                currentFile = this.ControllerContext.RouteData.Values["controller"].ToString(); // System.Diagnostics.StackTrace(true).GetFrame(0).GetFileName();
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                methodName = sf.GetMethod().Name;
                ErrorLogHelper.UpdatingErrorLog(currentFile + "-" + methodName, ticket == null ? "N/A" : ticket.Name, ex);
                return(Json(false));
            }
        }