public virtual CustomerAction InsertCustomerActionModel(CustomerActionModel model) { var customeraction = model.ToEntity(); _customerActionService.InsertCustomerAction(customeraction); _customerActivityService.InsertActivity("AddNewCustomerAction", customeraction.Id, _localizationService.GetResource("ActivityLog.AddNewCustomerAction"), customeraction.Name); return(customeraction); }
public virtual async Task <CustomerAction> InsertCustomerActionModel(CustomerActionModel model) { var customeraction = model.ToEntity(_dateTimeHelper); await _customerActionService.InsertCustomerAction(customeraction); await _customerActivityService.InsertActivity("AddNewCustomerAction", customeraction.Id, _localizationService.GetResource("ActivityLog.AddNewCustomerAction"), customeraction.Name); return(customeraction); }
public virtual CustomerAction UpdateCustomerActionModel(CustomerAction customeraction, CustomerActionModel model) { if (customeraction.Conditions.Count() > 0) { model.ActionTypeId = customeraction.ActionTypeId; } if (String.IsNullOrEmpty(model.ActionTypeId)) { model.ActionTypeId = customeraction.ActionTypeId; } customeraction = model.ToEntity(customeraction); _customerActionService.UpdateCustomerAction(customeraction); _customerActivityService.InsertActivity("EditCustomerAction", customeraction.Id, _localizationService.GetResource("ActivityLog.EditCustomerAction"), customeraction.Name); return(customeraction); }
public virtual async Task <CustomerAction> UpdateCustomerActionModel(CustomerAction customeraction, CustomerActionModel model) { if (customeraction.Conditions.Count() > 0) { model.ActionTypeId = customeraction.ActionTypeId; } if (String.IsNullOrEmpty(model.ActionTypeId)) { model.ActionTypeId = customeraction.ActionTypeId; } customeraction = model.ToEntity(customeraction, _dateTimeService); await _customerActionService.UpdateCustomerAction(customeraction); await _customerActivityService.InsertActivity("EditCustomerAction", customeraction.Id, _translationService.GetResource("ActivityLog.EditCustomerAction"), customeraction.Name); return(customeraction); }