Ejemplo n.º 1
0
        public static int InsertClientAudit(Guid clientGuid, int clientID, string clientName, string phoneNumber, string email, string address, Guid cityStateZipGuid, Guid paymentInfoGuid, string federatedID, string federatedKey, string federatedIDProvider, string username, string hashedPassword, DateTime dateModified)
        {
            try
            {
                // Create the service proxy object and populate it.
                SP.ClientAuditSvc.ClientAudit request = new SP.ClientAuditSvc.ClientAudit();

                request.ClientAuditGuid = Guid.Empty;
                request.ClientGuid = clientGuid;
                request.ClientID = clientID;
                request.ClientName = clientName;
                request.PhoneNumber = phoneNumber;
                request.Email = email;
                request.Address = address;
                request.CityStateZipGuid = cityStateZipGuid;
                request.PaymentInfoGuid = paymentInfoGuid;
                request.FederatedID = federatedID;
                request.FederatedKey = federatedKey;
                request.FederatedIDProvider = federatedIDProvider;
                request.Username = username;
                request.HashedPassword = hashedPassword;
                request.DateModified = dateModified;

                // Call the service insert method.
                _clientAuditClient.InsertClientAudit(request);

                return 1;
            }
            catch (System.ServiceModel.FaultException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Converts the ClientAudit ViewModel into a ClientAudit Model to be used with the service.
        /// </summary>
        /// <param name="clientAudit">ViewModel to convert.</param>
        /// <returns>ClientAuditReturns null if parameter is null. Otherwise, returns Model to be used with the service.</returns>
        public static SP.ClientAuditSvc.ClientAudit ToModel(this VM.ClientAuditViewModel clientAudit)
        {
            if (null == clientAudit) { return null; }

            SP.ClientAuditSvc.ClientAudit result = new SP.ClientAuditSvc.ClientAudit()
            {
                ClientAuditGuid = clientAudit.ClientAuditGuid,
                ClientGuid = clientAudit.ClientGuid,
                ClientID = clientAudit.ClientID,
                ClientName = clientAudit.ClientName,
                PhoneNumber = clientAudit.PhoneNumber,
                Email = clientAudit.Email,
                Address = clientAudit.Address,
                CityStateZipGuid = clientAudit.CityStateZipGuid,
                PaymentInfoGuid = clientAudit.PaymentInfoGuid,
                FederatedID = clientAudit.FederatedID,
                FederatedKey = clientAudit.FederatedKey,
                FederatedIDProvider = clientAudit.FederatedIDProvider,
                Username = clientAudit.Username,
                HashedPassword = clientAudit.HashedPassword,
                DateModified = clientAudit.DateModified,
            };

            return result;
        }