Example #1
0
        public async Task <User> GetUserAsync(string password, string username)
        {
            try
            {
                User         user = null;
                SqlOperation sqlO = new SqlOperation()
                {
                    ProcedureName = "RET_USER_BY_CREDENTIALS",
                };

                sqlO.addParameter(password, "Password");
                sqlO.addParameter(username, "Username");

                List <Dictionary <string, object> > data = await SqlDaoInstance.ExecuteQueryProcedureAsync(sqlO);

                if (data != null)
                {
                    foreach (var UserData in data)
                    {
                        user = (User)BuildObject(UserData, (new User()));
                    }
                }

                return(user);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public Profile GetProfile(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(null);
            }

            Profile profile = null;

            var operation = new SqlOperation("ADRIAN_VEGA_ACEVEDO");

            operation.addParameter("IDENTIFICATION", id);

            var result = _instance.ExecuteQueryProcedure(operation);

            if (result?.Count > 0)
            {
                profile = new BuilderObjects <Profile>().Build(result[0], new Profile());
            }

            return(profile);
        }