Beispiel #1
0
        public virtual void UpdateReference(CallsEvents entity)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateReference");

            cmd.SetParameterValue(entity);
            cmd.ExecuteNonQuery();
        }
Beispiel #2
0
        /// <summary>
        /// 创建顾客来电
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public virtual void Create(CallsEvents entity)
        {
            using (TransactionScope scope = new TransactionScope())
            {
                ObjectFactory <ICallsEventsDA> .Instance.CreateEvents(entity);

                //跟进日志
                foreach (var item in entity.LogList)
                {
                    item.CallsEventsSysNo = entity.SysNo;
                    ObjectFactory <ICallsEventsDA> .Instance.CreateFollowUpLog(item);
                }
                //根据状态做相应的更新
                entity = ObjectFactory <CallsEventsProcessor> .Instance.Load(entity.SysNo.Value);

                if (entity.Status == CallsEventsStatus.Replied)
                {
                    entity.LastEditDate = null;
                    entity.CloseDate    = null;
                    ObjectFactory <ICallsEventsDA> .Instance.UpdateEvents(entity);
                }
                else if (entity.Status == CallsEventsStatus.Abandoned)
                {
                    entity.LastEditDate = DateTime.Now;
                    entity.CloseDate    = null;
                }
                else
                {
                    this.CloseCallsEvents(entity);
                }
                scope.Complete();
            }
        }
Beispiel #3
0
        public virtual void CloseCallsEvents(CallsEvents entity)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("CloseCallsEvents");

            cmd.SetParameterValue(entity);
            cmd.ExecuteNonQuery();
        }
Beispiel #4
0
        public virtual void CreateCallsEventsFollowUpLog(CallsEventsFollowUpLog request)
        {
            //保存来电事件和跟进日志的状态一致
            CallsEvents entity = ObjectFactory <CallsEventsProcessor> .Instance.Load(request.CallsEventsSysNo.Value);

            using (TransactionScope scope = new TransactionScope())
            {
                if (request.Status == CallsEventsStatus.Replied)
                {
                    entity.LastEditDate = DateTime.Now;
                    entity.CloseDate    = null;
                    entity.Status       = CallsEventsStatus.Replied;
                    ObjectFactory <ICallsEventsDA> .Instance.UpdateEvents(entity);
                }
                else if (request.Status == CallsEventsStatus.Abandoned)
                {
                    entity.LastEditDate = DateTime.Now;
                    entity.CloseDate    = null;
                    entity.Status       = CallsEventsStatus.Abandoned;
                    ObjectFactory <ICallsEventsDA> .Instance.UpdateEvents(entity);
                }
                else
                {
                    entity.Status = CallsEventsStatus.Handled;
                    this.CloseCallsEvents(entity);
                }
                ObjectFactory <ICallsEventsDA> .Instance.CreateFollowUpLog(request);

                scope.Complete();
            }
        }
Beispiel #5
0
        public virtual CallsEvents CreateEvents(CallsEvents entity)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("InsertCustomerCallsEvents");

            cmd.SetParameterValue(entity);
            cmd.ExecuteNonQuery();
            entity.SysNo = Convert.ToInt32(cmd.GetParameterValue("@SysNo"));
            return(entity);
        }
Beispiel #6
0
 private void ButtonSave_Click(object sender, RoutedEventArgs e)
 {
     ButtonSave.IsEnabled = false;
     ValidationManager.Validate(this.newGrid);
     if (viewModel.NewCallingLog.HasValidationErrors)
     {
         ButtonSave.IsEnabled = true;
         return;
     }
     if (string.IsNullOrEmpty(viewModel.CustomerID) && string.IsNullOrEmpty(viewModel.Phone))
     {
         CPApplication.Current.CurrentPage.Context.Window.Alert(ResCustomerCallingMaintain.msg_VaildateCustomer);
         ButtonSave.IsEnabled = true;
         return;
     }
     if (viewModel.SysNo == null || viewModel.SysNo <= 0)
     {
         CallsEvents callingEntity = viewModel.ConvertVM <CustomerCalingMaintainVM, CallsEvents>();
         callingEntity.LogList = new List <CallsEventsFollowUpLog>();
         callingEntity.LogList.Add(viewModel.NewCallingLog.ConvertVM <CallingLogVM, CallsEventsFollowUpLog>());
         callingEntity.Status = callingEntity.LogList[0].Status;
         new CustomerCallingFacade(CPApplication.Current.CurrentPage).CreateCallsEvents(callingEntity, (obj, args) =>
         {
             if (args.FaultsHandle())
             {
                 ButtonSave.IsEnabled = true;
                 return;
             }
             ButtonSave.IsEnabled    = callingEntity.Status != CallsEventsStatus.Handled;
             viewModel.NewCallingLog = new CallingLogVM();
             CPApplication.Current.CurrentPage.Context.Window.Alert(ResCustomerCallingMaintain.msg_OperateSuccess);
             Dialog.ResultArgs.DialogResult = DialogResultType.OK;
             Dialog.Close();
         });
     }
     else
     {
         CallsEventsFollowUpLog entity = new CallsEventsFollowUpLog();
         entity = viewModel.NewCallingLog.ConvertVM <CallingLogVM, CallsEventsFollowUpLog>();
         entity.CallsEventsSysNo = viewModel.SysNo;
         new CustomerCallingFacade(CPApplication.Current.CurrentPage).CreateCallsEventsFollowUpLog(entity, (obj, args) =>
         {
             if (args.FaultsHandle())
             {
                 ButtonSave.IsEnabled = true;
                 return;
             }
             ButtonSave.IsEnabled    = entity.Status != CallsEventsStatus.Handled;
             viewModel.NewCallingLog = new CallingLogVM();
             dataGridLogList.Bind();
             needRefulshList = true;
         });
     }
 }
