From 32cef0289d6b0e6d4f40c978cd198c343562cf47 Mon Sep 17 00:00:00 2001 From: Jannick van Ballegooijen Date: Sun, 11 Oct 2015 19:59:16 +0200 Subject: [PATCH] Started session window --- .gitattributes | 63 ++++++++++++++++ .../ErgometerDoctorApplication.csproj | 20 +++--- .../LoginWindow.Designer.cs | 71 ------------------- ErgometerDoctorApplication/LoginWindow.cs | 33 --------- ErgometerDoctorApplication/MainWindow.cs | 14 +++- .../SessionWindow.Designer.cs | 60 ++++++++++++++++ ErgometerDoctorApplication/SessionWindow.cs | 25 +++++++ .../{LoginWindow.resx => SessionWindow.resx} | 0 8 files changed, 171 insertions(+), 115 deletions(-) create mode 100644 .gitattributes delete mode 100644 ErgometerDoctorApplication/LoginWindow.Designer.cs delete mode 100644 ErgometerDoctorApplication/LoginWindow.cs create mode 100644 ErgometerDoctorApplication/SessionWindow.Designer.cs create mode 100644 ErgometerDoctorApplication/SessionWindow.cs rename ErgometerDoctorApplication/{LoginWindow.resx => SessionWindow.resx} (100%) diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/ErgometerDoctorApplication/ErgometerDoctorApplication.csproj b/ErgometerDoctorApplication/ErgometerDoctorApplication.csproj index 6f234aa..3a9200e 100644 --- a/ErgometerDoctorApplication/ErgometerDoctorApplication.csproj +++ b/ErgometerDoctorApplication/ErgometerDoctorApplication.csproj @@ -34,7 +34,7 @@ - ..\..\..\ErgometerLibrary\ErgometerLibrary\ErgometerLibrary\bin\Debug\ErgometerLibrary.dll + ..\..\ErgometerLibrary\ErgometerLibrary\obj\Debug\ErgometerLibrary.dll @@ -49,6 +49,12 @@ + + Form + + + SessionWindow.cs + Component @@ -64,12 +70,6 @@ Component - - Form - - - LoginWindow.cs - Form @@ -79,9 +79,6 @@ - - LoginWindow.cs - MainWindow.cs @@ -95,6 +92,9 @@ Resources.resx True + + SessionWindow.cs + SettingsSingleFileGenerator Settings.Designer.cs diff --git a/ErgometerDoctorApplication/LoginWindow.Designer.cs b/ErgometerDoctorApplication/LoginWindow.Designer.cs deleted file mode 100644 index 21834a1..0000000 --- a/ErgometerDoctorApplication/LoginWindow.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -namespace ErgometerDoctorApplication -{ - partial class LoginWindow - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.LoginButton = new System.Windows.Forms.Button(); - this.PasswordTextBox = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // LoginButton - // - this.LoginButton.Location = new System.Drawing.Point(197, 12); - this.LoginButton.Name = "LoginButton"; - this.LoginButton.Size = new System.Drawing.Size(75, 23); - this.LoginButton.TabIndex = 0; - this.LoginButton.Text = "Login"; - this.LoginButton.UseVisualStyleBackColor = true; - this.LoginButton.Click += new System.EventHandler(this.LoginButton_Click); - // - // PasswordTextBox - // - this.PasswordTextBox.Location = new System.Drawing.Point(13, 13); - this.PasswordTextBox.Name = "PasswordTextBox"; - this.PasswordTextBox.Size = new System.Drawing.Size(178, 20); - this.PasswordTextBox.TabIndex = 1; - // - // LoginWindow - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(284, 53); - this.Controls.Add(this.PasswordTextBox); - this.Controls.Add(this.LoginButton); - this.Name = "LoginWindow"; - this.Text = "LoginWindow"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Button LoginButton; - private System.Windows.Forms.TextBox PasswordTextBox; - } -} \ No newline at end of file diff --git a/ErgometerDoctorApplication/LoginWindow.cs b/ErgometerDoctorApplication/LoginWindow.cs deleted file mode 100644 index ac16d46..0000000 --- a/ErgometerDoctorApplication/LoginWindow.cs +++ /dev/null @@ -1,33 +0,0 @@ -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 ErgometerDoctorApplication -{ - public partial class LoginWindow : Form - { - public LoginWindow() - { - InitializeComponent(); - } - - private void LoginButton_Click(object sender, EventArgs e) - { - if(MainClient.Connect(PasswordTextBox.Text)) - { - PasswordTextBox.BackColor = System.Drawing.SystemColors.Window; - Close(); - } - else - { - PasswordTextBox.BackColor = Color.Red; - } - } - } -} diff --git a/ErgometerDoctorApplication/MainWindow.cs b/ErgometerDoctorApplication/MainWindow.cs index 22c3056..2952a44 100644 --- a/ErgometerDoctorApplication/MainWindow.cs +++ b/ErgometerDoctorApplication/MainWindow.cs @@ -42,6 +42,18 @@ namespace ErgometerDoctorApplication conSessionHistory.BringToFront(); } public void validateLogin() + { + //enter login details + showDashboard(); + } + + private void buttonLogout_Click(object sender, EventArgs e) + { + //logout + showLoginScreen(); + } + + private void showDashboard() { conPanelLogin.Visible = false; MainContainer.Visible = true; @@ -50,7 +62,7 @@ namespace ErgometerDoctorApplication menuStrip1.Visible = true; } - private void buttonLogout_Click(object sender, EventArgs e) + private void showLoginScreen() { MainContainer.Visible = false; panel1.Visible = false; diff --git a/ErgometerDoctorApplication/SessionWindow.Designer.cs b/ErgometerDoctorApplication/SessionWindow.Designer.cs new file mode 100644 index 0000000..30c65f5 --- /dev/null +++ b/ErgometerDoctorApplication/SessionWindow.Designer.cs @@ -0,0 +1,60 @@ +using System; + +namespace ErgometerDoctorApplication +{ + partial class SessionWindow + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // SessionWindow + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(784, 561); + this.Name = "SessionWindow"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.ResumeLayout(false); + + } + + #endregion + + private void createTitle() + { + if (ActiveSession) + { + this.Text = "Actieve Sessie: " + ClientName; + } + else + { + this.Text = "Afgelopen Sessie: " + ClientName; + } + } + } +} \ No newline at end of file diff --git a/ErgometerDoctorApplication/SessionWindow.cs b/ErgometerDoctorApplication/SessionWindow.cs new file mode 100644 index 0000000..34cfadf --- /dev/null +++ b/ErgometerDoctorApplication/SessionWindow.cs @@ -0,0 +1,25 @@ +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 ErgometerDoctorApplication +{ + public partial class SessionWindow : Form + { + + private bool ActiveSession { get; } + private string ClientName { get; set; } + public SessionWindow(string ClientName, bool ActiveSession) + { + this.ActiveSession = ActiveSession; + this.ClientName = ClientName; + InitializeComponent(); + } + } +} diff --git a/ErgometerDoctorApplication/LoginWindow.resx b/ErgometerDoctorApplication/SessionWindow.resx similarity index 100% rename from ErgometerDoctorApplication/LoginWindow.resx rename to ErgometerDoctorApplication/SessionWindow.resx