Exemplo n.º 1
0
 public static int Create(ActivityObjectChangeInfo info)
 {
     return(DataProvider.Instance().ActivityObjectChanges_Insert(info.ActivityId, info.ObjectType, info.ObjectId, info.PropertyType, info.PropertyValueInt, info.PropertyValueString, info.PropertyValueDateTime, info.ChangedDate));
 }
Exemplo n.º 2
0
        private static void LogObjectChange(ContactInfo entity, ActivityLogInfo log, params LogPropertyType[] types)
        {
            foreach (var type in types)
            {
                var logObject = new ActivityObjectChangeInfo
                {
                    ActivityId   = log.Id,
                    ObjectId     = entity.Id,
                    PropertyType = (int)type,
                    ObjectType   = (int)LogObjectType.Contact,
                };
                switch (type)
                {
                case LogPropertyType.Contacts_User_Consultant:
                    logObject.PropertyValueInt = entity.UserConsultantId;
                    break;

                case LogPropertyType.Contacts_Type:
                    logObject.PropertyValueInt = entity.TypeId;
                    break;

                case LogPropertyType.Contacts_Level:
                    logObject.PropertyValueInt = entity.LevelId;
                    break;

                case LogPropertyType.Contacts_Channel:
                    logObject.PropertyValueInt = entity.ChannelId;
                    break;

                case LogPropertyType.Contacts_Branch:
                    logObject.PropertyValueInt = entity.BranchId;
                    break;

                case LogPropertyType.Contacts_Status:
                    logObject.PropertyValueInt = entity.StatusId;
                    break;

                case LogPropertyType.Contacts_AppointmentDate_Consultant:
                    logObject.PropertyValueDateTime = entity.AppointmentConsultantDate;
                    break;

                case LogPropertyType.Contacts_HandoverDate_Consultant:
                    logObject.PropertyValueDateTime = entity.HandoverConsultantDate;
                    break;

                case LogPropertyType.Contacts_CallDate_Consultant:
                    logObject.PropertyValueDateTime = entity.CallConsultantDate;
                    break;

                case LogPropertyType.Contacts_RecoveryDate_Consultant:
                    logObject.PropertyValueDateTime = entity.RecoveryConsultantDate;
                    break;

                case LogPropertyType.Contacts_StatusCare_Consultant:
                    logObject.PropertyValueInt = entity.StatusCareConsultantId;
                    break;

                case LogPropertyType.Contacts_StatusMap_Consultant:
                    logObject.PropertyValueInt = entity.StatusMapConsultantId;
                    break;
                }
                ActivityObjectChangeRepository.Create(logObject);
            }
        }