Beispiel #7
0
        /// <summary>
        /// 转换RMA
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public virtual void TransRMA(int callingSysNO, InternalMemoInfo request)
        {
            CallsEvents entity = ObjectFactory <CallsEventsProcessor> .Instance.Load(callingSysNO);

            entity.ReferenceType = CallingReferenceType.RMA;
            using (TransactionScope scope = new TransactionScope())
            {
                entity.ReferenceSysNo = ExternalDomainBroker.CreateRMATracking(request).SysNo;
                ObjectFactory <CallsEventsProcessor> .Instance.UpdateReference(entity);

                ObjectFactory <CallsEventsProcessor> .Instance.CloseCallsEvents(entity);

                scope.Complete();
            }
        }
Beispiel #8
0
        /// <summary>
        /// 转换投诉
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public virtual void TransComplaint(int callingSysNO, SOComplaintCotentInfo complaintInfo)
        {
            CallsEvents entity = ObjectFactory <CallsEventsProcessor> .Instance.Load(callingSysNO);

            entity.ReferenceType = CallingReferenceType.Complain;
            using (TransactionScope scope = new TransactionScope())
            {
                complaintInfo.CompanyCode = entity.CompanyCode;
                entity.ReferenceSysNo     = ExternalDomainBroker.AddComplain(complaintInfo).SysNo;
                ObjectFactory <CallsEventsProcessor> .Instance.UpdateReference(entity);

                ObjectFactory <CallsEventsProcessor> .Instance.CloseCallsEvents(entity);

                scope.Complete();
            }
        }
Beispiel #9
0
        public virtual void CloseCallsEvents(CallsEvents entity)
        {
            int             usedHours    = 0;
            List <DateTime> holidays     = ExternalDomainBroker.GetHoliday(AppSettingManager.GetSetting("Customer", "CSHoliday"), entity.CompanyCode);
            int             holidayHours = holidays.Where(p => p > entity.CreateDate.Value && p < DateTime.Now).Count() * 24;

            usedHours = (DateTime.Now - entity.CreateDate.Value).Hours - holidayHours;
            if (usedHours < 0)
            {
                usedHours = 0;
            }
            entity.Status       = CallsEventsStatus.Handled;
            entity.CloseDate    = DateTime.Now;
            entity.LastEditDate = DateTime.Now;
            entity.UsedHours    = usedHours;
            ObjectFactory <ICallsEventsDA> .Instance.UpdateEvents(entity);
        }
Beispiel #10
0
        public void CreateCallsEvents(CallsEvents request, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            string relativeUrl = "/CustomerService/CallsEvents/Create";

            restClient.Create(relativeUrl, request, callback);
        }
Beispiel #11
0
 public virtual void Create(CallsEvents entity)
 {
     ObjectFactory <CallsEventsProcessor> .Instance.Create(entity);
 }
Beispiel #12
0
 public virtual void CloseComplain(CallsEvents entity)
 {
     throw new NotImplementedException();
 }
Beispiel #13
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="entity"></param>
 public virtual void UpdateReference(CallsEvents entity)
 {
     ObjectFactory <ICallsEventsDA> .Instance.UpdateReference(entity);
 }
Beispiel #14
0
        public virtual void CloseCallsEvents(CallingReferenceType ReferenceType, int ReferenceSysNo, string note)
        {
            CallsEvents entity = ObjectFactory <ICallsEventsDA> .Instance.Load(ReferenceType, ReferenceSysNo);

            this.CloseCallsEvents(entity);
        }
Beispiel #15
0
 /// <summary>
 /// 关闭投诉
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public virtual void CloseComplain(CallsEvents entity)
 {
     ObjectFactory <ICallsEventsDA> .Instance.CloseComplain(entity);
 }
Beispiel #16
0
 public void CreateCallsEvents(CallsEvents request)
 {
     ObjectFactory <CallsEventsAppService> .Instance.Create(request);
 }