Exemplo n.º 1
0
        public IHttpActionResult GetUserInformation()
        {
            try
            {
                var userProvider = new Ksmed.Security.Activation.Providers.UserInformationProvider(true);

                return(Ok(userProvider));
            }
            catch (Exception ex)
            {
                _traceManager.TraceError(ex, ex.Message);
                return(InternalServerError(ex));
            }
        }
Exemplo n.º 2
0
        public IHttpActionResult SetUserInformation([DynamicBody] dynamic param)
        {
            try
            {
                string name    = (string)param.name;
                string company = (string)param.company;
                string email   = (string)param.email;

                var userProvider = new Ksmed.Security.Activation.Providers.UserInformationProvider(true);
                if (userProvider.Username != name ||
                    userProvider.Company != company ||
                    userProvider.Email != email)
                {
                    userProvider.SetUserInformation(name, company, email);
                }

                return(Ok());
            }
            catch (Exception ex)
            {
                _traceManager.TraceError(ex, ex.Message);
                return(InternalServerError(ex));
            }
        }