public void ExecuteSaveCallerAndSendSms() { // TODO: Here try to make a call to saving caller details and send SMS this.SetStatusbarMessage("Send SMS inprogress...", StatusMessageType.Info); this.ShowBusyCursor(true, "Sending SMS"); var rqManager = new CallerRequestCommitManager(); var callerRequestCommit = new CallerRequestCommit(); Task t = new Task(() => { callerRequestCommit.Caller = _callerDetailViewModel.CurrentCaller; callerRequestCommit.Caller.CanSendSMS = this._bPartnerSearcbViewModel.SendSmsToCaller.Value; callerRequestCommit.CallerRequest = new CallerRequestHistory(); callerRequestCommit.CallerRequest.CallDurationinSecs = 60; callerRequestCommit.CallerRequest.RequestedDetails = this._bPartnerSearcbViewModel.SearchCriteriaText; //TODO: Assume always get something, employee to be retrieved.. callerRequestCommit.CallerRequest.TeleCallerID = 1;//GetFirstTeleCaller().EmployeeID; callerRequestCommit.BusinessUnitsIdentifiedForCallerRequest = this._bPartnerSearcbViewModel.SelectedBusinessUnits; var ret = rqManager.Execute(callerRequestCommit); }); t.ContinueWith(_ => { SetStatusbarMessage("Saved successfully and SMS sending put into Queue...", StatusMessageType.Info); MessageBox.Show("Saved successfully and SMS sending put into Queue..."); ShowBusyCursor(false); }, TaskContinuationOptions.OnlyOnRanToCompletion); t.ContinueWith(_ => { SetStatusbarMessage("Failed to send SMS and saving...", StatusMessageType.Info); ShowBusyCursor(false); }, TaskContinuationOptions.OnlyOnFaulted); t.Start(); }
public void TestMethod1() { var x = new CallerRequestCommitManager(); CallerRequestCommit callerRequestCommit = new CallerRequestCommit(); callerRequestCommit.Caller = new Caller(); callerRequestCommit.Caller.PhoneNumber = "4254359889"; callerRequestCommit.Caller.FirstName = "Vital"; callerRequestCommit.Caller.LastName = "P"; callerRequestCommit.CallerRequest = new CallerRequestHistory(); callerRequestCommit.CallerRequest.CallDurationinSecs = 60; callerRequestCommit.CallerRequest.RequestedDetails = "KFC New York"; //TODO: Assume always get something callerRequestCommit.CallerRequest.TeleCallerID = GetFirstTeleCaller().EmployeeID; callerRequestCommit.BusinessUnitsIdentifiedForCallerRequest = GetTop5BU(); var ret =x.Execute(callerRequestCommit); Assert.IsNotNull(ret); }