public String get(String id) { Address ad = new Address(); String connString = FAFOS.Properties.Settings.Default.FAFOS; SqlConnection con = new SqlConnection(connString); String clientInfo = ""; con.Open(); SqlCommand command = new SqlCommand("SELECT * FROM Client WHERE client_id = " + id, con); try{ SqlDataReader reader = command.ExecuteReader(); reader.Read(); clientInfo = reader[1].ToString() + "," + reader[3].ToString() + "," + reader[4].ToString() + "," + reader[5].ToString() + "," + reader[9].ToString() + "," + reader[10].ToString() + "," + ad.getCity(reader[13].ToString()) + "," + ad.getProvince(reader[12].ToString()) + "," + ad.getCountry(reader[11].ToString()); } catch (Exception e) { } // d.Tables.Add(dt); con.Close(); return(clientInfo); }
public String[] getAddress(int id) { Address ad = new Address(); String connString = FAFOS.Properties.Settings.Default.FAFOS; SqlConnection con = new SqlConnection(connString); String []franchisee = new String [3]; con.Open(); SqlCommand command = new SqlCommand("SELECT Franchisee_Business_Address.* FROM Franchisee_Business_Address,[User] WHERE Franchisee_Business_Address.franchisee_id = [User].franchisee_id AND [User].user_id = " + id, con); try { SqlDataReader reader = command.ExecuteReader(); reader.Read(); franchisee[0] = reader[1].ToString(); franchisee[1] = ad.getCity(reader[4].ToString()) ; franchisee[2] = ad.getCountry(reader[5].ToString()); } catch (Exception e) { //MessageBox.Show(e.ToString()); } // d.Tables.Add(dt); con.Close(); // MessageBox.Show(franchisee[0]); return franchisee; }
public String [] getAddress(int id) { Address ad = new Address(); String connString = FAFOS.Properties.Settings.Default.FAFOS; SqlConnection con = new SqlConnection(connString); String [] franchisee = new String [3]; con.Open(); SqlCommand command = new SqlCommand("SELECT Franchisee_Business_Address.* FROM Franchisee_Business_Address,[User] WHERE Franchisee_Business_Address.franchisee_id = [User].franchisee_id AND [User].user_id = " + id, con); try { SqlDataReader reader = command.ExecuteReader(); reader.Read(); franchisee[0] = reader[1].ToString(); franchisee[1] = ad.getCity(reader[4].ToString()); franchisee[2] = ad.getCountry(reader[5].ToString()); } catch (Exception e) { //MessageBox.Show(e.ToString()); } // d.Tables.Add(dt); con.Close(); // MessageBox.Show(franchisee[0]); return(franchisee); }
public String get(String id) { Address ad = new Address(); String connString = FAFOS.Properties.Settings.Default.FAFOS; SqlConnection con = new SqlConnection(connString); String address=""; con.Open(); SqlCommand command = new SqlCommand("SELECT * FROM Service_Address WHERE service_address_id = " + id, con); try { SqlDataReader reader = command.ExecuteReader(); reader.Read(); address = reader[1].ToString() + "," + reader[2].ToString() + "," + reader[3].ToString() + "," + ad.getCity(reader[6].ToString()) + "," + ad.getProvince(reader[5].ToString()) + "," + ad.getCountry(reader[4].ToString()); } catch (Exception e) { } // d.Tables.Add(dt); con.Close(); return address; }
public String get(String id) { Address ad = new Address(); String connString = FAFOS.Properties.Settings.Default.FAFOS; SqlConnection con = new SqlConnection(connString); String franchisee=""; con.Open(); SqlCommand command = new SqlCommand("SELECT b.*, f.company_name FROM Franchisee_Business_Address b,Franchisee f WHERE b.franchisee_id = f.franchisee_id AND f.franchisee_id = " + id, con); try{ SqlDataReader reader = command.ExecuteReader(); reader.Read(); franchisee = reader[1].ToString() + "," + reader[2].ToString() + "," + ad.getCity(reader[4].ToString()) + "," + ad.getProvince(reader[3].ToString()) + "," + ad.getCountry(reader[5].ToString()) + "," + reader[7].ToString(); } catch (Exception e) { } // d.Tables.Add(dt); con.Close(); return franchisee; }
public String get(String id) { Address ad = new Address(); String connString = FAFOS.Properties.Settings.Default.FAFOS; SqlConnection con = new SqlConnection(connString); String franchisee = ""; con.Open(); SqlCommand command = new SqlCommand("SELECT b.*, f.company_name FROM Franchisee_Business_Address b,Franchisee f WHERE b.franchisee_id = f.franchisee_id AND f.franchisee_id = " + id, con); try{ SqlDataReader reader = command.ExecuteReader(); reader.Read(); franchisee = reader[1].ToString() + "," + reader[2].ToString() + "," + ad.getCity(reader[4].ToString()) + "," + ad.getProvince(reader[3].ToString()) + "," + ad.getCountry(reader[5].ToString()) + "," + reader[7].ToString(); } catch (Exception e) { } // d.Tables.Add(dt); con.Close(); return(franchisee); }