Merge branch 'izy' into andreas

This commit is contained in:
Andreas Zweili 2017-07-27 15:45:35 +02:00
commit ed24337ea0
22 changed files with 1432 additions and 18 deletions

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="marketdb" connectionString="Data Source=DESKTOP-HBRKIL2;Initial Catalog=marketdb;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>

View File

@ -0,0 +1,255 @@
namespace db_AI_4
{
partial class Dashboard
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.LocationListBox = new System.Windows.Forms.ListBox();
this.LocationTextBox = new System.Windows.Forms.TextBox();
this.LocationLabel = new System.Windows.Forms.Label();
this.LocationSearchButton = new System.Windows.Forms.Button();
this.LocationInputLabel = new System.Windows.Forms.Label();
this.StreetnameInsertBox = new System.Windows.Forms.TextBox();
this.LocationCapacityInputBox = new System.Windows.Forms.TextBox();
this.LocationNameInputBox = new System.Windows.Forms.TextBox();
this.LocationInsertButton = new System.Windows.Forms.Button();
this.NameLabel = new System.Windows.Forms.Label();
this.CapacityLabel = new System.Windows.Forms.Label();
this.StreetLabel = new System.Windows.Forms.Label();
this.RentDateLabel = new System.Windows.Forms.Label();
this.PaymentDateLabel = new System.Windows.Forms.Label();
this.RentInsertButton = new System.Windows.Forms.Button();
this.RentInputLabel = new System.Windows.Forms.Label();
this.RentDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.PaymentDateTimePicker2 = new System.Windows.Forms.DateTimePicker();
this.SuspendLayout();
//
// LocationListBox
//
this.LocationListBox.FormattingEnabled = true;
this.LocationListBox.ItemHeight = 16;
this.LocationListBox.Location = new System.Drawing.Point(12, 91);
this.LocationListBox.Name = "LocationListBox";
this.LocationListBox.Size = new System.Drawing.Size(196, 244);
this.LocationListBox.TabIndex = 0;
//
// LocationTextBox
//
this.LocationTextBox.Location = new System.Drawing.Point(12, 50);
this.LocationTextBox.Name = "LocationTextBox";
this.LocationTextBox.Size = new System.Drawing.Size(100, 22);
this.LocationTextBox.TabIndex = 1;
//
// LocationLabel
//
this.LocationLabel.AutoSize = true;
this.LocationLabel.Location = new System.Drawing.Point(12, 13);
this.LocationLabel.Name = "LocationLabel";
this.LocationLabel.Size = new System.Drawing.Size(112, 17);
this.LocationLabel.TabIndex = 2;
this.LocationLabel.Text = "Location-Search";
//
// LocationSearchButton
//
this.LocationSearchButton.Location = new System.Drawing.Point(133, 50);
this.LocationSearchButton.Name = "LocationSearchButton";
this.LocationSearchButton.Size = new System.Drawing.Size(75, 23);
this.LocationSearchButton.TabIndex = 3;
this.LocationSearchButton.Text = "Search";
this.LocationSearchButton.UseVisualStyleBackColor = true;
this.LocationSearchButton.Click += new System.EventHandler(this.LocationSearchButton_Click);
//
// LocationInputLabel
//
this.LocationInputLabel.AutoSize = true;
this.LocationInputLabel.Location = new System.Drawing.Point(266, 13);
this.LocationInputLabel.Name = "LocationInputLabel";
this.LocationInputLabel.Size = new System.Drawing.Size(98, 17);
this.LocationInputLabel.TabIndex = 4;
this.LocationInputLabel.Text = "Location-Input";
//
// StreetnameInsertBox
//
this.StreetnameInsertBox.Location = new System.Drawing.Point(369, 53);
this.StreetnameInsertBox.Name = "StreetnameInsertBox";
this.StreetnameInsertBox.Size = new System.Drawing.Size(100, 22);
this.StreetnameInsertBox.TabIndex = 5;
//
// LocationCapacityInputBox
//
this.LocationCapacityInputBox.Location = new System.Drawing.Point(369, 105);
this.LocationCapacityInputBox.Name = "LocationCapacityInputBox";
this.LocationCapacityInputBox.Size = new System.Drawing.Size(100, 22);
this.LocationCapacityInputBox.TabIndex = 6;
//
// LocationNameInputBox
//
this.LocationNameInputBox.Location = new System.Drawing.Point(369, 158);
this.LocationNameInputBox.Name = "LocationNameInputBox";
this.LocationNameInputBox.Size = new System.Drawing.Size(100, 22);
this.LocationNameInputBox.TabIndex = 7;
//
// LocationInsertButton
//
this.LocationInsertButton.Location = new System.Drawing.Point(369, 210);
this.LocationInsertButton.Name = "LocationInsertButton";
this.LocationInsertButton.Size = new System.Drawing.Size(75, 23);
this.LocationInsertButton.TabIndex = 9;
this.LocationInsertButton.Text = "Insert";
this.LocationInsertButton.UseVisualStyleBackColor = true;
this.LocationInsertButton.Click += new System.EventHandler(this.LocationInsertButton_Click);
//
// NameLabel
//
this.NameLabel.AutoSize = true;
this.NameLabel.Location = new System.Drawing.Point(266, 158);
this.NameLabel.Name = "NameLabel";
this.NameLabel.Size = new System.Drawing.Size(97, 17);
this.NameLabel.TabIndex = 10;
this.NameLabel.Text = "Locationname";
//
// CapacityLabel
//
this.CapacityLabel.AutoSize = true;
this.CapacityLabel.Location = new System.Drawing.Point(266, 105);
this.CapacityLabel.Name = "CapacityLabel";
this.CapacityLabel.Size = new System.Drawing.Size(62, 17);
this.CapacityLabel.TabIndex = 11;
this.CapacityLabel.Text = "Capacity";
//
// StreetLabel
//
this.StreetLabel.AutoSize = true;
this.StreetLabel.Location = new System.Drawing.Point(266, 53);
this.StreetLabel.Name = "StreetLabel";
this.StreetLabel.Size = new System.Drawing.Size(81, 17);
this.StreetLabel.TabIndex = 12;
this.StreetLabel.Text = "Streetname";
//
// RentDateLabel
//
this.RentDateLabel.AutoSize = true;
this.RentDateLabel.Location = new System.Drawing.Point(529, 56);
this.RentDateLabel.Name = "RentDateLabel";
this.RentDateLabel.Size = new System.Drawing.Size(73, 17);
this.RentDateLabel.TabIndex = 20;
this.RentDateLabel.Text = "Rent-Date";
//
// PaymentDateLabel
//
this.PaymentDateLabel.AutoSize = true;
this.PaymentDateLabel.Location = new System.Drawing.Point(528, 110);
this.PaymentDateLabel.Name = "PaymentDateLabel";
this.PaymentDateLabel.Size = new System.Drawing.Size(101, 17);
this.PaymentDateLabel.TabIndex = 18;
this.PaymentDateLabel.Text = "Payment_Date";
//
// RentInsertButton
//
this.RentInsertButton.Location = new System.Drawing.Point(649, 210);
this.RentInsertButton.Name = "RentInsertButton";
this.RentInsertButton.Size = new System.Drawing.Size(75, 23);
this.RentInsertButton.TabIndex = 17;
this.RentInsertButton.Text = "Insert";
this.RentInsertButton.UseVisualStyleBackColor = true;
this.RentInsertButton.Click += new System.EventHandler(this.RentInsertButton_Click);
//
// RentInputLabel
//
this.RentInputLabel.AutoSize = true;
this.RentInputLabel.Location = new System.Drawing.Point(528, 13);
this.RentInputLabel.Name = "RentInputLabel";
this.RentInputLabel.Size = new System.Drawing.Size(74, 17);
this.RentInputLabel.TabIndex = 13;
this.RentInputLabel.Text = "Rent-Input";
//
// RentDateTimePicker
//
this.RentDateTimePicker.Location = new System.Drawing.Point(649, 53);
this.RentDateTimePicker.Name = "RentDateTimePicker";
this.RentDateTimePicker.Size = new System.Drawing.Size(200, 22);
this.RentDateTimePicker.TabIndex = 21;
//
// PaymentDateTimePicker2
//
this.PaymentDateTimePicker2.Location = new System.Drawing.Point(649, 110);
this.PaymentDateTimePicker2.Name = "PaymentDateTimePicker2";
this.PaymentDateTimePicker2.Size = new System.Drawing.Size(200, 22);
this.PaymentDateTimePicker2.TabIndex = 22;
//
// Dashboard
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(861, 366);
this.Controls.Add(this.PaymentDateTimePicker2);
this.Controls.Add(this.RentDateTimePicker);
this.Controls.Add(this.RentDateLabel);
this.Controls.Add(this.PaymentDateLabel);
this.Controls.Add(this.RentInsertButton);
this.Controls.Add(this.RentInputLabel);
this.Controls.Add(this.StreetLabel);
this.Controls.Add(this.CapacityLabel);
this.Controls.Add(this.NameLabel);
this.Controls.Add(this.LocationInsertButton);
this.Controls.Add(this.LocationNameInputBox);
this.Controls.Add(this.LocationCapacityInputBox);
this.Controls.Add(this.StreetnameInsertBox);
this.Controls.Add(this.LocationInputLabel);
this.Controls.Add(this.LocationSearchButton);
this.Controls.Add(this.LocationLabel);
this.Controls.Add(this.LocationTextBox);
this.Controls.Add(this.LocationListBox);
this.Name = "Dashboard";
this.Text = "Dashboard";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ListBox LocationListBox;
private System.Windows.Forms.TextBox LocationTextBox;
private System.Windows.Forms.Label LocationLabel;
private System.Windows.Forms.Button LocationSearchButton;
private System.Windows.Forms.Label LocationInputLabel;
private System.Windows.Forms.TextBox StreetnameInsertBox;
private System.Windows.Forms.TextBox LocationCapacityInputBox;
private System.Windows.Forms.TextBox LocationNameInputBox;
private System.Windows.Forms.Button LocationInsertButton;
private System.Windows.Forms.Label NameLabel;
private System.Windows.Forms.Label CapacityLabel;
private System.Windows.Forms.Label StreetLabel;
private System.Windows.Forms.Label RentDateLabel;
private System.Windows.Forms.Label PaymentDateLabel;
private System.Windows.Forms.Button RentInsertButton;
private System.Windows.Forms.Label RentInputLabel;
private System.Windows.Forms.DateTimePicker RentDateTimePicker;
private System.Windows.Forms.DateTimePicker PaymentDateTimePicker2;
}
}

