/// <summary> /// /// </summary> private void SetRpsNumber() { var rpsNumber = RequestNextRpsNumber(); var numberNodes = Rps.Descendants(FDefaultNamespace + "Numero"); if (numberNodes.Count() == 0) { TLog.Write("Xml tag 'numero' not found at Smart RPS - xml: " + Rps.ToString(SaveOptions.DisableFormatting)); throw new ApplicationException("O xml do Smart com o RPS para fazer a conversão para nota fiscal está inválido. Tag 'numero' não encontrada."); } var numberNode = numberNodes.First(); numberNode.SetValue(rpsNumber); }
/// <summary> /// /// </summary> private void SetName() { var name = String.Empty; try { switch (Place) { case "SJC": name = Rps.Descendants(FDefaultNamespace + "Tomador").Descendants(FDefaultNamespace + "Nome").First().Value; break; default: name = String.Empty; break; } } catch {} Name = name; }
/// <summary> /// /// </summary> private void SetID() { var id = String.Empty; try { switch (Place) { case "SJC": id = Rps.Descendants(FDefaultNamespace + "NumeroLoteSJC").First().Value; Rps.Descendants(FDefaultNamespace + "NumeroLoteSJC").Remove(); break; default: id = String.Empty; break; } } catch { } ID = id; }
/// <summary> /// /// </summary> private void SetPlace() { Place = Rps.Descendants(FDefaultNamespace + "NumeroLoteSJC").Count() > 0 ? "SJC" : String.Empty; }