示例#1
0
 public static void RepairCall(CallHistoryInfo info)
 {
     if (info.MobilePhone.StartsWith("0")) info.MobilePhone = info.MobilePhone.Substring(1);
     DataProvider.Instance().CallHistories_RepairCall(info.CallHistoryId, info.MobilePhone, info.MessageCode, info.AgentCode, info.StationId, info.ResponseTime, info.CallId, info.StartTime, info.EndTime, info.Duration, info.RingTime, info.LinkRecord, info.Status, info.ErrorCode, info.ErrorDesc);
 }
示例#2
0
        public CallHistoryInfo Call(int id, string mobile)
        {
            if (string.IsNullOrEmpty(mobile)) return null;
            var user = UserRepository.GetCurrentUserInfo();

            // Logs
            var log = new TmpLogServiceInfo
            {
                Time = DateTime.Now,
                Description = mobile,
                CallType = (int)CallType.Incoming,
            };

            try
            {
                var item = HelpUtils.Call(mobile, user.StationId, user.UserName, StoreData.CallCenterSoapBinding);
                var entity = new CallHistoryInfo
                {
                    ContactId = id,
                    StatusMapId = 0,
                    StatusUpdate = 1,
                    StatusCareId = 0,
                    CallHistoryId = 0,
                    RecallTime = null,
                    CallTimeLength = 0,
                    Status = item.status,
                    CallId = item.call_id,
                    CreatedBy = user.UserID,
                    CallTime = DateTime.Now,
                    RingTime = item.ringtime,
                    Duration = item.duration,
                    CreatedDate = DateTime.Now,
                    AgentCode = item.agent_code,
                    ErrorCode = item.error_code,
                    ErrorDesc = item.error_desc,
                    StationId = item.station_id,
                    CallCenterInfo = string.Empty,
                    MessageCode = item.message_code,
                    MobilePhone = item.mobile_phone,
                    LinkRecord = item.link_down_record,
                    EndTime = item.end_time.ToDateTime("yyyyMMddHHmmss"),
                    StartTime = item.start_time.ToDateTime("yyyyMMddHHmmss"),
                    ResponseTime = item.datetime_response.ToDateTime("yyyyMMddHHmmss"),
                };
                entity.CallHistoryId = CallHistoryRepository.Create(entity);

                // Logs
                log.Status = 0;
                TmpLogServiceRepository.Create(log);

                // Return
                return entity;
            }
            catch (Exception ex)
            {
                // Logs
                log.Status = 0;
                log.Description = ex.ToString();
                TmpLogServiceRepository.Create(log);

                // Return
                return null;
            }
        }
示例#3
0
 public static int Create(CallHistoryInfo info)
 {
     if (info.MobilePhone.StartsWith("0")) info.MobilePhone = info.MobilePhone.Substring(1);
     return DataProvider.Instance().CallHistories_Insert(info.ContactId, info.StatusCareId, info.StatusMapId, info.CallTime, info.CallTimeLength, info.CallCenterInfo, info.RecallTime, info.CreatedBy, info.CreatedDate, info.MessageCode, info.AgentCode, info.StationId, info.MobilePhone, info.ResponseTime, info.CallId, info.StartTime, info.EndTime, info.Duration, info.RingTime, info.LinkRecord, info.Status, info.ErrorCode, info.ErrorDesc, info.LevelId, info.StatusUpdate, info.CallType, info.UserLogType);
 }