View File

@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace db_AI_4
{
public partial class Dashboard : Form
{
//Search Locations start
List<GetLocations> locations = new List<GetLocations>();
public Dashboard()
{
InitializeComponent();
UpdateBinding();
}
private void UpdateBinding()
{
LocationListBox.DataSource = locations;
LocationListBox.DisplayMember = "LocationInfo";
}
private void LocationSearchButton_Click(object sender, EventArgs e)
{
DataAccess db = new DataAccess();
locations = db.GetLocations(LocationTextBox.Text);
UpdateBinding();
}
// Search Locations end
//Insert Locations start
private void LocationInsertButton_Click(object sender, EventArgs e)
{
DataAccess db = new DataAccess();
int CapacityValue;
CapacityValue = Convert.ToInt32(LocationCapacityInputBox.Text);
CapacityValue = int.Parse(LocationCapacityInputBox.Text);
db.InsertLocations(StreetnameInsertBox.Text, Convert.ToInt32(LocationCapacityInputBox.Text), LocationNameInputBox.Text);
StreetnameInsertBox.Text = "";
LocationCapacityInputBox.Text = "";
LocationNameInputBox.Text = "";
}
// Insert Locations end
// Insert Rent start
private void RentInsertButton_Click(object sender, EventArgs e)
{
DataAccess db = new DataAccess();
int RentPriceID;
RentPriceID = 1;
int MemberID;
MemberID = 1;
db.InsertRent(RentDateTimePicker.Value.Date.ToString("yyyyMMdd"), PaymentDateTimePicker2.Value.Date.ToString("yyyyMMdd"), RentPriceID, MemberID);
RentDateTimePicker.Text = "";
PaymentDateTimePicker2.Text = "";
}
// Insert Rent end
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,113 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;
using System.Data;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace db_AI_4
{
public class DataAccess
{
public SqlConnection connection { get; private set; }
//Read locations from the Database function start
public List<GetLocations> GetLocations(string LocationName)
{
using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(Helper.CnnVal("marketdb")))
{
var output = connection.Query<GetLocations>($"SELECT * FROM locations WHERE location_name = '{ LocationName }'").ToList();
return output;
}
}
//Read locations from the Database function end
//Registration function start
public void InsertMember(string Email_address, string Password)
{
using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(Helper.CnnVal("marketdb")))
{
List<GetMembers> members = new List<GetMembers>();
members.Add(new GetMembers { email_address = Email_address, password = Password });
connection.Execute("INSERT INTO dbo.members ( email_address, password)" +
" VALUES (@Email_address, @Password) ", members);
}
}
//Registration function end
// Insert Locations into Database start
public void InsertLocations(string StreetName, int LocationCapacity, string LocationName)
{
using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(Helper.CnnVal("marketdb")))
{
List<GetLocations> locations = new List<GetLocations>();
locations.Add(new GetLocations { streetname = StreetName, location_capacity = LocationCapacity, location_name = LocationName });
connection.Execute("INSERT INTO dbo.locations (streetname, location_capacity, location_name)" +
" VALUES (@streetName, @location_capacity, @location_name)", locations);
}
}
// Insert Locations into Database end
// Insert Rents into Database start
public void InsertRent(string RentDate, string PaymentDate, int MemberID, int RentPriceID )
{
using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(Helper.CnnVal("marketdb")))
{
List<GetRents> rents = new List<GetRents>();
rents.Add(new GetRents { rent_date = RentDate, payment_date = PaymentDate, member_id = MemberID, rent_price_id = RentPriceID, });
connection.Execute("INSERT INTO dbo.rents (rent_date, payment_date, member_id, rent_price_id)" +
" VALUES (@rent_date, @payment_date, @member_id, @rent_price_id )", rents);
}
}
// Insert Rents into Database end
//CheckLogin function start
public void CheckLogin(string Email_address, string Password)
{
SqlConnection con = new SqlConnection(Helper.CnnVal("marketdb"));
con.Open();
SqlCommand cmd = new SqlCommand($"SELECT * FROM dbo.members WHERE email_address = '{Email_address}' and password = '{Password}'",con);
SqlDataReader reader;
reader = cmd.ExecuteReader();
int count = 0;
while (reader.Read())
{
count += 1;
}
if (count == 1)
{
MessageBox.Show("It Worked");
Dashboard dashboard = new Dashboard();
dashboard.Show();
}
else if (count > 0)
{
MessageBox.Show("Already existing");
}
else
{
MessageBox.Show("username or passord not correct");
}
//CheckLogin function end
}
}
}

