From bdd791b053d23c2965b454c1809c090859bd59f0 Mon Sep 17 00:00:00 2001 From: Ismail Date: Thu, 27 Jul 2017 15:52:00 +0200 Subject: [PATCH] changet location SQL code from = to like % % --- .../db_AI-4_V3/db_AI-4/DataAccess.cs | 4 +-- .../db_AI-4_V3/db_AI-4/LoginForm.Designer.cs | 32 ++++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/csharp/marketconnectionNET2.0/db_AI-4_V3/db_AI-4/DataAccess.cs b/csharp/marketconnectionNET2.0/db_AI-4_V3/db_AI-4/DataAccess.cs index a5efacd..a19990a 100644 --- a/csharp/marketconnectionNET2.0/db_AI-4_V3/db_AI-4/DataAccess.cs +++ b/csharp/marketconnectionNET2.0/db_AI-4_V3/db_AI-4/DataAccess.cs @@ -20,7 +20,7 @@ namespace db_AI_4 using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(Helper.CnnVal("marketdb"))) { - var output = connection.Query($"SELECT * FROM locations WHERE location_name = '{ LocationName }'").ToList(); + var output = connection.Query($"SELECT * FROM locations WHERE location_name like '%{ LocationName }%'").ToList(); return output; } @@ -104,7 +104,7 @@ namespace db_AI_4 } else { - MessageBox.Show("username or passord not correct"); + MessageBox.Show("Username or Password not correct"); } //CheckLogin function end diff --git a/csharp/marketconnectionNET2.0/db_AI-4_V3/db_AI-4/LoginForm.Designer.cs b/csharp/marketconnectionNET2.0/db_AI-4_V3/db_AI-4/LoginForm.Designer.cs index 89955cf..93222d1 100644 --- a/csharp/marketconnectionNET2.0/db_AI-4_V3/db_AI-4/LoginForm.Designer.cs +++ b/csharp/marketconnectionNET2.0/db_AI-4_V3/db_AI-4/LoginForm.Designer.cs @@ -33,11 +33,13 @@ this.PasswordLoginBox = new System.Windows.Forms.TextBox(); this.LoginLabel = new System.Windows.Forms.Label(); this.LoginButton = new System.Windows.Forms.Button(); + this.EmailLabel = new System.Windows.Forms.Label(); + this.PasswordLabel = new System.Windows.Forms.Label(); this.SuspendLayout(); // // RegistrationButton // - this.RegistrationButton.Location = new System.Drawing.Point(15, 145); + this.RegistrationButton.Location = new System.Drawing.Point(86, 145); this.RegistrationButton.Name = "RegistrationButton"; this.RegistrationButton.Size = new System.Drawing.Size(75, 23); this.RegistrationButton.TabIndex = 0; @@ -47,14 +49,14 @@ // // EmailLoginBox // - this.EmailLoginBox.Location = new System.Drawing.Point(15, 50); + this.EmailLoginBox.Location = new System.Drawing.Point(86, 44); this.EmailLoginBox.Name = "EmailLoginBox"; this.EmailLoginBox.Size = new System.Drawing.Size(174, 22); this.EmailLoginBox.TabIndex = 1; // // PasswordLoginBox // - this.PasswordLoginBox.Location = new System.Drawing.Point(15, 94); + this.PasswordLoginBox.Location = new System.Drawing.Point(86, 87); this.PasswordLoginBox.Name = "PasswordLoginBox"; this.PasswordLoginBox.PasswordChar = '*'; this.PasswordLoginBox.Size = new System.Drawing.Size(174, 22); @@ -71,7 +73,7 @@ // // LoginButton // - this.LoginButton.Location = new System.Drawing.Point(114, 145); + this.LoginButton.Location = new System.Drawing.Point(185, 145); this.LoginButton.Name = "LoginButton"; this.LoginButton.Size = new System.Drawing.Size(75, 23); this.LoginButton.TabIndex = 7; @@ -79,11 +81,31 @@ this.LoginButton.UseVisualStyleBackColor = true; this.LoginButton.Click += new System.EventHandler(this.LoginButton_Click); // + // EmailLabel + // + this.EmailLabel.AutoSize = true; + this.EmailLabel.Location = new System.Drawing.Point(12, 44); + this.EmailLabel.Name = "EmailLabel"; + this.EmailLabel.Size = new System.Drawing.Size(42, 17); + this.EmailLabel.TabIndex = 8; + this.EmailLabel.Text = "Email"; + // + // PasswordLabel + // + this.PasswordLabel.AutoSize = true; + this.PasswordLabel.Location = new System.Drawing.Point(12, 87); + this.PasswordLabel.Name = "PasswordLabel"; + this.PasswordLabel.Size = new System.Drawing.Size(69, 17); + this.PasswordLabel.TabIndex = 9; + this.PasswordLabel.Text = "Password"; + // // LoginForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(373, 264); + this.Controls.Add(this.PasswordLabel); + this.Controls.Add(this.EmailLabel); this.Controls.Add(this.LoginButton); this.Controls.Add(this.LoginLabel); this.Controls.Add(this.PasswordLoginBox); @@ -105,6 +127,8 @@ private System.Windows.Forms.TextBox PasswordLoginBox; private System.Windows.Forms.Label LoginLabel; private System.Windows.Forms.Button LoginButton; + private System.Windows.Forms.Label EmailLabel; + private System.Windows.Forms.Label PasswordLabel; } }