/// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            article_pass_value pv = (article_pass_value)e.Parameter;

            tblName.Text = pv.article_name;
            tbl1.Text    = pv.username;
            string a = tblName.Text;
            string b = tbl1.Text;

            var db = new SQLite.SQLiteConnection(App.DBPath);

            try
            {
                var emptab = (db.Table <Article_Forum>().Where(em => em.article_name == a)).Single();

                tblBy.Text          = emptab.lawyername;
                tblDescription.Text = emptab.description;
            }
            catch (Exception ex)
            {
            }

            var r1 = (db.Table <registration>().Where(em1 => em1.username == b)).Single();

            if (r1.type == "lawyer")
            {
                btn1.Visibility = Visibility.Visible;
            }
            else if (r1.type == "consumer")
            {
                btn1.Visibility = Visibility.Collapsed;
            }
        }
예제 #2
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            try
            {
                var    db = new SQLite.SQLiteConnection(App.DBPath);
                string a;
                a = TextBox1.Text.ToString();
                var emptab = (db.Table <Article_Forum>().Where(em => em.article_name == a)).Single();

                if (emptab.article_name == a)
                {
                    if (TextBox1.Text != "")
                    {
                        article_pass_value pv = new article_pass_value {
                            article_name = TextBox1.Text, username = tbl1.Text
                        };
                        this.Frame.Navigate(typeof(Article_view), pv);
                    }
                    else
                    {
                        //tbl.Text = "";
                        tbl2.Text = "Match Not Found";
                    }
                }
            }
            catch (Exception ex)
            {
                tbl2.Text = "Match Not Found";
            }
        }