コード例 #1
0
ファイル: Franchisee.cs プロジェクト: pkurowsk/NI-FAFOS
        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;
        }
コード例 #2
0
ファイル: ServiceAddress.cs プロジェクト: pkurowsk/NI-FAFOS
        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;
        }
コード例 #3
0
ファイル: Franchisee.cs プロジェクト: pkurowsk/NI-FAFOS
        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;
        }
コード例 #4
0
ファイル: ServiceAddress.cs プロジェクト: pkurowsk/NI-FAFOS
        public String getContractID(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 client_contract_id FROM Service_Address WHERE service_address_id = " + id, con);
            try
            {
                SqlDataReader reader = command.ExecuteReader();
                reader.Read();

                address = reader[0].ToString();

            }
            catch (Exception e)
            {

            }
            // d.Tables.Add(dt);
            con.Close();
            return address;
        }