public T Execute <T>(CMDDatabaseContext context) where T : class { var cmdContact = new CMDContact() { Id = Convert.ToInt32(_id), Address1 = _address1.RemoveQuotes(), Address2 = _address2.RemoveQuotes(), City = _city.RemoveQuotes(), CMDStateID = _cmdStateId, ZipCode = _zipCode.RemoveQuotes(), PrivateEmail = _privateEmail.RemoveQuotes(), PublicEmail = _publicEmail.RemoveQuotes(), Phone = _phone.RemoveQuotes(), Fax = _fax.RemoveQuotes(), Cell = _cell.RemoveQuotes(), ContactName = _contactName.RemoveQuotes(), IsDefault = _isDefault, WebsiteURL = _websiteURL.RemoveQuotes(), UpdatedDate = _updatedDate, CreatedDate = _createdDate, IsActive = _isActive, Title = _title.RemoveQuotes(), UpdatedBy = _updatedBy.RemoveQuotes(), StreetNumber = _StreetNumber }; return(context.Create(cmdContact, false) as T); }
public T Execute <T>(CMDDatabaseContext context) where T : class { context.ValidateApplicationToken(_applicationToken); try { context.ValidateAuthorityApplicationToken(_authorityApplicationToken); } catch (Exception) { var message = string.Format("Legacy call to create a UserToken without an authority was used.{0}Application: {1}{0}User: {2}", Environment.NewLine, _applicationToken, _userId); DAL.LogException(new Exception(message), LogCategory.Runnable); } var token = HashingService.GenerateToken(); var userToken = new UserToken { UserId = _userId, Token = token, }; userToken.EndDate = userToken.StartDate.AddDays(_validDays); return(context.Create(userToken, false) as T); }
public T Execute <T>(CMDDatabaseContext context) where T : class { var cmdCustomer = new CMDCustomer { FirstName = _firstName.RemoveQuotes(), MiddleName = _middleName.RemoveQuotes(), LastName = _lastName.RemoveQuotes(), DOB = ALPHAEON.CMD.Common.CommonUtility.GetDate(_dateOfBirth), DefaultLanguage = _defaultLanguage.RemoveQuotes(), CMDCustomerTypeID = Convert.ToInt32(_cmdCustomerTypeID), Email = _email.RemoveQuotes(), Phone = _phone, Gender = _gender.RemoveQuotes(), IsActive = true, IsDuplicate = _isDuplicate, NPI = _nPI.RemoveQuotes(), OriginalBusinessUnitID = _businessUnit, CreatedDate = DateTime.UtcNow, UpdatedBy = ALPHAEON.CMD.Common.Constants.Configuration.UpdatedBy.RemoveQuotes(), UpdatedDate = DateTime.UtcNow, Status = _status }; return(context.Create(cmdCustomer, false) as T); }
private User CreateBrandNewUser(CMDDatabaseContext context) { var newUser = new User { FirstName = _firstname, LastName = _lastname, DateOfBirth = _dateOfBirth, Email = "", }; if (!String.IsNullOrWhiteSpace(_email) && !context.Users.Any(u => String.Compare(u.Email, _email) == 0)) { newUser.Email = _email; } var newlyCreatedUser = context.Create <User>(newUser, false); try { var passwordGenerator = new CreateDefaultIntegrationPasswordRunnable(newlyCreatedUser); passwordGenerator.Execute(context); } catch (Exception ex) { DAL.LogException(ex, LogCategory.Runnable); } return(newlyCreatedUser); }
public T Execute <T>(CMDDatabaseContext context) where T : class { var user = new User { FirstName = _firstName, LastName = _lastName, Email = _email, }; return(context.Create(user, false) as T); }
public T Execute <T>(CMDDatabaseContext context) where T : class { var auditLog = new CMDAuditLog { Message = _message, ApplicationName = _applicationName, ComponentName = _componentName, AuditLogDate = _auditLogDate }; return(context.Create(auditLog, false) as T); }
public T Execute <T>(CMDDatabaseContext context) where T : class { var exceptionLog = new CMDExceptionLog { CMDAuditLogId = _auditLogId, ExceptionLogDate = _exceptionLogDate, InnerException = _innerException, Message = _message, StackTrace = _stackTrace }; return(context.Create(exceptionLog, false) as T); }
public T Execute <T>(CMDDatabaseContext context) where T : class { var cmdCustomer = new CMDCustomerDuplicateMap { DuplicateCustomerID = _duplicateCustomerID, ExistingCustomerID = _existingCustomerID, CreatedDate = DateTime.UtcNow, UpdatedBy = ALPHAEON.CMD.Common.Constants.Configuration.UpdatedBy, UpdatedDate = DateTime.UtcNow }; return(context.Create(cmdCustomer, false) as T); }
public T Execute <T>(CMDDatabaseContext context) where T : class { var distributorLog = new CMDDistributor { Name = _name.RemoveQuotes(), CMDContactID = _cmdContactID, Description = _description.RemoveQuotes(), CreatedDate = _createdDate, UpdatedDate = _updatedDate, IsActive = _isActive, UpdatedBy = _updatedBy.RemoveQuotes() }; return(context.Create(distributorLog, false) as T); }
public T Execute <T>(CMDDatabaseContext context) where T : class { var practice = new CMDPractice { PracticeName = _practiceName, PrimaryOwnerID = _primaryOwnerID, CMDLegalJurisdictionID = _cmdLegalJurisdictionID, OriginalBusinessUnitID = _originalBusinessUnitID, IsActive = _isActive, Email = _email, Phone = _phone, IsDuplicate = _isDuplicate, UpdatedDate = _updatedDate, CreatedDate = _createdDate, UpdatedBy = _updatedBy }; return(context.Create(practice, false) as T); }
public T Execute <T>(CMDDatabaseContext context) where T : class { var practiceAndAccount = new CMDAccount { Name = _name, CMDPracticeID = _cmdPracticeID, FedTaxID = _fexTaxID, CMDAccountTypeID = Convert.ToInt32(_cmdAccountTypeID), NetSuiteID = _netSuiteID, OriginalBusinessUnitID = _originalBusinessUnitID, OriginalDistributorID = _originalDistributorID, IsActive = _isActive, UpdatedDate = _updatedDate, CreatedDate = _createdDate, UpdatedBy = _updatedBy, CMDBusinessUnitId = _CMDBusinessUnitID }; return(context.Create(practiceAndAccount, false) as T); }
public T Execute <T>(CMDDatabaseContext context) where T : class { var transactionLog = new CMDTransaction { CMDUserID = _cmdUserID, TxDate = CommonUtility.GetDate(_txDate), CMDTransactionTypeID = _cmdTxTypeID, Note = _note, TxCompletedDate = CommonUtility.GetDate(_txCompletedDate), CMDAccountID = _cmdAccountID, City = _city, CMDStateID = _cmdStateID, CreatedDate = _createdDate, UpdatedDate = _updatedDate, IsActive = _isActive, UpdatedBy = _updatedBy, Amount = _amount, AmountAfterDiscount = _amountAfterDiscount, CurrencyType = _currencyType }; return(context.Create(transactionLog, false) as T); }