コード例 #1
0
        /// <summary>
        /// Daniel Romero 26 de Junio de 2016
        /// Metodo que permite verificar la existencia de un email repetido
        /// </summary>
        /// <param name="sEmail"></param>
        /// <returns></returns>
        public JsonResult CheckEmail(string sEmail)
        {
            try
            {
                cmSecurity niSecurity = new cmSecurity();
                DataSet    dsUser     = new DataSet();
                bool       bAccess    = niSecurity.CheckEmail(sEmail, out dsUser, out sErrMsj);


                if (dsUser.Tables.Count > 0)
                {
                    if (dsUser.Tables[0].Rows.Count > 0)
                    {
                        bAccess = false;
                    }
                }
                else
                {
                    bAccess = true;
                }

                return(new JsonResult()
                {
                    Data = bAccess
                });
            }
            catch (Exception)
            {
                return(new JsonResult()
                {
                });
            }
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public JsonResult LogIn(string objUser)
        {
            try
            {
                JavaScriptSerializer jSerializer = new JavaScriptSerializer();
                cmUser     user       = jSerializer.Deserialize <cmUser>(objUser);
                cmSecurity niSecurity = new cmSecurity();
                DataSet    dsUser     = new DataSet();
                bool       bAccess    = niSecurity.LogIn(user.sUserName, user.sPassword, out dsUser, out sErrMsj);
                if (bAccess)
                {
                    Session["userName"]  = user.sUserName;
                    Session["RoleID"]    = dsUser.Tables[0].Rows[0]["RoleId"].ToString();
                    TempData["userName"] = user.sUserName;
                }


                return(new JsonResult()
                {
                    Data = bAccess
                });
            }
            catch (Exception)
            {
                return(new JsonResult()
                {
                });
            }
        }
コード例 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="objUser"></param>
        /// <returns></returns>
        public JsonResult SignIn(string objUser)
        {
            try
            {
                Session.Remove("SignIn");
                JavaScriptSerializer jSerializer = new JavaScriptSerializer();
                cmUserSgnIn          user        = jSerializer.Deserialize <cmUserSgnIn>(objUser);
                cmSecurity           niSecurity  = new cmSecurity();
                DataSet dsUser  = new DataSet();
                bool    bAccess = niSecurity.SignIn(user.sFirstName, user.sLastName, user.sEmail, user.sPassword, out sErrMsj);

                if (bAccess)
                {
                    TempData["SignIn"] = true;
                }

                return(new JsonResult()
                {
                    Data = bAccess
                });
            }
            catch (Exception)
            {
                return(new JsonResult()
                {
                });
            }
        }
コード例 #4
0
 public JsonResult AddNewEmailUser(string sEmail)
 {
     try
     {
         cmSecurity niSecurity  = new cmSecurity();
         bool       bSuccesfull = true;
         bSuccesfull = niSecurity.AddNewEmailUser(sEmail, out sErrMsj);
         return(new JsonResult()
         {
             Data = bSuccesfull
         });
     }
     catch (Exception ex)
     {
         cUtilities.WriteLog(ex.Message, out sErrMsj);
         return(new JsonResult()
         {
             Data = ex.Message
         });
     }
 }