public void InteressentData(InteressentSet oInteressentSet, int MedlemNr, string KontorNavn) { SqlConnection objConn = new SqlConnection(sConnectionStringSQL02); objConn.Open(); DataSet dsInteressent = new DataSet("InteressentTab"); if (KontorNavn == "") { SqlDataAdapter daInteressent = new SqlDataAdapter("SELECT * FROM [Bolig].[dbo].[Interessentadresse] where Interessentnr = (SELECT top 1 Interessentnr from [Bolig].[dbo].[Medlem] where type = 'I' and medlem = " + MedlemNr + ")", objConn); daInteressent.FillSchema(dsInteressent, SchemaType.Source, "Interessent"); daInteressent.Fill(dsInteressent, "Interessent"); } else { SqlDataAdapter daInteressent = new SqlDataAdapter("SELECT * FROM [Bolig].[dbo].[Interessentadresse] where Navn = '" + KontorNavn + "'", objConn); daInteressent.FillSchema(dsInteressent, SchemaType.Source, "Interessent"); daInteressent.Fill(dsInteressent, "Interessent"); } objConn.Close(); DataTable tblInteressent; tblInteressent = dsInteressent.Tables["Interessent"]; objConn.Close(); foreach (DataRow drInteressent in tblInteressent.Rows) { try { Interessent oInteressent = new Interessent(MedlemNr); oInteressent.InteressentNr = drInteressent["Interessentnr"].ToString(); oInteressent.IntNavn = drInteressent["Navn"].ToString(); oInteressent.IntCO = drInteressent["Co"].ToString(); oInteressent.IntAdresse = drInteressent["Adresse"].ToString(); oInteressent.IntLokalBy = drInteressent["Lokalby"].ToString(); oInteressent.IntPostBy = drInteressent["Postby"].ToString(); oInteressent.IntInternetNr = drInteressent["Internetnr"].ToString(); oInteressent.IntPassword = drInteressent["Password"].ToString(); oInteressent.IntGobUrl = drInteressent["gobUrl"].ToString(); oInteressent.IntTlf = drInteressent["Telefon_arbejde"].ToString(); oInteressent.IntFax = drInteressent["Telefon_Fax"].ToString(); oInteressent.IntEmail = drInteressent["Email1"].ToString(); oInteressent.IntTraftid1 = drInteressent["Træffetid1"].ToString(); oInteressent.IntTraftid2 = drInteressent["Træffetid2"].ToString(); oInteressent.IntTraftid3 = drInteressent["Træffetid3"].ToString(); oInteressent.IntTraftid4 = drInteressent["Træffetid4"].ToString(); oInteressent.IntTraftid5 = drInteressent["Træffetid5"].ToString(); oInteressent.PostStregkode = drInteressent["PostDanmarkStregkode"].ToString(); oInteressentSet.AlleInt.Add(oInteressent); } catch (Exception ex) { throw new Exception("Der er opstået en fejl, i forbindelse med hentning af data fra Selskab tabellen i Bolig databasen", ex); } } }
public void UdtrKolOpl(string MedlemNr, string KontorNavn) { Interessent = new InteressentSet(Convert.ToInt32(MedlemNr), KontorNavn); foreach (Interessent oInteressentData in Interessent.AlleInt) { AfdKontorNavn = oInteressentData.IntNavn; AfdKontorAdresse = oInteressentData.IntAdresse; AfdKontorPostby = oInteressentData.IntPostBy; AfdKontorTlf = oInteressentData.IntTlf; AfdKontorFax = oInteressentData.IntFax; AfdKontorEmail = oInteressentData.IntEmail; AfdKtTrafTid1 = oInteressentData.IntTraftid1; AfdKtTrafTid2 = oInteressentData.IntTraftid2; AfdKtTrafTid3 = oInteressentData.IntTraftid3; AfdKtTrafTid4 = oInteressentData.IntTraftid4; AfdKtTrafTid5 = oInteressentData.IntTraftid5; } }
public void UdtrIntOpl(string MedlemNr, string KontorNavn) { Interessent = new InteressentSet(Convert.ToInt32(MedlemNr), KontorNavn); foreach (Interessent oInteressentData in Interessent.AlleInt) { IntNavn = oInteressentData.IntNavn; IntNr = oInteressentData.InteressentNr; IntCo = oInteressentData.IntCO; IntAdresse = oInteressentData.IntAdresse; IntLokalBy = oInteressentData.IntLokalBy; IntPostBy = oInteressentData.IntPostBy; IntInternetNr = oInteressentData.IntInternetNr; IntPassword = oInteressentData.IntPassword; IntGobUrl = oInteressentData.IntGobUrl; emailModt = oInteressentData.IntEmail; PostStregkode = oInteressentData.PostStregkode; } //emailModt = "*****@*****.**"; //kun til test brug - invalid e-mail adresse //emailModt = ""; //kun til test brug - manglende e-mail adresse }