partial void DeleteVisaVale1(VisaVale1 instance);
partial void InsertVisaVale1(VisaVale1 instance);
partial void UpdateVisaVale1(VisaVale1 instance);
public void Save() { using (var ctx = new visaValeDataContext(conn)) { //if (ctx.DatabaseExists()) //{ ctx.DeleteDatabase(); ctx.CreateDatabase(); var infoVisa = new VisaVale1 { DataConsulta = info.DataConsulta, DataProximoBeneficio = info.DataProximoBeneficio, DataUltimoBeneficioDataBeneficio = info.DataUltimoBeneficioDataBeneficio, GetSaldo = info.getSaldo, ValorProximoBeneficio = info.ValorProximoBeneficio, ValorUltimoBeneficio = info.ValorUltimoBeneficio, NumeroCartao = info.NumeroCartao }; foreach (var item2 in xDoc.Root.Nodes()) { infoVisa.VisaValeGastos.Add(new VisaValeGasto { Local = ((System.Xml.Linq.XElement)(item2)).Value.ToString().Remove(0, 5).Remove(((System.Xml.Linq.XElement)(item2)).Value.IndexOf("$") - 6), Data = ((System.Xml.Linq.XElement)(item2)).Value.ToString().Substring(0, 5), Valor = ((System.Xml.Linq.XElement)(item2)).Value.Substring(((System.Xml.Linq.XElement)(item2)).Value.IndexOf("R$")) }); } ctx.VisaVales.InsertOnSubmit(infoVisa); ctx.SubmitChanges(); } }