Пример #1
0
        private void retrieveCompanyInfo(XmlReader reader)
        {
            string data = reader.Name;
            if (!data.Contains("Table"))
                return;
            if (!reader.GetAttribute(0).Contains("company"))
                return;
            if (data.Contains("Table"))
            {
                reader.Read();
            }
            companyInfoTable = new CompanyInformation();

            data = reader.Name;
            string[] values = new string[7];
            int count = 0;

            while (!data.Contains("Table"))
            {
                while (count < values.Length)
                {
                    values[count++] = "";
                }
                count = 0;
                data = reader.Name;
                while (!(data.Contains("row") && !reader.HasAttributes))
                {

                    if (reader.NodeType == XmlNodeType.Element)
                    {
                        data = reader.Name;
                        count = -1;
                        if (data.Contains("row") && reader.HasAttributes)
                        {
                            count = 0;
                        }
                        else
                        {
                            if (data.Contains("companyname"))
                            {
                                count = 1;
                            }
                            else if (data.Contains("email"))
                            {
                                count = 2;
                            }
                            else if (data.Contains("phno"))
                            {
                                count = 3;
                            }
                            else if (data.Contains("username"))
                            {
                                count = 4;
                            }
                            else if (data.Contains("password"))
                            {
                                count = 5;
                            }
                            else if (data.Contains("address"))
                            {
                                count = 6;
                            }
                        }
                        if (count != -1)
                            values[count] = reader.GetAttribute(0);
                        count = 0;
                    }

                    if (!reader.Read())
                        return;

                    data = reader.Name;
                    if (data.Contains("Table"))
                        return;
                    if (data.Contains("row") && reader.NodeType != XmlNodeType.Element)
                    {
                        companyInfoTable.addProduct(new CompanyInformation.CompanyInformationData(values[0], values[1], values[2], values[3], values[4], values[5],values[6]));
                        break;
                    }
                }
                if (!reader.Read()) break;

            }
        }
Пример #2
0
        // This handles the display a little and also creates the initial URL to navigate to in the browser control
        private void LoginToFacebook()
        {
            TitlePanel.Visibility = Visibility.Visible;
            FacebookLoginBrowser.Visibility = Visibility.Visible;
            InfoPanel.Visibility = Visibility.Collapsed;

            var loginParameters = new Dictionary<string, object>
                                      {
                                          { "response_type", "token" }
                                          // { "display", "touch" } // by default for wp7 builds only (in Facebook.dll), display is set to touch.
                                      };

            var navigateUrl = FacebookOAuthClient.GetLoginUrl(_appId, null, _extendedPermissions, loginParameters);

            FacebookLoginBrowser.Navigate(navigateUrl);
            if (this.NavigationContext.QueryString.ContainsKey("ComposerInfoIndex"))
            {
                composerInfoIndex = Int32.Parse(this.NavigationContext.QueryString["ComposerInfoIndex"]);
                albumInfoIndex = Int32.Parse(this.NavigationContext.QueryString["AlbumInfoIndex"]);
            }
            String productID = null;
            if (this.NavigationContext.QueryString.ContainsKey("ProductID"))
            {
                productID = this.NavigationContext.QueryString["ProductID"];
            }
            composerInfo = Database.getDatabase().getCompaniesDB();
            ProductInformation albumInfo = Database.getDatabase().getProductInfoDB();
            this.DataContext = albumInfo;

            thisPagesAlbum = albumInfo.getProductByID(productID);
        }