From 5b98e76cc9aa6cac343857d4d746342f17bb5989 Mon Sep 17 00:00:00 2001 From: kougyokugentou <41278462+kougyokugentou@users.noreply.github.com> Date: Thu, 14 Jan 2021 16:20:01 -0800 Subject: [PATCH] Populate the main form with guardian's children --- frmMainForm.Designer.cs | 454 +++++++++++++++++++++++++++++++++++++++- frmMainForm.cs | 64 +++++- 2 files changed, 511 insertions(+), 7 deletions(-) diff --git a/frmMainForm.Designer.cs b/frmMainForm.Designer.cs index 79723ee..88f62fc 100644 --- a/frmMainForm.Designer.cs +++ b/frmMainForm.Designer.cs @@ -30,12 +30,62 @@ namespace GreatHomeChildcare private void InitializeComponent() { this.btnAdmin = new System.Windows.Forms.Button(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.panelChild1 = new System.Windows.Forms.Panel(); + this.btnChild1 = new System.Windows.Forms.Button(); + this.picturebox_Child1 = new System.Windows.Forms.PictureBox(); + this.panelChild2 = new System.Windows.Forms.Panel(); + this.btnChild2 = new System.Windows.Forms.Button(); + this.picturebox_child2 = new System.Windows.Forms.PictureBox(); + this.panelChild3 = new System.Windows.Forms.Panel(); + this.btnChild3 = new System.Windows.Forms.Button(); + this.picturebox_child3 = new System.Windows.Forms.PictureBox(); + this.panelChild4 = new System.Windows.Forms.Panel(); + this.lblNoChildren = new System.Windows.Forms.Label(); + this.btnChild4 = new System.Windows.Forms.Button(); + this.picturebox_child4 = new System.Windows.Forms.PictureBox(); + this.panelChild5 = new System.Windows.Forms.Panel(); + this.btnChild5 = new System.Windows.Forms.Button(); + this.picturebox_child5 = new System.Windows.Forms.PictureBox(); + this.panelChild6 = new System.Windows.Forms.Panel(); + this.btnChild6 = new System.Windows.Forms.Button(); + this.picturebox_child6 = new System.Windows.Forms.PictureBox(); + this.panelChild7 = new System.Windows.Forms.Panel(); + this.btnChild7 = new System.Windows.Forms.Button(); + this.picturebox_child7 = new System.Windows.Forms.PictureBox(); + this.panelChild8 = new System.Windows.Forms.Panel(); + this.btnChild8 = new System.Windows.Forms.Button(); + this.picturebox_child8 = new System.Windows.Forms.PictureBox(); + this.panelChild9 = new System.Windows.Forms.Panel(); + this.btnChild9 = new System.Windows.Forms.Button(); + this.picturebox_child9 = new System.Windows.Forms.PictureBox(); + this.lblInstructions = new System.Windows.Forms.Label(); + this.btnDone = new System.Windows.Forms.Button(); + this.tableLayoutPanel1.SuspendLayout(); + this.panelChild1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_Child1)).BeginInit(); + this.panelChild2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child2)).BeginInit(); + this.panelChild3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child3)).BeginInit(); + this.panelChild4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child4)).BeginInit(); + this.panelChild5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child5)).BeginInit(); + this.panelChild6.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child6)).BeginInit(); + this.panelChild7.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child7)).BeginInit(); + this.panelChild8.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child8)).BeginInit(); + this.panelChild9.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child9)).BeginInit(); this.SuspendLayout(); // // btnAdmin // this.btnAdmin.Enabled = false; - this.btnAdmin.Location = new System.Drawing.Point(675, 12); + this.btnAdmin.Location = new System.Drawing.Point(767, 64); this.btnAdmin.Name = "btnAdmin"; this.btnAdmin.Size = new System.Drawing.Size(113, 41); this.btnAdmin.TabIndex = 0; @@ -45,21 +95,421 @@ namespace GreatHomeChildcare this.btnAdmin.Visible = false; this.btnAdmin.Click += new System.EventHandler(this.btnAdmin_Click); // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 3; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.tableLayoutPanel1.Controls.Add(this.panelChild1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.panelChild2, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.panelChild3, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.panelChild4, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.panelChild5, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.panelChild6, 2, 1); + this.tableLayoutPanel1.Controls.Add(this.panelChild7, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.panelChild8, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.panelChild9, 2, 2); + this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 60); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 3; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(734, 378); + this.tableLayoutPanel1.TabIndex = 1; + // + // panelChild1 + // + this.panelChild1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelChild1.Controls.Add(this.btnChild1); + this.panelChild1.Controls.Add(this.picturebox_Child1); + this.panelChild1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelChild1.Location = new System.Drawing.Point(3, 3); + this.panelChild1.Name = "panelChild1"; + this.panelChild1.Size = new System.Drawing.Size(238, 120); + this.panelChild1.TabIndex = 3; + this.panelChild1.Visible = false; + // + // btnChild1 + // + this.btnChild1.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnChild1.Location = new System.Drawing.Point(82, 0); + this.btnChild1.Name = "btnChild1"; + this.btnChild1.Size = new System.Drawing.Size(154, 118); + this.btnChild1.TabIndex = 1; + this.btnChild1.Text = "Child 1"; + this.btnChild1.UseVisualStyleBackColor = true; + this.btnChild1.Click += new System.EventHandler(this.btnChild_Click); + // + // picturebox_Child1 + // + this.picturebox_Child1.Dock = System.Windows.Forms.DockStyle.Left; + this.picturebox_Child1.Location = new System.Drawing.Point(0, 0); + this.picturebox_Child1.Name = "picturebox_Child1"; + this.picturebox_Child1.Size = new System.Drawing.Size(82, 118); + this.picturebox_Child1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picturebox_Child1.TabIndex = 0; + this.picturebox_Child1.TabStop = false; + // + // panelChild2 + // + this.panelChild2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelChild2.Controls.Add(this.btnChild2); + this.panelChild2.Controls.Add(this.picturebox_child2); + this.panelChild2.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelChild2.Location = new System.Drawing.Point(247, 3); + this.panelChild2.Name = "panelChild2"; + this.panelChild2.Size = new System.Drawing.Size(238, 120); + this.panelChild2.TabIndex = 4; + this.panelChild2.Visible = false; + // + // btnChild2 + // + this.btnChild2.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnChild2.Location = new System.Drawing.Point(82, 0); + this.btnChild2.Name = "btnChild2"; + this.btnChild2.Size = new System.Drawing.Size(154, 118); + this.btnChild2.TabIndex = 1; + this.btnChild2.Text = "Child 2"; + this.btnChild2.UseVisualStyleBackColor = true; + // + // picturebox_child2 + // + this.picturebox_child2.Dock = System.Windows.Forms.DockStyle.Left; + this.picturebox_child2.Location = new System.Drawing.Point(0, 0); + this.picturebox_child2.Name = "picturebox_child2"; + this.picturebox_child2.Size = new System.Drawing.Size(82, 118); + this.picturebox_child2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picturebox_child2.TabIndex = 0; + this.picturebox_child2.TabStop = false; + // + // panelChild3 + // + this.panelChild3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelChild3.Controls.Add(this.btnChild3); + this.panelChild3.Controls.Add(this.picturebox_child3); + this.panelChild3.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelChild3.Location = new System.Drawing.Point(491, 3); + this.panelChild3.Name = "panelChild3"; + this.panelChild3.Size = new System.Drawing.Size(240, 120); + this.panelChild3.TabIndex = 5; + this.panelChild3.Visible = false; + // + // btnChild3 + // + this.btnChild3.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnChild3.Location = new System.Drawing.Point(82, 0); + this.btnChild3.Name = "btnChild3"; + this.btnChild3.Size = new System.Drawing.Size(156, 118); + this.btnChild3.TabIndex = 1; + this.btnChild3.Text = "Child 3"; + this.btnChild3.UseVisualStyleBackColor = true; + // + // picturebox_child3 + // + this.picturebox_child3.Dock = System.Windows.Forms.DockStyle.Left; + this.picturebox_child3.Location = new System.Drawing.Point(0, 0); + this.picturebox_child3.Name = "picturebox_child3"; + this.picturebox_child3.Size = new System.Drawing.Size(82, 118); + this.picturebox_child3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picturebox_child3.TabIndex = 0; + this.picturebox_child3.TabStop = false; + // + // panelChild4 + // + this.panelChild4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelChild4.Controls.Add(this.lblNoChildren); + this.panelChild4.Controls.Add(this.btnChild4); + this.panelChild4.Controls.Add(this.picturebox_child4); + this.panelChild4.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelChild4.Location = new System.Drawing.Point(3, 129); + this.panelChild4.Name = "panelChild4"; + this.panelChild4.Size = new System.Drawing.Size(238, 120); + this.panelChild4.TabIndex = 6; + this.panelChild4.Visible = false; + // + // lblNoChildren + // + this.lblNoChildren.AutoSize = true; + this.lblNoChildren.Location = new System.Drawing.Point(80, 40); + this.lblNoChildren.Name = "lblNoChildren"; + this.lblNoChildren.Size = new System.Drawing.Size(563, 17); + this.lblNoChildren.TabIndex = 2; + this.lblNoChildren.Text = "You don\'t have any children. Please have an admin assign your children in the pro" + + "gram."; + this.lblNoChildren.Visible = false; + // + // btnChild4 + // + this.btnChild4.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnChild4.Location = new System.Drawing.Point(82, 0); + this.btnChild4.Name = "btnChild4"; + this.btnChild4.Size = new System.Drawing.Size(154, 118); + this.btnChild4.TabIndex = 1; + this.btnChild4.Text = "Child 4"; + this.btnChild4.UseVisualStyleBackColor = true; + // + // picturebox_child4 + // + this.picturebox_child4.Dock = System.Windows.Forms.DockStyle.Left; + this.picturebox_child4.Location = new System.Drawing.Point(0, 0); + this.picturebox_child4.Name = "picturebox_child4"; + this.picturebox_child4.Size = new System.Drawing.Size(82, 118); + this.picturebox_child4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picturebox_child4.TabIndex = 0; + this.picturebox_child4.TabStop = false; + // + // panelChild5 + // + this.panelChild5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelChild5.Controls.Add(this.btnChild5); + this.panelChild5.Controls.Add(this.picturebox_child5); + this.panelChild5.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelChild5.Location = new System.Drawing.Point(247, 129); + this.panelChild5.Name = "panelChild5"; + this.panelChild5.Size = new System.Drawing.Size(238, 120); + this.panelChild5.TabIndex = 7; + this.panelChild5.Visible = false; + // + // btnChild5 + // + this.btnChild5.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnChild5.Location = new System.Drawing.Point(82, 0); + this.btnChild5.Name = "btnChild5"; + this.btnChild5.Size = new System.Drawing.Size(154, 118); + this.btnChild5.TabIndex = 1; + this.btnChild5.Text = "Child 5"; + this.btnChild5.UseVisualStyleBackColor = true; + // + // picturebox_child5 + // + this.picturebox_child5.Dock = System.Windows.Forms.DockStyle.Left; + this.picturebox_child5.Location = new System.Drawing.Point(0, 0); + this.picturebox_child5.Name = "picturebox_child5"; + this.picturebox_child5.Size = new System.Drawing.Size(82, 118); + this.picturebox_child5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picturebox_child5.TabIndex = 0; + this.picturebox_child5.TabStop = false; + // + // panelChild6 + // + this.panelChild6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelChild6.Controls.Add(this.btnChild6); + this.panelChild6.Controls.Add(this.picturebox_child6); + this.panelChild6.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelChild6.Location = new System.Drawing.Point(491, 129); + this.panelChild6.Name = "panelChild6"; + this.panelChild6.Size = new System.Drawing.Size(240, 120); + this.panelChild6.TabIndex = 8; + this.panelChild6.Visible = false; + // + // btnChild6 + // + this.btnChild6.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnChild6.Location = new System.Drawing.Point(82, 0); + this.btnChild6.Name = "btnChild6"; + this.btnChild6.Size = new System.Drawing.Size(156, 118); + this.btnChild6.TabIndex = 1; + this.btnChild6.Text = "Child 6"; + this.btnChild6.UseVisualStyleBackColor = true; + // + // picturebox_child6 + // + this.picturebox_child6.Dock = System.Windows.Forms.DockStyle.Left; + this.picturebox_child6.Location = new System.Drawing.Point(0, 0); + this.picturebox_child6.Name = "picturebox_child6"; + this.picturebox_child6.Size = new System.Drawing.Size(82, 118); + this.picturebox_child6.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picturebox_child6.TabIndex = 0; + this.picturebox_child6.TabStop = false; + // + // panelChild7 + // + this.panelChild7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelChild7.Controls.Add(this.btnChild7); + this.panelChild7.Controls.Add(this.picturebox_child7); + this.panelChild7.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelChild7.Location = new System.Drawing.Point(3, 255); + this.panelChild7.Name = "panelChild7"; + this.panelChild7.Size = new System.Drawing.Size(238, 120); + this.panelChild7.TabIndex = 9; + this.panelChild7.Visible = false; + // + // btnChild7 + // + this.btnChild7.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnChild7.Location = new System.Drawing.Point(82, 0); + this.btnChild7.Name = "btnChild7"; + this.btnChild7.Size = new System.Drawing.Size(154, 118); + this.btnChild7.TabIndex = 1; + this.btnChild7.Text = "Child 7"; + this.btnChild7.UseVisualStyleBackColor = true; + // + // picturebox_child7 + // + this.picturebox_child7.Dock = System.Windows.Forms.DockStyle.Left; + this.picturebox_child7.Location = new System.Drawing.Point(0, 0); + this.picturebox_child7.Name = "picturebox_child7"; + this.picturebox_child7.Size = new System.Drawing.Size(82, 118); + this.picturebox_child7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picturebox_child7.TabIndex = 0; + this.picturebox_child7.TabStop = false; + // + // panelChild8 + // + this.panelChild8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelChild8.Controls.Add(this.btnChild8); + this.panelChild8.Controls.Add(this.picturebox_child8); + this.panelChild8.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelChild8.Location = new System.Drawing.Point(247, 255); + this.panelChild8.Name = "panelChild8"; + this.panelChild8.Size = new System.Drawing.Size(238, 120); + this.panelChild8.TabIndex = 10; + this.panelChild8.Visible = false; + // + // btnChild8 + // + this.btnChild8.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnChild8.Location = new System.Drawing.Point(82, 0); + this.btnChild8.Name = "btnChild8"; + this.btnChild8.Size = new System.Drawing.Size(154, 118); + this.btnChild8.TabIndex = 1; + this.btnChild8.Text = "Child 8"; + this.btnChild8.UseVisualStyleBackColor = true; + // + // picturebox_child8 + // + this.picturebox_child8.Dock = System.Windows.Forms.DockStyle.Left; + this.picturebox_child8.Location = new System.Drawing.Point(0, 0); + this.picturebox_child8.Name = "picturebox_child8"; + this.picturebox_child8.Size = new System.Drawing.Size(82, 118); + this.picturebox_child8.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picturebox_child8.TabIndex = 0; + this.picturebox_child8.TabStop = false; + // + // panelChild9 + // + this.panelChild9.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelChild9.Controls.Add(this.btnChild9); + this.panelChild9.Controls.Add(this.picturebox_child9); + this.panelChild9.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelChild9.Location = new System.Drawing.Point(491, 255); + this.panelChild9.Name = "panelChild9"; + this.panelChild9.Size = new System.Drawing.Size(240, 120); + this.panelChild9.TabIndex = 11; + this.panelChild9.Visible = false; + // + // btnChild9 + // + this.btnChild9.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnChild9.Location = new System.Drawing.Point(82, 0); + this.btnChild9.Name = "btnChild9"; + this.btnChild9.Size = new System.Drawing.Size(156, 118); + this.btnChild9.TabIndex = 1; + this.btnChild9.Text = "Child 9"; + this.btnChild9.UseVisualStyleBackColor = true; + // + // picturebox_child9 + // + this.picturebox_child9.Dock = System.Windows.Forms.DockStyle.Left; + this.picturebox_child9.Location = new System.Drawing.Point(0, 0); + this.picturebox_child9.Name = "picturebox_child9"; + this.picturebox_child9.Size = new System.Drawing.Size(82, 118); + this.picturebox_child9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picturebox_child9.TabIndex = 0; + this.picturebox_child9.TabStop = false; + // + // lblInstructions + // + this.lblInstructions.AutoSize = true; + this.lblInstructions.Location = new System.Drawing.Point(61, 24); + this.lblInstructions.Name = "lblInstructions"; + this.lblInstructions.Size = new System.Drawing.Size(573, 17); + this.lblInstructions.TabIndex = 2; + this.lblInstructions.Text = "Please press the button next to your child\'s photo to sign them in or out, then p" + + "ress Done."; + // + // btnDone + // + this.btnDone.Location = new System.Drawing.Point(781, 12); + this.btnDone.Name = "btnDone"; + this.btnDone.Size = new System.Drawing.Size(86, 41); + this.btnDone.TabIndex = 3; + this.btnDone.Text = "Done"; + this.btnDone.UseVisualStyleBackColor = true; + this.btnDone.Click += new System.EventHandler(this.btnDone_Click); + // // frmMainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); + this.ClientSize = new System.Drawing.Size(896, 472); + this.Controls.Add(this.btnDone); + this.Controls.Add(this.lblInstructions); + this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.btnAdmin); this.Name = "frmMainForm"; this.Text = "Main Screen"; this.Load += new System.EventHandler(this.frmMainForm_Load); + this.tableLayoutPanel1.ResumeLayout(false); + this.panelChild1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_Child1)).EndInit(); + this.panelChild2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child2)).EndInit(); + this.panelChild3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child3)).EndInit(); + this.panelChild4.ResumeLayout(false); + this.panelChild4.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child4)).EndInit(); + this.panelChild5.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child5)).EndInit(); + this.panelChild6.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child6)).EndInit(); + this.panelChild7.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child7)).EndInit(); + this.panelChild8.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child8)).EndInit(); + this.panelChild9.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picturebox_child9)).EndInit(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion private System.Windows.Forms.Button btnAdmin; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Panel panelChild1; + private System.Windows.Forms.PictureBox picturebox_Child1; + private System.Windows.Forms.Panel panelChild2; + private System.Windows.Forms.Panel panelChild3; + private System.Windows.Forms.Panel panelChild4; + private System.Windows.Forms.Panel panelChild5; + private System.Windows.Forms.Panel panelChild6; + private System.Windows.Forms.Panel panelChild7; + private System.Windows.Forms.Panel panelChild8; + private System.Windows.Forms.Panel panelChild9; + private System.Windows.Forms.Button btnChild2; + private System.Windows.Forms.PictureBox picturebox_child2; + private System.Windows.Forms.Button btnChild3; + private System.Windows.Forms.PictureBox picturebox_child3; + private System.Windows.Forms.Button btnChild4; + private System.Windows.Forms.PictureBox picturebox_child4; + private System.Windows.Forms.Button btnChild5; + private System.Windows.Forms.PictureBox picturebox_child5; + private System.Windows.Forms.Button btnChild6; + private System.Windows.Forms.PictureBox picturebox_child6; + private System.Windows.Forms.Button btnChild7; + private System.Windows.Forms.PictureBox picturebox_child7; + private System.Windows.Forms.Button btnChild8; + private System.Windows.Forms.PictureBox picturebox_child8; + private System.Windows.Forms.Button btnChild9; + private System.Windows.Forms.PictureBox picturebox_child9; + private System.Windows.Forms.Button btnChild1; + private System.Windows.Forms.Label lblNoChildren; + private System.Windows.Forms.Label lblInstructions; + private System.Windows.Forms.Button btnDone; } } \ No newline at end of file diff --git a/frmMainForm.cs b/frmMainForm.cs index 09c6222..c0c919b 100644 --- a/frmMainForm.cs +++ b/frmMainForm.cs @@ -26,6 +26,8 @@ namespace GreatHomeChildcare //TODO: Add admin button if guardian isAdmin = 1 private void frmMainForm_Load(object sender, EventArgs e) { + int i = 1; //for iteration + int guardian_pin = Int32.Parse(frmPinEntry.strPin); guardian = SqliteDataAccess.GetGuardianByPin(guardian_pin); List children = SqliteDataAccess.GetChildrenByGuardian(guardian); @@ -41,20 +43,72 @@ namespace GreatHomeChildcare btnAdmin.Enabled = true; } - //For each child, present a new button to sign the student in/out. - foreach (Child c in children) + //If the guardian has no children, show a message. + if (children == null) { - //Button b = new Button(); + lblNoChildren.Visible = true; + return; } - //TODO: remove once I figure out how to add new button, perhaps to a table layout panel. - Console.WriteLine("test"); + //For each child, present a new button to sign the student in/out. + //Max 9 children(!!) per guardian. We support Octomom! + foreach(Child child in children) + { + //Make sure we don't break the program. + //Keep it in your pants, man!! + if (i >= 10) + { + MessageBox.Show("Sorry, the program only supports 9 children per guardian.", "Great Home Childcare", MessageBoxButtons.OK, MessageBoxIcon.None); + break; + } + + Control controls = tableLayoutPanel1.Controls["panelChild" + i]; + controls.Visible = true; + PopulateButton(child, controls); + i++; + } } + private void PopulateButton(Child child_in, Control controls_in) + { + Control.ControlCollection nested_controls = controls_in.Controls; + foreach(Control c in nested_controls) + { + if (c is PictureBox) + { + PictureBox pb = (PictureBox)c; + pb.Image = child_in.photo == null ? Properties.Resources.child : ImageWrangler.ByteArrayToImage(child_in.photo); + } + + if (c is Button) + { + Button btn = (Button)c; + + string btnText = child_in.DisplayName + "\n\r" + + child_in.gender + "\n\r" + + child_in.DOB + "\n\r" + + "CHECKOUT STATUS"; + + //TODO: Find a way to bind the child_in data to the button to reuse it when the button is clicked. + //btn.DataBindings.Add("childdata", child_in,); + Console.WriteLine("blaaaha"); + } + } //foreach control + } //TODO: implement via another form. private void btnAdmin_Click(object sender, EventArgs e) { MessageBox.Show("The admin button was clicked."); } + + private void btnDone_Click(object sender, EventArgs e) + { + Close(); + } + + private void btnChild_Click(object sender, EventArgs e) + { + + } } }