public ModelInvokeResult <CallCenterPK> Create(CallCenter callCenter) { ModelInvokeResult <CallCenterPK> result = new ModelInvokeResult <CallCenterPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); if (callCenter.StationId == GlobalManager.GuidAsAutoGenerate) { callCenter.StationId = Guid.NewGuid(); } statements.Add(new IBatisNetBatchStatement { StatementName = callCenter.GetCreateMethodName(), ParameterObject = callCenter.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new CallCenterPK { StationId = callCenter.StationId }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public void TriggerAlert(IncidentContext db, CallCenter callCenter) { Console.WriteLine($"[{DateTime.UtcNow}] 正在扫描未触发报警的故障记录..."); var nonAckedIncidents = db.Incidents .Include(x => x.Project) .Include(x => x.CallHistories) .Where(x => x.UserId == null) .ToList(); var slots = GetOnCallSlots(db); Parallel.ForEach(nonAckedIncidents, x => { if (x.CallHistories.LastOrDefault()?.CreatedTime.AddMinutes(3) >= DateTime.UtcNow) { return; } if (x.CallHistories.Where(y => !y.Ignore).Count() > 0 && x.Severity > 2) { return; } if (x.CallHistories.Where(y => !y.Ignore).Count() > 0 && !callCenter.IsMessageSendOutAsync(x.CallHistories.Last().CallCenterId.Value).Result) { return; } var callHistory = GenerateCall(slots.Where(y => y.ProjectId == x.ProjectId), x); var phone = slots.First(y => y.UserId == callHistory.UserId).User.PhoneNumber; callHistory.Type = x.Severity <= 2 ? "Voice" : "Sms"; callHistory.CallCenterId = callCenter.TriggerAlertAsync($"您好,这里是柚子故障监测平台,在{x.Project.Name}中发生了严重程度为{x.Severity}的{x.Title}故障,故障编号{x.Id},请您及时查看,谢谢。", callHistory.Type, phone).Result; db.CallHistories.Add(callHistory); }); db.SaveChanges(); }
PackageCreationAndAddingBenifitSteps() { driverIE = ObjectRepository.Driver; callCenterSearch = new CallCenterEnquirySearch(driverIE); callCenter = new CallCenter(driverIE); employeeDetails = new EmployeeDetails(driverIE); processsMenuPage = new ProcessMenuPage(driverIE); packageAdminDetails = new PackageAdminDetails(driverIE); payRoll = new PayRollDetails(driverIE); adminFees = new AdminFeesPage(driverIE); editpackage = new EditPackage(driverIE); packAdminDetailEdit = new PackageAdminDetailsEdit(driverIE); payRollDetailEdit = new PayRollDetailsEdit(driverIE); benefitPage = new BenefitPage(driverIE); benefitDetails = new BenefitDetails(driverIE); activatePackage = new ReviewAndActiveatePage(driverIE); cardScreen = new CardScreen(driverIE); batchProcessTest = new BatchProcessTest(); amendments = new AmendmentsScreen(driverIE); }
public void ObtenerConversaciones_TotalConErrorFormato() { //Arange List <string> texto = new List <string>(); texto.Add("CONVERSACIONES 1"); texto.Add("11:51:00 CLIENTE1: Hola"); texto.Add("11:51:05 ASESOR1: Hola CLIENTE1, bienvenido al centro de servicio."); texto.Add(""); texto.Add("CONVERSACION 2"); texto.Add("11:55:00 CLIENTE2: Hola"); texto.Add(""); List <IReglaConversacion> reglasDeNegocio = new List <IReglaConversacion>() { new CalcularConversacionAbandonada(), new CalcularBuenServicio(), new CalcularCoincidenciasPalabraUrgente(), new CalcularNumeroMensajes() }; CallCenter _callCenterDominio = new CallCenter(reglasDeNegocio); //Act List <Conversacion> conversaciones = _callCenterDominio.Ejecutar(texto); //Asert Assert.AreEqual(1, conversaciones.Count); }
public AgentsAPIEventHandler(CallCenter callCenter) { CallCenter = callCenter; Dispatcher.CallCenter = callCenter; CallCenter.RegisterAgentStatusObserver(this); CallCenter.RegisterPhoneCallObserver(this); }
PaymentInstructionsCreationSteps() { driverIE = ObjectRepository.Driver; callCenterSearch = new CallCenterEnquirySearch(driverIE); callCenter = new CallCenter(driverIE); BenefitProcessMenu = new BenefitProcessMenu(driverIE); paymentInstruction = new PaymentInstructionPage(driverIE); }
private void CreateCallCenters(CallsContext context) { callCentersId = new Dictionary <int, CallCenter>(8); for (var i = 1; i < 9; i++) { callCentersId[i] = new CallCenter(i); } context.CallCenters.AddRange(callCentersId.Values); }
public void CanAddAttendant() { var callCenter = new CallCenter("localhost", RedisSetUp.Port); callCenter.Flush(); callCenter.AddAttendant("Bob", new [] { "English", "French" }, new [] { "Plumbing", "Fishing" }); callCenter.GetAttendants().Should().Contain("Bob"); }
public ActionResult Calculate(CallCenter model) { if (ModelState.IsValid) { model.SaveOrder(model); model.GetBouqets(); } return(View("Index", model)); }
public void MarkingAvailableAttendantAvailableHasNoEffect() { var callCenter = new CallCenter("localhost", RedisSetUp.Port); callCenter.Flush(); callCenter.AddAttendant("Bob", new[] { "English", "French" }, new[] { "Plumbing", "Fishing" }); callCenter.SetAttendantAvailable("Bob").Should().BeFalse(); callCenter.GetBusyAttendants().Should().BeEmpty(); }
public AppointmentCall(Client client, Manager manager, CallCenter callCenter, DateTime startCallTime, DateTime endCallTime) { Client = client; Manager = manager; CallCenter = callCenter; StartCallTime = startCallTime; EndCallTime = endCallTime; }
static void ex72() { CallCenter cc = new CallCenter(); cc.AddEmployee("d1", CallCenter.EmployeeType.Director, null); cc.AddEmployee("d2", CallCenter.EmployeeType.Director, "d1"); cc.AddEmployee("m1", CallCenter.EmployeeType.Manager, "d1"); cc.AddEmployee("m2", CallCenter.EmployeeType.Manager, "d2"); cc.AddEmployee("r1", CallCenter.EmployeeType.Respondent, "m1"); cc.AddEmployee("r2", CallCenter.EmployeeType.Respondent, "m2"); cc.AddEmployee("r3", CallCenter.EmployeeType.Respondent, "m3"); cc.DispatchCall(); }
public void RemovedAttendantsCannotBeSelected() { var callCenter = new CallCenter("localhost", RedisSetUp.Port); callCenter.Flush(); callCenter.AddAttendant("Bob", new[] { "English", "French" }, new[] { "Plumbing", "Fishing" }); callCenter.RemoveAttendant("Bob"); var chosen = callCenter.AssignAttendant(new[] { "French" }, new[] { "Fishing" }); chosen.Should().BeNull(); }
EmployeeProfileCreationSteps() { driverIE = ObjectRepository.Driver; personalDetails = new PersonalDetails(driverIE); addressDetails = new AddressDetails(driverIE); reimbursementDetails = new ReimbursementDetails(driverIE); thirdPartyAccess = new ThirdPartyAccess(driverIE); callCenterSearch = new CallCenterEnquirySearch(driverIE); callCenter = new CallCenter(driverIE); EAMSScreen = new EAMSscreen(driverIE); empProcessMenu = new EmployeeProcessMenu(driverIE); EAMSProfile = new EAMSscreen(driverIE); }
public void WhenNoSuitableAttendantNoneAssigned() { var callCenter = new CallCenter("localhost", RedisSetUp.Port); callCenter.Flush(); callCenter.AddAttendant("Bob", new[] { "English", "French" }, new[] { "Plumbing", "Fishing" }); var chosen = callCenter.AssignAttendant(new[] { "French" }, new[] { "Knitting" }); chosen.Should().BeNull(); callCenter.GetBusyAttendants().Should().BeEmpty(); }
public void CanAssignSuitableAttendant() { var callCenter = new CallCenter("localhost", RedisSetUp.Port); callCenter.Flush(); callCenter.AddAttendant("Bob", new[] { "English", "French" }, new[] { "Plumbing", "Fishing" }); var chosen = callCenter.AssignAttendant(new[] { "French" }, new[] { "Fishing" }); chosen.Should().Be("Bob"); callCenter.GetBusyAttendants().Should().Contain("Bob"); }
public void configTest() { Dictionary <string, string> dict = new Dictionary <string, string>(); dict.Add("CallCenterID", "1"); dict.Add("APIVersion", "2010-04-22"); dict.Add("APIUsername", "*****@*****.**"); dict.Add("APIPassword", "password"); CallCenter.config(dict); Assert.AreEqual(dict["CallCenterID"], CallCenter.CallCenterID); Assert.AreEqual(dict["APIVersion"], CallCenter.APIVersion); Assert.AreEqual(dict["APIUsername"], CallCenter.APIUsername); Assert.AreEqual(dict["APIPassword"], CallCenter.APIPassword); }
public void CanSetBusyAttendantAvailable() { var callCenter = new CallCenter("localhost", RedisSetUp.Port); callCenter.Flush(); callCenter.AddAttendant("Bob", new[] { "English", "French" }, new[] { "Plumbing", "Fishing" }); var busy = callCenter.AssignAttendant(new[] { "French" }, new[] { "Fishing" }); callCenter.SetAttendantAvailable(busy).Should().BeTrue(); callCenter.GetBusyAttendants().Should().BeEmpty(); }
public void CallCenter_Should_Throw_If_No_Repondents_To_Take_Call() { //arrange var callCenter = new CallCenter(); var call = new Call(EmployeeType.Respondent); //act Action act = () => callCenter.Simulate(call); //assert act.ShouldThrow <InvalidOperationException>(); call.IsTaken.ShouldBeEquivalentTo(false); }
public ModelInvokeResult <CallCenterPK> Update(string strStationId, CallCenter callCenter) { ModelInvokeResult <CallCenterPK> result = new ModelInvokeResult <CallCenterPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); Guid?_StationId = strStationId.ToGuid(); if (_StationId == null) { result.Success = false; result.ErrorCode = 59996; return(result); } callCenter.StationId = _StationId; callCenter.OperatedBy = NormalSession.UserId.ToGuid(); callCenter.OperatedOn = DateTime.Now; callCenter.DataSource = GlobalManager.DIKey_00012_ManualEdit; if (BuilderFactory.DefaultBulder().ExecuteNativeSqlForCount(string.Format("select * from {0} where StationId='{1}'", callCenter.GetMappingTableName(), strStationId)) == 1) { statements.Add(new IBatisNetBatchStatement { StatementName = callCenter.GetUpdateMethodName(), ParameterObject = callCenter.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); } else { statements.Add(new IBatisNetBatchStatement { StatementName = callCenter.GetCreateMethodName(), ParameterObject = callCenter.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT }); } /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new CallCenterPK { StationId = _StationId }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public List <Conversacion> CalcularCalificaciones(List <string> textoConversaciones) { List <IReglaConversacion> reglasDeNegocio = new List <IReglaConversacion>() { new CalcularConversacionAbandonada(), new CalcularBuenServicio(), new CalcularCoincidenciasPalabraUrgente(), new CalcularNumeroMensajes(), new CalcularDuracionLlamada() }; CallCenter _callCenterDominio = new CallCenter(reglasDeNegocio); return(_callCenterDominio.Ejecutar(textoConversaciones)); }
public void GetAPIurlTest() { Dictionary <string, string> dict = new Dictionary <string, string>(); dict.Add("CallCenterID", "1"); dict.Add("APIVersion", "2010-04-22"); dict.Add("APIUsername", "*****@*****.**"); dict.Add("APIPassword", "password"); CallCenter.config(dict); string expected = "http://api" + CallCenter.APInum.ToString() + ".invoca.com:80/api/2010-04-22/calls/1.xml"; // TODO: Initialize to an appropriate value string actual; actual = CallCenter.GetAPIurl(); Assert.AreEqual(expected, actual); }
public void CallCenter_Should_Check_Employee_Take_Call() { //arrange var callCenter = new CallCenter(); callCenter.Employees.Add(new Respondent(callCenter)); var call = new Call(EmployeeType.Respondent); //act var result = callCenter.Simulate(call); //assert result.ShouldBeEquivalentTo(true); call.IsTaken.ShouldBeEquivalentTo(true); }
public void CallCenter_Should_Throw_If_No_Director_To_Take_Call() { //arrange var callCenter = new CallCenter(); callCenter.Employees.Add(new Respondent(callCenter)); callCenter.Employees.Add(new Manager(callCenter)); var call = new Call(EmployeeType.Director); //act Action act = () => callCenter.Simulate(call); //assert act.ShouldThrow <InvalidOperationException>(); call.IsTaken.ShouldBeEquivalentTo(false); }
public void WhenOnlySuitableCandidatesAreBusyNoneIsSelected() { var callCenter = new CallCenter("localhost", RedisSetUp.Port); callCenter.Flush(); callCenter.AddAttendant("Bob", new[] { "English", "French" }, new[] { "Plumbing", "Fishing" }); var busy = callCenter.AssignAttendant(new[] { "French" }, new[] { "Fishing" }); var chosen = callCenter.AssignAttendant(new[] { "French" }, new[] { "Fishing" }); chosen.Should().BeNull(); callCenter.GetBusyAttendants().Should().Contain("Bob"); }
public void BusyAttendantsSetAvailableCanBeSelectedAgain() { var callCenter = new CallCenter("localhost", RedisSetUp.Port); callCenter.Flush(); callCenter.AddAttendant("Bob", new[] { "English", "French" }, new[] { "Plumbing", "Fishing" }); callCenter.AssignAttendant(new[] { "French" }, new[] { "Fishing" }); callCenter.SetAttendantAvailable("Bob"); var busy = callCenter.AssignAttendant(new[] { "French" }, new[] { "Fishing" }); busy.Should().Be("Bob"); callCenter.GetBusyAttendants().Should().Contain("Bob"); }
public Manager( int id, CallCenter callCenter, int qualification, float effiency, DateTime startWorkTime, DateTime endWorkTime, int salary) { Id = id; CallCenter = callCenter; Qualification = qualification; Effiency = effiency; StartWorkTime = startWorkTime; EndWorkTime = endWorkTime; Salary = salary; Calls = new Queue <AppointmentCall>(); }
public CashOnDelivery(Traffic traffic, LandingPage landingPage, SalesPage salesPage, UpSell upSell, CallCenter callCenter, Shipping shipping) : base(traffic, landingPage, salesPage, upSell) { (CallCenter, Shipping) = (callCenter, shipping); double actions = Traffic.Amount * LandingPage.CTR * CallCenter.CR; Costs = new Number { Name = "Total Costs", Total = Traffic.TotalCost + (actions * SalesPage.CR * SalesPage.Cost) + (actions * UpSell.CR * UpSell.Cost) + (actions * Shipping.Cost) + (Traffic.Amount * LandingPage.CTR * CallCenter.Cost) }; Profits = new Number { Name = "Total Profits", Total = ( (Traffic.Amount * LandingPage.CTR * CallCenter.CR * SalesPage.TotalProfitPerAction * SalesPage.TotalProfitPerAction) + (Traffic.Amount * LandingPage.CTR * CallCenter.CR * UpSell.TotalProfitPerAction * UpSell.TotalProfitPerAction) ) * Shipping.Deliverability }; Balance = new Number { Name = "Balance", Total = Profits.Total - Costs.Total }; }
public InvokeResult LogByFamilyMemberInner(ServiceTrackLog serviceTrackLog) { InvokeResult result = new InvokeResult { Success = true }; try { serviceTrackLog.Id = null; CallCenter callCenter = BuilderFactory.DefaultBulder().List <CallCenter>().FirstOrDefault(); if (callCenter != null) { serviceTrackLog.StationId = callCenter.StationId; } BuilderFactory.DefaultBulder().Create <ServiceTrackLog>(serviceTrackLog); } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public InvokeResult DeleteSelected(string strStationIds) { InvokeResult result = new InvokeResult { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); string[] arrStationIds = strStationIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (arrStationIds.Length == 0) { result.Success = false; result.ErrorCode = 59996; return(result); } string statementName = new CallCenter().GetDeleteMethodName(); foreach (string strStationId in arrStationIds) { CallCenterPK pk = new CallCenterPK { StationId = strStationId.ToGuid() }; DeleteCascade(statements, pk); statements.Add(new IBatisNetBatchStatement { StatementName = statementName, ParameterObject = pk, Type = SqlExecuteType.DELETE }); } BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
static void Main(string[] args) { Name ssa = new Name("Tomer", "Boiman"); var trs = ssa.GetFullName(); var ds = Simplified("4/6"); var ad = IsPalindronOrDescendent(97358817); string k = ReverseAndNot(123); Call cv = new Call(); myDel m = new myDel((int a) => { return(a + 100); }); cv.AddNum(m, 5); int a; SomeFunc(out a); var ee = IsPalindrom(10901); var hh = 98697697 % 10; var kl = 98697697 / 10; CallCenter v = new CallCenter(); var b = new Call(); int fr = b.AddNum(m, 1); Bfunc(b); // int a = 10; Afunc(ref a); List <int> myList = new List <int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; foreach (var item in func(2, 10)) { Console.WriteLine(item); } Console.ReadLine(); }