Exemplo n.º 1
0
    public static LoginAddress GetAddressFromLoginAddressID(int login_address_id)
    {
        CartDB db = new CartDB();
        DataSet ds = db.LoginGetAddress(login_address_id);
        if (ds != null)
        {
            using (DataTableReader data = ds.CreateDataReader())
            {
                while (data.Read())
                {
                    int loginaddressid = data.GetInt32(data.GetOrdinal("LoginAddressID"));
                    int loginid = data.GetInt32(data.GetOrdinal("LoginID"));
                    string addressname = Helper.IsString(data.GetValue(data.GetOrdinal("AddressName")), "");
                    string bldgname = Helper.IsString(data.GetValue(data.GetOrdinal("BldgName")), "");
                    string address1 = Helper.IsString(data.GetValue(data.GetOrdinal("Address1")), "");
                    string address2 = Helper.IsString(data.GetValue(data.GetOrdinal("Address2")), "");
                    string city = Helper.IsString(data.GetValue(data.GetOrdinal("City")), "");
                    string statecode = Helper.IsString(data.GetValue(data.GetOrdinal("StateCode")), "");
                    string province = Helper.IsString(data.GetValue(data.GetOrdinal("Province")), "");
                    string zip = Helper.IsString(data.GetValue(data.GetOrdinal("Zip")), "");
                    string countrycode = Helper.IsString(data.GetValue(data.GetOrdinal("CountryCode")), "");
                    string phone = Helper.IsString(data.GetValue(data.GetOrdinal("Phone")), "");

                    return new LoginAddress(loginaddressid, loginid, addressname, bldgname, address1, address2, city, statecode, province, zip, countrycode,phone);
                }
            }
        }
        return null;
    }