<commit_before>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using MySql.Data.MySqlClient;

namespace buggyer
{
	public partial class frmNewBug : Form
	{
		public frmNewBug()
		{
			InitializeComponent();
		}

		private void frmNewBug_Load(object sender, EventArgs e)
		{
			//TODO: ReportedAt is not saving properly.
			lblReportedAt.Text = DateTime.Now.ToString();
			lblReportedBy.Text = Server.UID;
		}

		private void btnAdd_Click(object sender, EventArgs e)
		{
			if (Server.Open())
			{
				StringBuilder query = new StringBuilder();

				query.Append("INSERT INTO `" + Server.Database + "`.`" + Server.Table + "` (");
				query.Append("\n`id`,`summary`,`description`,`reported by`,`reported at`,`assigned to`,`priority`,`status`,`comments`");
				query.Append("\n)");
				query.Append("\nVALUES (");
				query.Append("\nNULL ,");
				query.Append("\n'"); query.Append(txtSummary.Text.Replace("'", "''")); query.Append("',");
				query.Append("\n'"); query.Append(txtDescription.Text.Replace("'", "''")); query.Append("',");
				query.Append("\n'"); query.Append(lblReportedBy.Text.Replace("'", "''")); query.Append("',");
				query.Append("\n'"); query.Append(lblReportedAt.Text.Replace("'", "''")); query.Append("',");
				query.Append("\n'"); query.Append(txtAssignedTo.Text.Replace("'", "''")); query.Append("',");
				query.Append("\n'"); query.Append(txtPriority.Text.Replace("'", "''")); query.Append("',");
				query.Append("\n'"); query.Append(txtStatus.Text.Replace("'", "''")); query.Append("',");
				query.Append("\n'"); query.Append(txtComments.Text.Replace("'", "''")); query.Append("'");
				query.Append("\n);");

				MySqlCommand cmd = new MySqlCommand(query.ToString(), Server.Connection);
				try
				{
					cmd.ExecuteNonQuery();
				}
				catch (MySqlException ex) { Server.ShowError(ex.Message); }
			}
			Server.Close();
		}
	}
}<commit_msg>+Cleaned up the newBug query. +newBug now closes.<commit_after>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using MySql.Data.MySqlClient;

namespace buggyer
{
	public partial class frmNewBug : Form
	{
		public frmNewBug()
		{
			InitializeComponent();
		}

		private void frmNewBug_Load(object sender, EventArgs e)
		{
			//TODO: ReportedAt is not saving properly.
			lblReportedAt.Text = DateTime.Now.ToString();
			lblReportedBy.Text = Server.UID;
		}

		private void btnAdd_Click(object sender, EventArgs e)
		{
			if (Server.Open())
			{
				MySqlCommand cmd = new MySqlCommand(
					"INSERT INTO `" + Server.Database + "`.`" + Server.Table + "`\n" +
					"(`id`,`summary`,`description`,`reported by`,`reported at`,`assigned to`,`priority`,`status`,`comments`)" +
					"\n VALUES " +
					"(NULL,@summary,@description,@reportedby,@reportedat,@assignedto,@priority,@status,@comments)", Server.Connection);


				cmd.Parameters.AddWithValue("@summary", txtSummary.Text);
				cmd.Parameters.AddWithValue("@description", txtDescription.Text);
				cmd.Parameters.AddWithValue("@reportedby", lblReportedBy.Text);
				cmd.Parameters.AddWithValue("@reportedat", lblReportedAt.Text);
				cmd.Parameters.AddWithValue("@assignedto", txtAssignedTo.Text);
				cmd.Parameters.AddWithValue("@priority", txtPriority.Text);
				cmd.Parameters.AddWithValue("@status", txtStatus.Text);
				cmd.Parameters.AddWithValue("@comments", txtComments.Text);

				try
				{
					cmd.ExecuteNonQuery();
					this.Close();
				}
				catch (MySqlException ex)
				{
					Server.ShowError(ex.Message);
				}
				finally
				{
					Server.Close();
				}

			}
		}
	}
}
{'fraction_non_alphanumeric': 0.18455048774057475, 'fraction_numerical': 0.0, 'mean_word_length': 4.284122562674095, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5790305', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1222, 'n_words': 205}