Esempio n. 1
0
        public ResultLoginRowData GetInfoUser(AccountRowData data)
        {
            ResultLoginRowData result = new ResultLoginRowData();

            try
            {
                string sql = @"
                    SELECT 
	                    USER_ID,
	                    FULL_NAME,
	                    EMAIL,
	                    PHONE,
	                    PASSWORD,
	                    ADDRESS,
                        USER_TYPE
                    FROM S_USER
                    WHERE EMAIL = '" + data.Email + @"'
                    OR PHONE = '" + data.Email + @"'
                    ";
                result = dbcontext.Database.SqlQuery <ResultLoginRowData>(sql).FirstOrDefault();
                if (result != null)
                {
                    result.IS_SUCCESS = true;
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }
            return(result);
        }
Esempio n. 2
0
        public ResultLoginRowData CheckLoginMobile(AccountRowData data)
        {
            ResultLoginRowData result = new ResultLoginRowData();

            try
            {
                bool isResult = Login(data);
                if (isResult)
                {
                    result = GetInfoUser(data);
                }
                else
                {
                    result.IS_SUCCESS = false;
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }
            return(result);
        }