public RequestError completePhoneCall(Guid PhoneCallId, Guid ActionStatusId, Guid?DeclineReasonStatusId, DateTime?NextCallTime) { try { PhoneCallsServiceClient client = new PhoneCallsServiceClient(); client.ClientCredentials.UserName.UserName = Properties.Settings.Default.ActionUser.ToString(); client.ClientCredentials.UserName.Password = Properties.Settings.Default.ActionPassword.ToString(); RequestError result = client.CompletePhoneCall(PhoneCallId, ActionStatusId, DeclineReasonStatusId, NextCallTime); return(result); } catch (Exception e) { Log.add(String.Format("[ERR] Системная ошибка: {0} Stack: {1}", e.Message, e.StackTrace)); return(null); } }
public GetPhoneCallsData[] getPhoneCalls() { try { DateTime dt = Convert.ToDateTime("01.01.2016"); PhoneCallsServiceClient client = new PhoneCallsServiceClient(); client.ClientCredentials.UserName.UserName = Properties.Settings.Default.ActionUser.ToString(); client.ClientCredentials.UserName.Password = Properties.Settings.Default.ActionPassword.ToString(); return(client.GetPhoneCalls(dt)); } catch (Exception e) { Log.add(String.Format("[ERR] Системная ошибка: {0} Stack: {1}", e.Message, e.StackTrace)); return(null); } }
protected byte[] getActionStatuses() { string companyId = Properties.Settings.Default.ActionDefaultCompanyId; if (RequestArr != null && RequestArr.Length > 0) { foreach (string req_str in RequestArr) { string[] p = req_str.Split("=".ToCharArray()); if (p[0] == "company_id") { companyId = p[1].Replace("%20", " "); } } } try { System.Guid guid = System.Guid.Parse(companyId); } catch (Exception e) { string error = String.Format("<error>Exception: {0}</error>", e.Message); Log.add(String.Format("Ошибка: {0}", e.Message)); return(Encoding.UTF8.GetBytes(error)); } Log.add("Подключаетмя к Актиону"); PhoneCallsServiceClient client = new PhoneCallsServiceClient(); client.ClientCredentials.UserName.UserName = Properties.Settings.Default.ActionUser.ToString(); client.ClientCredentials.UserName.Password = Properties.Settings.Default.ActionPassword.ToString(); Log.add("Запрашиваем ActionStatusesData..."); ActionStatusesData[] statusesData = client.GetActionStatusesForCampaignId(System.Guid.Parse(companyId)); Log.add("ActionStatusesData получено"); string answer = ""; Log.add("Формируем xml файл ActionStatusesData"); ContentType = "xml"; // Create XML answer += "<actionStatuses>"; foreach (ActionStatusesData statusData in statusesData) { answer += "<actionStatus id=\"" + statusData.ActionStatusId + "\">" + "<actionStatusName>" + statusData.ActionStatusName + "</actionStatusName>" + "<typeActionStatus >" + statusData.TypeActionStatus + "</typeActionStatus >" + "<typeActionStatusName >" + statusData.TypeActionStatusName + "</typeActionStatusName >" + "<isSpecifyRefusalReason >" + statusData.IsSpecifyRefusalReason + "</isSpecifyRefusalReason >" + "<isFinal >" + statusData.IsFinal + "</isFinal >" + "<typeActionStatus >" + statusData.TypeActionStatus + "</typeActionStatus >" + "</actionStatus>"; } answer += "</actionStatuses>"; return(Encoding.UTF8.GetBytes(answer)); }