Beispiel #1
0
        public void SaveLog()
        {
            if (this.CallLogDetail == null)
            {
                this.CallLogDetail = new CallLogDetail()
                {
                    CallLogId = CallLogId,
                    StartTime = this.Call.StartTime,
                    ChannelId = this.Call.Channel.Id
                };

                if (this.Call.Unit != null)
                {
                    this.CallLogDetail.PhoneNumber = this.Call.Unit.GetFullNumber();
                    this.CallLogDetail.UnitId      = this.Call.Unit.Id;
                }
                else
                {
                    this.CallLogDetail.PhoneNumber = this.Call.Channel.Tone;
                }
            }

            this.CallLogDetail.UnitId = this.Call.Unit?.Id;

            if (this.Call.FinalisedDate.HasValue)
            {
                this.CallLogDetail.EndTime = this.Call.FinalisedDate.Value;
            }

            this.Call.ClientApp.Service.SaveCallLogDetail(this.CallLogDetail);
        }
        protected virtual void CreateCallLog()
        {
            this.CallLog = new CallLog()
            {
                CallType  = eCallType.InComming,
                POId      = this.ClientApp.Channels.PO.Id,
                StartTime = this.StartTime
            };

            this.CallLogDetail = new CallLogDetail()
            {
                CallLogId   = this.CallLog.CallLogId,
                StartTime   = this.StartTime,
                ChannelId   = this.Channel.Id,
                PhoneNumber = this.Channel.CallerId ?? string.Empty
            };

            if (this.Unit != null)
            {
                this.CallLogDetail.UnitId   = this.Unit.Id;
                this.CallLogDetail.UnitName = this.Unit.Name;
            }

            if (this.AutoRecording)
            {
                this.CallLogDetail.Record = this.ClientApp.Service.StartRecord((byte)this.Channel.Id, (byte)(this.ClientApp.Channels.PO.Id - 1));
                OnPropertyChanged("IsRecording");
            }
        }
Beispiel #3
0
        protected override void SaveLog()
        {
            if (GetParentCallLog() == null)
            {
                return;
            }

            if (this.CallLogDetail == null)
            {
                this.CallLogDetail = new CallLogDetail()
                {
                    CallLogId = GetParentCallLog().CallLogId,
                    StartTime = this.StartTime,
                    ChannelId = this.Channel.Id
                };

                if (this.Unit != null)
                {
                    this.CallLogDetail.PhoneNumber = this.Unit.GetFullNumber();
                    this.CallLogDetail.UnitId      = this.Unit.Id;
                    this.CallLogDetail.UnitName    = this.Unit.Name;
                }
                else
                {
                    this.CallLogDetail.PhoneNumber = this.Channel.Tone;
                }

                if (this.AutoRecording)
                {
                    lock (_syncObj)
                    {
                        this.CallLogDetail.Record = this.ClientApp.Service.StartRecord((byte)this.Channel.Id, (byte)(this.ClientApp.Channels.PO.Id - 1));
                        OnPropertyChanged("IsRecording");
                    }
                }
            }

            if (this.Unit != null)
            {
                this.CallLogDetail.UnitId   = this.Unit.Id;
                this.CallLogDetail.UnitName = this.Unit.Name;
            }

            if (this.FinalisedDate.HasValue)
            {
                this.CallLogDetail.EndTime = this.FinalisedDate.Value;
                if (!string.IsNullOrEmpty(this.CallLogDetail.Record) && this.DisconnectPOConnectionWhenFinalise)
                {
                    this.ClientApp.Service.StopRecord((byte)this.Channel.Id);
                }
            }

            this.ClientApp.Service.SaveCallLogDetail(this.CallLogDetail);
        }
Beispiel #4
0
        public void SaveCallLogDetail(CallLogDetail en)
        {
            lock (syncRoot)
            {
                using (var ctx = new NovaAlertContext())
                {
                    var cl = ctx.CallLogDetailDbs.Where(c => c.CallLogDetailId == en.CallLogDetailId).FirstOrDefault();
                    if (cl == null)
                    {
                        cl = new CallLogDetailDb();
                        ctx.CallLogDetailDbs.Add(cl);
                    }

                    Mapper.Map <CallLogDetail, CallLogDetailDb>(en, cl);
                    ctx.SaveChanges();
                }
            }
        }
Beispiel #5
0
 void INovaAlertService.SaveCallLogDetail(CallLogDetail en)
 {
     CallLogDal.Instance.SaveCallLogDetail(en);
 }