nature_net.user_controls.window_content.submit_comment_auth_clicked C# (CSharp) Метод

submit_comment_auth_clicked() публичный Метод

public submit_comment_auth_clicked ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
Результат void
        void submit_comment_auth_clicked(object sender, RoutedEventArgs e)
        {
            if (this.GetActiveTextBox().Text == "")
            {
                this.error_desc.Visibility = System.Windows.Visibility.Visible;
                this.error_desc.Content = "Comment text is empty.";
                if (is_reply)
                    log.WriteInteractionLog(41, (hide_expander?"Idea":"Comment") + "; Reply id: " + reply_id + "; Text is empty; object_type: " + _object_type + "; object_id: " + _object_id.ToString(), ((TouchEventArgs)e).TouchDevice);
                else
                    log.WriteInteractionLog(41, (hide_expander?"Idea":"Comment") + "; Text is empty; object_type: " + _object_type + "; object_id: " + _object_id.ToString(), ((TouchEventArgs)e).TouchDevice);
                return;
            }
            // authenticate
            naturenet_dataclassDataContext db = new naturenet_dataclassDataContext();
            var auth_user = from u in db.Users
                            where (u.name == this.selected_user.title.Text) && (u.password == this.pin.pin_string)
                            select u;
            if (auth_user.Count() == 1)
            {
                if (is_reply)
                    log.WriteInteractionLog(31, (hide_expander ? "Idea" : "Comment") + "; Reply id: " + reply_id + "; Text: " + this.GetActiveTextBox().Text + "; object_type: " + _object_type + "; object_id: " + _object_id.ToString(), ((TouchEventArgs)e).TouchDevice);
                else
                    log.WriteInteractionLog(31, (hide_expander ? "Idea" : "Comment") + "; Text: " + this.GetActiveTextBox().Text + "; object_type: " + _object_type + "; object_id: " + _object_id.ToString(), ((TouchEventArgs)e).TouchDevice);
                submit_text(e);
            }
            else
            {
                if (is_reply)
                    log.WriteInteractionLog(30, (hide_expander?"Idea":"Comment") + "; Reply id: " + reply_id + "; Text: " + this.GetActiveTextBox().Text + "; object_type: " + _object_type + "; object_id: " + _object_id.ToString(), ((TouchEventArgs)e).TouchDevice);
                else
                    log.WriteInteractionLog(30, (hide_expander ? "Idea" : "Comment") + "; Text: " + this.GetActiveTextBox().Text + "; object_type: " + _object_type + "; object_id: " + _object_id.ToString(), ((TouchEventArgs)e).TouchDevice);
                this.error_desc.Visibility = System.Windows.Visibility.Visible;
                this.error_desc.Content = configurations.authentication_failed_text;
                pin.Reset(true);
                error_timer = new System.Threading.Timer(new System.Threading.TimerCallback(this.fade_error), null, 5000, System.Threading.Timeout.Infinite);
            }
        }