public void OnDealChanged([FromBody] EventResponse response) { try { Log.Debug("Изменение сделки"); Log.Debug(response.data.fields.ID); BitrixClient Bitrix = BitrixClient.Instance; AirTableClient AirTable = AirTableClient.Instance; var Deal = Bitrix.GetDeal(response.data.fields.ID); if (Deal.Deal.DATE_CREATE > new DateTime(2019, 7, 2, 13, 11, 0)) { if (Deal.Deal.IsValid) { AirTable.UpdateOrCreate(Deal); } } else { Log.Debug("Старая сделка"); } } catch (Exception ex) { Log.Debug($"{ex}\r\nВнутреннее исключение:{ex.InnerException}"); } }
public void TestGettingID() { BitrixClient Bitrix = BitrixClient.Instance; AirTableClient AirTable = AirTableClient.Instance; var d = Bitrix.GetDeal("1521"); string s = JsonConvert.SerializeObject(d); s = s.Replace("[75]", "false"); var dd = JsonConvert.DeserializeObject <DealResponse>(s); s = JsonConvert.SerializeObject(dd); AirTable.UpdateOrCreate(d); }