Esempio n. 1
0
        public HttpResponseMessage GetOrganization()
        {
            log4net.Config.XmlConfigurator.Configure();
            ILog log = LogManager.GetLogger("Inside UM Controller- GetOrganization");
            UMResponseOrganization umResponse = new UMResponseOrganization();

            try
            {
                string SessionID = Guid.Empty.ToString();
                if (Request.Headers != null)
                {
                    SessionID = Request.Headers.LastOrDefault().Value.First();
                    umResponse.Organization = _IUMServer.GetOrganization(SessionID).Organization;
                }

                return(Request.CreateResponse(HttpStatusCode.OK, umResponse));
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                ErrorResponse error = new ErrorResponse();
                error.ErrorCode    = HttpStatusCode.InternalServerError;
                error.ErrorMessage = "Failure";
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, error));
            }
        }
Esempio n. 2
0
        public UMResponseOrganization GetOrganization(string SessionID)
        {
            IOrganizationRepository _IOrganizationRepository;

            _IOrganizationRepository = new OrganizationRepository(new WorkersInMotionDB());
            UMResponseOrganization _umResponse = new UMResponseOrganization();

            //_umResponse.Organization = new MOrganization();
            //if (!string.IsNullOrEmpty(SessionID))
            //{
            //    string OrganizationGUID = _IOrganizationRepository.GetOrganizationID(SessionID);
            //    if (!string.IsNullOrEmpty(OrganizationGUID))
            //    {
            //        Organization org = _IOrganizationRepository.GetOrganizationByID(new Guid(OrganizationGUID));
            //        if (org != null)
            //        {
            //            _umResponse.Organization.OrganizationGUID = org.OrganizationGUID;
            //            _umResponse.Organization.OrganizationName = org.OrganizationName;
            //            _umResponse.Organization.OrganizationFullName = org.OrganizationFullName;
            //            _umResponse.Organization.Website = org.Website;
            //            _umResponse.Organization.Phone = org.Phone;
            //            //  _umResponse.Organization.TimeZone = org.TimeZone;
            //            _umResponse.Organization.AddressLine1 = org.AddressLine1;
            //            _umResponse.Organization.AddressLine2 = org.AddressLine2;
            //            _umResponse.Organization.City = org.City;
            //            _umResponse.Organization.State = org.State;
            //            _umResponse.Organization.Country = org.Country;
            //            _umResponse.Organization.ZipCode = org.ZipCode;
            //            _umResponse.Organization.EmailID = org.EmailID;
            //            // _umResponse.Organization.ApplicationURL = org.ApplicationURL;
            //            _umResponse.Organization.IsActive = org.IsActive;
            //            _umResponse.Organization.IsDeleted = org.IsDeleted;
            //            //_umResponse.Organization.CreatedDate = org.CreatedDate;

            //        }
            //    }
            //}
            return(_umResponse);
        }
Esempio n. 3
0
        public UMResponseOrganization GetOrganization(string SessionID)
        {
            IOrganizationRepository _IOrganizationRepository;
            _IOrganizationRepository = new OrganizationRepository(new WorkersInMotionDB());
            UMResponseOrganization _umResponse = new UMResponseOrganization();
            //_umResponse.Organization = new MOrganization();
            //if (!string.IsNullOrEmpty(SessionID))
            //{
            //    string OrganizationGUID = _IOrganizationRepository.GetOrganizationID(SessionID);
            //    if (!string.IsNullOrEmpty(OrganizationGUID))
            //    {
            //        Organization org = _IOrganizationRepository.GetOrganizationByID(new Guid(OrganizationGUID));
            //        if (org != null)
            //        {
            //            _umResponse.Organization.OrganizationGUID = org.OrganizationGUID;
            //            _umResponse.Organization.OrganizationName = org.OrganizationName;
            //            _umResponse.Organization.OrganizationFullName = org.OrganizationFullName;
            //            _umResponse.Organization.Website = org.Website;
            //            _umResponse.Organization.Phone = org.Phone;
            //            //  _umResponse.Organization.TimeZone = org.TimeZone;
            //            _umResponse.Organization.AddressLine1 = org.AddressLine1;
            //            _umResponse.Organization.AddressLine2 = org.AddressLine2;
            //            _umResponse.Organization.City = org.City;
            //            _umResponse.Organization.State = org.State;
            //            _umResponse.Organization.Country = org.Country;
            //            _umResponse.Organization.ZipCode = org.ZipCode;
            //            _umResponse.Organization.EmailID = org.EmailID;
            //            // _umResponse.Organization.ApplicationURL = org.ApplicationURL;
            //            _umResponse.Organization.IsActive = org.IsActive;
            //            _umResponse.Organization.IsDeleted = org.IsDeleted;
            //            //_umResponse.Organization.CreatedDate = org.CreatedDate;

            //        }
            //    }
            //}
            return _umResponse;
        }