Example #1
0
        public InsertContactDataResponse Post(InsertContactDataRequest request)
        {
            InsertContactDataResponse response = new InsertContactDataResponse();

            if (request != null)
            {
                response.Version = request.Version;
                try
                {
                    if (string.IsNullOrEmpty(request.UserId))
                    {
                        throw new UnauthorizedAccessException("ContactDD:Post()::Unauthorized Access");
                    }

                    response.Id = Manager.InsertContact(request);
                }
                catch (Exception ex)
                {
                    CommonFormat.FormatExceptionResponse(response, base.Response, ex);

                    string aseProcessId = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0";
                    Helpers.LogException(int.Parse(aseProcessId), ex);
                }
            }
            return(response);
        }
Example #2
0
        public GetContactByUserIdDataResponse Get(GetContactByUserIdDataRequest request)
        {
            GetContactByUserIdDataResponse response = new GetContactByUserIdDataResponse();

            response.Version = request.Version;
            try
            {
                if (string.IsNullOrEmpty(request.UserId))
                {
                    throw new UnauthorizedAccessException("ContactDD:Get()::Unauthorized Access");
                }

                response.Contact = Manager.GetContactByUserId(request);
            }
            catch (Exception ex)
            {
                CommonFormat.FormatExceptionResponse(response, base.Response, ex);

                string aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0";
                Helpers.LogException(int.Parse(aseProcessID), ex);
            }
            return(response);
        }