View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace db_AI_4
{
public class GetLocations
{
public int location_id { get; set; }
public string streetname { get; set; }
public int location_capacity { get; set; }
public string location_name { get; set; }
public string LocationInfo
{
get
{
return $"{ streetname } { location_capacity } {location_name} ";
}
}
}
}

View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace db_AI_4
{
public class GetMembers
{
public int member_id { get; set; }
public string email_address { get; set; }
public string password { get; set; }
public int member_status_id { get; set; }
public string MemberInfo
{
get
{
return $" ({email_address}) {password} ";
}
}
}
}

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace db_AI_4
{
public class GetRents
{
public int rent_id { get; set; }
public string rent_date { get; set; }
public string payment_date { get; set; }
public int member_id { get; set; }
public int rent_price_id { get; set; }
// Not in use until we want to read that data out
public string RentInfo
{
get
{
return $"{ rent_date } { payment_date } {member_id} {rent_price_id} ";
}
}
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
namespace db_AI_4
{
public static class Helper
{
public static string CnnVal(string marketdb)
{
return ConfigurationManager.ConnectionStrings[marketdb].ConnectionString;
}
}
}

View File

@ -0,0 +1,110 @@
namespace db_AI_4
{
partial class LoginForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.RegistrationButton = new System.Windows.Forms.Button();
this.EmailLoginBox = new System.Windows.Forms.TextBox();
this.PasswordLoginBox = new System.Windows.Forms.TextBox();
this.LoginLabel = new System.Windows.Forms.Label();
this.LoginButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// RegistrationButton
//
this.RegistrationButton.Location = new System.Drawing.Point(15, 145);
this.RegistrationButton.Name = "RegistrationButton";
this.RegistrationButton.Size = new System.Drawing.Size(75, 23);
this.RegistrationButton.TabIndex = 0;
this.RegistrationButton.Text = "Register";
this.RegistrationButton.UseVisualStyleBackColor = true;
this.RegistrationButton.Click += new System.EventHandler(this.RegistrationButton_Click);
//
// EmailLoginBox
//
this.EmailLoginBox.Location = new System.Drawing.Point(15, 50);
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.Name = "PasswordLoginBox";
this.PasswordLoginBox.PasswordChar = '*';
this.PasswordLoginBox.Size = new System.Drawing.Size(174, 22);
this.PasswordLoginBox.TabIndex = 2;
//
// LoginLabel
//
this.LoginLabel.AutoSize = true;
this.LoginLabel.Location = new System.Drawing.Point(12, 9);
this.LoginLabel.Name = "LoginLabel";
this.LoginLabel.Size = new System.Drawing.Size(43, 17);
this.LoginLabel.TabIndex = 4;
this.LoginLabel.Text = "Login";
//
// LoginButton
//
this.LoginButton.Location = new System.Drawing.Point(114, 145);
this.LoginButton.Name = "LoginButton";
this.LoginButton.Size = new System.Drawing.Size(75, 23);
this.LoginButton.TabIndex = 7;
this.LoginButton.Text = "Login";
this.LoginButton.UseVisualStyleBackColor = true;
this.LoginButton.Click += new System.EventHandler(this.LoginButton_Click);
//
// 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.LoginButton);
this.Controls.Add(this.LoginLabel);
this.Controls.Add(this.PasswordLoginBox);
this.Controls.Add(this.EmailLoginBox);
this.Controls.Add(this.RegistrationButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "LoginForm";
this.Text = "Login";
this.Load += new System.EventHandler(this.LoginForm_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button RegistrationButton;
private System.Windows.Forms.TextBox EmailLoginBox;
private System.Windows.Forms.TextBox PasswordLoginBox;
private System.Windows.Forms.Label LoginLabel;
private System.Windows.Forms.Button LoginButton;
}
}

View File

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace db_AI_4
{
public partial class LoginForm : Form
{
public LoginForm()
{
InitializeComponent();
}
private void RegistrationButton_Click(object sender, EventArgs e)
{
DataAccess db = new DataAccess();
db.InsertMember(EmailLoginBox.Text, PasswordLoginBox.Text);
EmailLoginBox.Text = "";
PasswordLoginBox.Text = "";
}
private void LoginButton_Click(object sender, EventArgs e)
{
DataAccess db = new DataAccess();
db.CheckLogin(EmailLoginBox.Text, PasswordLoginBox.Text);
}
private void LoginForm_Load(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace db_AI_4
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new LoginForm());
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("db_AI-4")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("db_AI-4")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b692de45-80b1-45ca-b519-81639ca9c0ba")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace db_AI_4.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("db_AI_4.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace db_AI_4.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B692DE45-80B1-45CA-B519-81639CA9C0BA}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>db_AI_4</RootNamespace>
<AssemblyName>db_AI-4</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Dapper, Version=1.50.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Dapper.1.50.2\lib\net451\Dapper.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Dashboard.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Dashboard.Designer.cs">
<DependentUpon>Dashboard.cs</DependentUpon>
</Compile>
<Compile Include="DataAccess.cs" />
<Compile Include="GetLocations.cs" />
<Compile Include="GetMembers.cs" />
<Compile Include="GetRents.cs" />
<Compile Include="Helper.cs" />
<Compile Include="LoginForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="LoginForm.Designer.cs">
<DependentUpon>LoginForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Dashboard.resx">
<DependentUpon>Dashboard.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="LoginForm.resx">
<DependentUpon>LoginForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Dapper" version="1.50.2" targetFramework="net452" />
</packages>

View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26403.7
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "db_AI-4", "db_AI-4\db_AI-4.csproj", "{B692DE45-80B1-45CA-B519-81639CA9C0BA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B692DE45-80B1-45CA-B519-81639CA9C0BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B692DE45-80B1-45CA-B519-81639CA9C0BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B692DE45-80B1-45CA-B519-81639CA9C0BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B692DE45-80B1-45CA-B519-81639CA9C0BA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -393,7 +393,7 @@ der Platz reserviert wurde.
\newline
Diese weisst jedem Standort einen Preis zu. Dies ermöglicht es die
Preise für jeden Standort flexibel zu halten und den regionalen
Interessensgruppen anzupassen.
Interessengruppen anzupassen.
\subsection{C\#}
@ -405,7 +405,7 @@ Verarbeitung unsere Datenbank auf.
\subsubsection{Connection}
Um die Verbindung ( connectionstring ) abrufen zu können, erstellen
wir eine « helper» Klasse. Darin haben wir den Verbindungspfad
wir eine « Helper» Klasse. Darin haben wir den Verbindungspfad
definiert der beim Verbindungsaufbau in App.config aufgerufen wird.
Den definitiven (connectionstring) haben wir in «App.config» bestimmt.
@ -421,25 +421,64 @@ Sobald die gesuchten Daten in der «TextBox» eingegeben wurden, werden
die Informationen aufgerufen und in der «ListBox» aufgezeigt.
\subsubsection{Datenverarbeitung}
\subsubsection{Definition der Klassen}
Um die benötigten Daten von der Datenbank hinzuzufügen oder
zurückzuschicken, brauchen wir ein Model, in welches Daten eingefügt
werden können. Hierfür erstellten wir eine neue Klasse, die wir
«cities» nennen und die Struktur dieser Tabelle aus der Datenbank
abbilden. In der Klasse « dataaccess» bauen wir eine Methode auf, mit
der wir die Daten als Liste mit einer neuen Verbindung abrufen(und
danach wieder schliessen) können und haben die «ListBox» in der
«Dashboard» Klasse damit verbunden. Um die Verbindung zur « listBox»
zu vervollständigen, haben wir in der «cities» Klasse die Lese-
Eigenschaft «Fullinfo» eingesetzt, um nur die gewollten Daten
abzurufen.
Hier werden alle eingesetzten Klassen der Applikation vorgestellt
und definiert.
Mit einem connection.Query Funktion, haben wir wie in einer SQL-
Datenbank Funktionk, danach die Daten in der Klasse «dataaccess»
abgefragt.
\textbf{Programm}
\newline
Dient grundsätzlich als Eintrittspunkt der Applikation und hat sonst keine grosse Funktion.
\textbf{Helper}
\newline
Helper.cs dient dem Zweck, den Pfad der Datenbank nicht in jeder
Methode eingeben zu müssen.
Daführ haben wir in dieser Klasse den Verbindungsaufbau durch den Configuration.Manager definiert.
Den Pfad zur Datenbank muss dadurch nur ein einziges Mal in App.config definiert werden und kann dann durch die Helper.cs Klasse simpel aufgerufen werden.
\textbf{LoginForm}
\newline
Diese Klasse wurde für das Registrieren und Einloggen des Benutzers
mit einem dazugehörigen GUI von uns erstellt.
Dadurch können sich Benutzer durch das Eingeben der Email-Adresse und des Passwortes mit dem "Register-Button" Registrieren und durch ein zweites eingeben der Daten und betätigen des "Login-Button" auch gleich einloggen.
Nach dem Login wird auch gleich eine Nachricht der Applikation dem Benutzer mit dem Text "It worked" aufgezeigt, um den erfolgreichen Login zu melden.
Dadurch möchten wir die Funktion des einfüllen und Lesen der Daten aus der Datenbank aufzeigen.
Den Verbindungsaufbau in die Datenbank mit allen nötigen Funktion(Schreiben / Lesen) haben wir in die Klasse "DataAccess" ausgelagert.
\textbf{Dashboard}
\newline
Auf dem Dashboard haben wir unseren Kern was Informationen herauslesen und wieder Eingeben belangt, erstellt.
In dieser Klasse werden die aus der Datenbank herausgelesenen Daten der locations / (Standorte) und rents / (Mieten) Tabellen im GUI aufgezeigt und /oder eingefügt.
Damit möchten wir einen Teil unserer Applikation und Datenbank abbilden, mit der Benutzer Standort heraussuchen können, neue Standorte hinzugefügt werden können und den Mietbeginn/ das Zahlungsdatum eingegeben werden kann.
Den Verbindungsaufbau in die Datenbank mit allen nötigen
Funktion(Schreiben / Lesen) haben wir in die Klasse "DataAccess" ausgelagert und vom GUI aus verankert.
\textbf{DataAccess}
\newline
Mit der DataAccess Klasse konnten wir nahezu alle Datenbank relevanten Funktionen, die sonst in unseren GUI ausgeführt werden, in einer einzigen Klasse abbilden.
Darin haben wir den Aufruf der Datenbanktabellen mit den dazu benötigten SQl - Befehlen ausgeführt.
Dadurch wird SQl- Code nur in dieser Klasse aufgerufen und verwendet.
\textbf{GetRents}
\newline
Um Daten herauszulesen oder zur Datenbank zu schicken, haben wir in C# ein Model der "rents" Tabelle erstellt die sie abbildet.
Damit nehmen wir jede Spalte der Tabelle entgegen.
Danach werden mit der "RentInfo" Methode nur diejenigen Spalten der Tabelle für unser GUI abgerufen, die wir auch wirklich benötigen.
Jedoch wird die "RentInfo" Methode noch nicht benötigt, da wir Daten nur einfügen und nicht herauslesen möchten.
\textbf{GetMembers}
\newline
Um Daten herauszulesen oder zur Datenbank zu schicken, haben wir in C# ein Model der "members" Tabelle erstellt die sie abbildet.
Damit nehmen wir jede Spalte der Tabelle entgegen.
Danach werden mit der "MemberInfo" Methode nur diejenigen Spalten der Tabelle für unser GUI abgerufen, die wir auch wirklich benötigen,um die Login Daten zu überprüfen.
\textbf{GetLocations}
\newline
Um Daten herauszulesen oder zur Datenbank zu schicken, haben wir in C# ein Model der "locations" Tabelle erstellt die sie abbildet.
Damit nehmen wir jede Spalte der Tabelle entgegen.
Danach werden mit der "LocationInfo" Methode nur diejenigen Spalten der Tabelle für unser GUI abgerufen, die wir auch wirklich benötigen.
\subsubsection{Problematik}
-Verbindungsaufbau
@ -448,7 +487,7 @@ abgefragt.
-Datenvormatierung (Geburtstag)
\subsubsection{Referenzen und Addons}
\subsubsection{Referenzen und Addons/ Packages}
Mit Dapper \cite{dbcs6} entschieden wir uns, nachdem wir ein wenig
nachgeforscht haben und wir auf Stack Overflow fündig wurden. Da auf
dieser Webseite Dapper genutzt wird und wir bisher immer gute