From b8830b843d4fb54d76c91ef585cd188aa8e3ea21 Mon Sep 17 00:00:00 2001 From: caschick221 Date: Mon, 19 Feb 2024 14:19:36 -0500 Subject: [PATCH] added quality of life features to patient and physician search/update/edit/cancel --- .../frmInfo.Designer.cs | 19 +- Louis'-Pharmacy_CNSA212-FP/frmInfo.cs | 55 +++- .../frmPatient.Designer.cs | 6 +- Louis'-Pharmacy_CNSA212-FP/frmPatient.cs | 282 ++++++++---------- .../frmPhysician.Designer.cs | 156 ++++++---- Louis'-Pharmacy_CNSA212-FP/frmPhysician.cs | 11 + 6 files changed, 295 insertions(+), 234 deletions(-) diff --git a/Louis'-Pharmacy_CNSA212-FP/frmInfo.Designer.cs b/Louis'-Pharmacy_CNSA212-FP/frmInfo.Designer.cs index 8c6f1bf..2635866 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmInfo.Designer.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmInfo.Designer.cs @@ -185,7 +185,7 @@ namespace Louis__Pharmacy_CNSA212_FP this.tbcInfo.Name = "tbcInfo"; this.tbcInfo.SelectedIndex = 0; this.tbcInfo.Size = new System.Drawing.Size(1111, 785); - this.tbcInfo.TabIndex = 1; + this.tbcInfo.TabIndex = 999999; // // tbpPatient // @@ -232,7 +232,7 @@ namespace Louis__Pharmacy_CNSA212_FP this.txtPatientID.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtPatientID.Name = "txtPatientID"; this.txtPatientID.Size = new System.Drawing.Size(148, 26); - this.txtPatientID.TabIndex = 8; + this.txtPatientID.TabIndex = 3; // // lblPatientID // @@ -250,7 +250,7 @@ namespace Louis__Pharmacy_CNSA212_FP this.txtPatientLast.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtPatientLast.Name = "txtPatientLast"; this.txtPatientLast.Size = new System.Drawing.Size(148, 26); - this.txtPatientLast.TabIndex = 6; + this.txtPatientLast.TabIndex = 2; // // txtPatientFirst // @@ -258,7 +258,7 @@ namespace Louis__Pharmacy_CNSA212_FP this.txtPatientFirst.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtPatientFirst.Name = "txtPatientFirst"; this.txtPatientFirst.Size = new System.Drawing.Size(148, 26); - this.txtPatientFirst.TabIndex = 5; + this.txtPatientFirst.TabIndex = 1; // // btnPatientSearch // @@ -287,7 +287,7 @@ namespace Louis__Pharmacy_CNSA212_FP this.dgvPatient.ReadOnly = true; this.dgvPatient.RowHeadersWidth = 51; this.dgvPatient.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dgvPatient.Size = new System.Drawing.Size(992, 354); + this.dgvPatient.Size = new System.Drawing.Size(1099, 411); this.dgvPatient.TabIndex = 0; this.dgvPatient.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPatient_CellContentClick); // @@ -680,7 +680,7 @@ namespace Louis__Pharmacy_CNSA212_FP this.txtPhysicianID.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtPhysicianID.Name = "txtPhysicianID"; this.txtPhysicianID.Size = new System.Drawing.Size(148, 26); - this.txtPhysicianID.TabIndex = 8; + this.txtPhysicianID.TabIndex = 3; // // lblPhysicianID // @@ -698,7 +698,7 @@ namespace Louis__Pharmacy_CNSA212_FP this.txtPhysicianLast.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtPhysicianLast.Name = "txtPhysicianLast"; this.txtPhysicianLast.Size = new System.Drawing.Size(148, 26); - this.txtPhysicianLast.TabIndex = 6; + this.txtPhysicianLast.TabIndex = 2; // // txtPhysicianFirst // @@ -706,7 +706,7 @@ namespace Louis__Pharmacy_CNSA212_FP this.txtPhysicianFirst.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtPhysicianFirst.Name = "txtPhysicianFirst"; this.txtPhysicianFirst.Size = new System.Drawing.Size(148, 26); - this.txtPhysicianFirst.TabIndex = 5; + this.txtPhysicianFirst.TabIndex = 1; // // btnPhysicianSearch // @@ -731,7 +731,6 @@ namespace Louis__Pharmacy_CNSA212_FP this.dgvPhysician.Name = "dgvPhysician"; this.dgvPhysician.ReadOnly = true; this.dgvPhysician.RowHeadersWidth = 51; - this.dgvPhysician.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal; this.dgvPhysician.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgvPhysician.Size = new System.Drawing.Size(1091, 404); this.dgvPhysician.TabIndex = 0; @@ -871,7 +870,7 @@ namespace Louis__Pharmacy_CNSA212_FP // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1142, 817); + this.ClientSize = new System.Drawing.Size(1166, 885); this.Controls.Add(this.tbcInfo); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "frmInfo"; diff --git a/Louis'-Pharmacy_CNSA212-FP/frmInfo.cs b/Louis'-Pharmacy_CNSA212-FP/frmInfo.cs index 039a6c9..d4f7a43 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmInfo.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmInfo.cs @@ -25,6 +25,8 @@ namespace Louis__Pharmacy_CNSA212_FP dgvPatient.DoubleClick += cmuPatientEdit_Click; dgvPhysician.DoubleClick += cmuPhysicianEdit_Click; + tbcInfo.SelectedIndexChanged += frmInfoTabChange; + } private void frmInfo_Load(object sender, EventArgs e) @@ -39,19 +41,58 @@ namespace Louis__Pharmacy_CNSA212_FP txtPatientFirst.Focus(); + patientIsActive = true; + + } + + private bool physicianIsActive = false; + private bool patientIsActive = false; + private void frmInfoTabChange(object sender, EventArgs e) + { + + Console.WriteLine(tbcInfo.SelectedIndex); + + patientIsActive = false; + physicianIsActive = false; + + if (tbcInfo.SelectedIndex == 0) + { + patientIsActive = true; + }else if (tbcInfo.SelectedIndex == 2) + { + physicianIsActive = true; + } + } private void frmInfo_KeyDown(object sender, KeyEventArgs e) { - // esc not funtional - if (e.KeyCode == Keys.Escape) // Check if the pressed key is Escape - {this.Close(); // Close the form + // if data grid view is not focused, run the search function + if (e.KeyCode == Keys.Escape) + {this.Close(); } - if (e.KeyCode == Keys.Enter){ - btnPatientSearch_Click(sender, e); + if (e.KeyCode == Keys.Enter && physicianIsActive && !dgvPhysician.Focused){ btnPhysicianSearch_Click(sender, e); } + // if data grid view is focused, run the edit function + else if (e.KeyCode == Keys.Enter && physicianIsActive && dgvPhysician.Focused) + { + cmuPhysicianEdit_Click(sender, e); + } + + // if data grid view is not focused, run the search function + if (e.KeyCode == Keys.Enter && patientIsActive && !dgvPatient.Focused) + { + btnPatientSearch_Click(sender,e); + } + // if data grid view is focused, run the edit function + else if (e.KeyCode == Keys.Enter && patientIsActive && dgvPatient.Focused) + { + cmuPatientEdit_Click(sender,e); + } + + } @@ -153,6 +194,7 @@ namespace Louis__Pharmacy_CNSA212_FP cmuPatientEdit.Enabled = dgvPatient.Rows.Count > 0; cmuPatientDelete.Enabled = dgvPatient.Rows.Count > 0; + dgvPatient.Focus(); } @@ -311,7 +353,8 @@ namespace Louis__Pharmacy_CNSA212_FP } } - + + dgvPhysician.Focus(); } diff --git a/Louis'-Pharmacy_CNSA212-FP/frmPatient.Designer.cs b/Louis'-Pharmacy_CNSA212-FP/frmPatient.Designer.cs index 4ffbf8f..46b6eae 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmPatient.Designer.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmPatient.Designer.cs @@ -323,17 +323,17 @@ namespace Louis__Pharmacy_CNSA212_FP this.btnClose.Location = new System.Drawing.Point(1011, 600); this.btnClose.Name = "btnClose"; this.btnClose.Size = new System.Drawing.Size(112, 35); - this.btnClose.TabIndex = 27; + this.btnClose.TabIndex = 15; this.btnClose.Text = "Close"; this.btnClose.UseVisualStyleBackColor = true; this.btnClose.Click += new System.EventHandler(this.btnClose_Click); // - // frmPatientAdd + // frmPatient // this.AcceptButton = this.btnGO; this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1212, 726); + this.ClientSize = new System.Drawing.Size(1218, 743); this.Controls.Add(this.btnClose); this.Controls.Add(this.btnGO); this.Controls.Add(this.lblDisPurpose); diff --git a/Louis'-Pharmacy_CNSA212-FP/frmPatient.cs b/Louis'-Pharmacy_CNSA212-FP/frmPatient.cs index 4d1637e..bf9d355 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmPatient.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmPatient.cs @@ -8,13 +8,12 @@ namespace Louis__Pharmacy_CNSA212_FP { private static bool isAdd; - private frmInfo SourceForm; + private readonly frmInfo SourceForm; public frmPatient(frmInfo sourceForm, bool isNew) { - SourceForm = sourceForm; - + isAdd = isNew; InitializeComponent(); @@ -30,7 +29,18 @@ namespace Louis__Pharmacy_CNSA212_FP lblDisPurpose.Text = "Edit Patient"; btnGO.Text = "Update"; } - + + KeyPreview = true; + KeyDown += frmPatient_KeyDown; + } + + + private void frmPatient_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Escape) + Close(); + + if (e.KeyCode == Keys.Enter) btnGO_Click(sender, e); } @@ -93,7 +103,6 @@ namespace Louis__Pharmacy_CNSA212_FP if (!isAdd) - { try { lbs = int.Parse(txtWeight.Text); @@ -126,13 +135,8 @@ namespace Louis__Pharmacy_CNSA212_FP epLocal.SetError(txtPatientID, "Error"); throw new Exception(); } - else - { - while (Patient_id.Length < 8) - { - Patient_id = "0" + Patient_id; - } - } + + while (Patient_id.Length < 8) Patient_id = "0" + Patient_id; if (FirstName.Length > 30) { @@ -151,10 +155,8 @@ namespace Louis__Pharmacy_CNSA212_FP epLocal.SetError(txtMidInit, "Error"); throw new Exception(); } - else - { - MiddleIntials = MiddleIntials.ToUpper(); - } + + MiddleIntials = MiddleIntials.ToUpper(); if (Zip > 65535) { @@ -173,10 +175,8 @@ namespace Louis__Pharmacy_CNSA212_FP epLocal.SetError(txtState, "Error"); throw new Exception(); } - else - { - UsState = UsState.ToUpper(); - } + + UsState = UsState.ToUpper(); if (lbs > 2147483647) { @@ -207,10 +207,8 @@ namespace Louis__Pharmacy_CNSA212_FP epLocal.SetError(txtGender, "Error"); throw new Exception(); } - else - { - Gender = Gender.ToUpper(); - } + + Gender = Gender.ToUpper(); PharmacyDataTier.UpdatePatient( Patient_id, @@ -228,11 +226,10 @@ namespace Louis__Pharmacy_CNSA212_FP PhoneNumber); - SourceForm.txtPatientID.Text = Patient_id.ToString(); + SourceForm.txtPatientID.Text = Patient_id; SourceForm.btnPatientSearch_Click(SourceForm, e); - + Close(); - } catch (Exception exception) { @@ -278,194 +275,179 @@ namespace Louis__Pharmacy_CNSA212_FP { epLocal.SetError(txtWeight, "Invalid Value"); } - }else if (isAdd) - { - try - { - lbs = int.Parse(txtWeight.Text); + else if (isAdd) try { - Height_feet = int.Parse(txtHeightFt.Text); + lbs = int.Parse(txtWeight.Text); try { - Height_inches = int.Parse(txtHeightIn.Text); + Height_feet = int.Parse(txtHeightFt.Text); try { - DOB = DateTime.Parse(txtDOB.Text); + Height_inches = int.Parse(txtHeightIn.Text); try { - Gender = txtGender.Text; + DOB = DateTime.Parse(txtDOB.Text); try { - Zip = short.Parse(txtZip.Text); + Gender = txtGender.Text; try { - UsState = txtState.Text; + Zip = short.Parse(txtZip.Text); try { - PhoneNumber = txtPhone.Text; - + UsState = txtState.Text; try { - if (Patient_id.Length > 8) + PhoneNumber = txtPhone.Text; + + try { - epLocal.SetError(txtPatientID, "Error"); - throw new Exception(); - } - else - { - while (Patient_id.Length < 8) + if (Patient_id.Length > 8) { - Patient_id = "0" + Patient_id; + epLocal.SetError(txtPatientID, "Error"); + throw new Exception(); } - } - if (FirstName.Length > 30) - { - epLocal.SetError(txtFname, "Error"); - throw new Exception(); - } + while (Patient_id.Length < 8) Patient_id = "0" + Patient_id; - if (LastName.Length > 30) - { - epLocal.SetError(txtLname, "Error"); - throw new Exception(); - } + if (FirstName.Length > 30) + { + epLocal.SetError(txtFname, "Error"); + throw new Exception(); + } + + if (LastName.Length > 30) + { + epLocal.SetError(txtLname, "Error"); + throw new Exception(); + } + + if (MiddleIntials.Length > 1) + { + epLocal.SetError(txtMidInit, "Error"); + throw new Exception(); + } - if (MiddleIntials.Length > 1) - { - epLocal.SetError(txtMidInit, "Error"); - throw new Exception(); - } - else - { MiddleIntials = MiddleIntials.ToUpper(); - } - if (Zip > 65535) - { - epLocal.SetError(txtZip, "Error"); - throw new Exception(); - } + if (Zip > 65535) + { + epLocal.SetError(txtZip, "Error"); + throw new Exception(); + } - if (City.Length > 30) - { - epLocal.SetError(txtCity, "Error"); - throw new Exception(); - } + if (City.Length > 30) + { + epLocal.SetError(txtCity, "Error"); + throw new Exception(); + } + + if (UsState.Length > 2) + { + epLocal.SetError(txtState, "Error"); + throw new Exception(); + } - if (UsState.Length > 2) - { - epLocal.SetError(txtState, "Error"); - throw new Exception(); - } - else - { UsState = UsState.ToUpper(); - } - if (lbs > 2147483647) - { - epLocal.SetError(txtWeight, "Error"); - throw new Exception(); - } + if (lbs > 2147483647) + { + epLocal.SetError(txtWeight, "Error"); + throw new Exception(); + } - if (Height_feet > 2147483647) - { - epLocal.SetError(txtHeightFt, "Error"); - throw new Exception(); - } + if (Height_feet > 2147483647) + { + epLocal.SetError(txtHeightFt, "Error"); + throw new Exception(); + } - if (Height_inches > 2147483647) - { - epLocal.SetError(txtHeightIn, "Error"); - throw new Exception(); - } + if (Height_inches > 2147483647) + { + epLocal.SetError(txtHeightIn, "Error"); + throw new Exception(); + } - if (PhoneNumber.Length > 14) - { - epLocal.SetError(txtPhone, "Error"); - throw new Exception(); - } + if (PhoneNumber.Length > 14) + { + epLocal.SetError(txtPhone, "Error"); + throw new Exception(); + } + + if (Gender.Length > 1) + { + epLocal.SetError(txtGender, "Error"); + throw new Exception(); + } - if (Gender.Length > 1) - { - epLocal.SetError(txtGender, "Error"); - throw new Exception(); - } - else - { Gender = Gender.ToUpper(); + + PharmacyDataTier.CreatePatient( + Patient_id, + FirstName, + LastName, + MiddleIntials, + lbs, + Height_feet, + Height_inches, + DOB, + Gender, + City, + Zip, + UsState, + PhoneNumber); + + + SourceForm.txtPatientID.Text = Patient_id; + SourceForm.btnPatientSearch_Click(SourceForm, e); + + Close(); + } + catch (Exception exception) + { + epLocal.SetError(btnGO, "Error Creating Patient"); } - - PharmacyDataTier.CreatePatient( - Patient_id, - FirstName, - LastName, - MiddleIntials, - lbs, - Height_feet, - Height_inches, - DOB, - Gender, - City, - Zip, - UsState, - PhoneNumber); - - - SourceForm.txtPatientID.Text = Patient_id.ToString(); - SourceForm.btnPatientSearch_Click(SourceForm, e); - - Close(); - } - catch (Exception exception) + catch (Exception ex) { - epLocal.SetError(btnGO, "Error Creating Patient"); + epLocal.SetError(txtPhone, "Invalid Value"); } } catch (Exception ex) { - epLocal.SetError(txtPhone, "Invalid Value"); + epLocal.SetError(txtState, "Invalid Value"); } } catch (Exception ex) { - epLocal.SetError(txtState, "Invalid Value"); + epLocal.SetError(txtZip, "Invalid Value"); } } catch (Exception ex) { - epLocal.SetError(txtZip, "Invalid Value"); + epLocal.SetError(txtGender, "Invalid Value"); } } catch (Exception ex) { - epLocal.SetError(txtGender, "Invalid Value"); + epLocal.SetError(txtDOB, "Invalid Value"); } } catch (Exception ex) { - epLocal.SetError(txtDOB, "Invalid Value"); + epLocal.SetError(txtHeightIn, "Invalid Value"); } } catch (Exception ex) { - epLocal.SetError(txtHeightIn, "Invalid Value"); + epLocal.SetError(txtHeightFt, "Invalid Value"); } } catch (Exception ex) { - epLocal.SetError(txtHeightFt, "Invalid Value"); + epLocal.SetError(txtWeight, "Invalid Value"); } - } - catch (Exception ex) - { - epLocal.SetError(txtWeight, "Invalid Value"); - } - } - } private void btnClose_Click(object sender, EventArgs e) diff --git a/Louis'-Pharmacy_CNSA212-FP/frmPhysician.Designer.cs b/Louis'-Pharmacy_CNSA212-FP/frmPhysician.Designer.cs index ead872f..6925bb3 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmPhysician.Designer.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmPhysician.Designer.cs @@ -61,212 +61,237 @@ namespace Louis__Pharmacy_CNSA212_FP // lblDisPurpose // this.lblDisPurpose.Font = new System.Drawing.Font("Microsoft Sans Serif", 28.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblDisPurpose.Location = new System.Drawing.Point(218, 23); + this.lblDisPurpose.Location = new System.Drawing.Point(327, 35); + this.lblDisPurpose.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblDisPurpose.Name = "lblDisPurpose"; - this.lblDisPurpose.Size = new System.Drawing.Size(360, 54); + this.lblDisPurpose.Size = new System.Drawing.Size(540, 83); this.lblDisPurpose.TabIndex = 0; this.lblDisPurpose.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // btnGO // - this.btnGO.Location = new System.Drawing.Point(573, 401); + this.btnGO.Location = new System.Drawing.Point(860, 617); + this.btnGO.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.btnGO.Name = "btnGO"; - this.btnGO.Size = new System.Drawing.Size(75, 23); - this.btnGO.TabIndex = 1; + this.btnGO.Size = new System.Drawing.Size(112, 35); + this.btnGO.TabIndex = 12; this.btnGO.UseVisualStyleBackColor = true; this.btnGO.Click += new System.EventHandler(this.btnGO_Click); // // btnClose // - this.btnClose.Location = new System.Drawing.Point(680, 401); + this.btnClose.Location = new System.Drawing.Point(1020, 617); + this.btnClose.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.btnClose.Name = "btnClose"; - this.btnClose.Size = new System.Drawing.Size(75, 23); - this.btnClose.TabIndex = 2; + this.btnClose.Size = new System.Drawing.Size(112, 35); + this.btnClose.TabIndex = 13; this.btnClose.Text = "Close"; this.btnClose.UseVisualStyleBackColor = true; this.btnClose.Click += new System.EventHandler(this.btnClose_Click); // // label1 // - this.label1.Location = new System.Drawing.Point(116, 127); + this.label1.Location = new System.Drawing.Point(174, 195); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(123, 30); + this.label1.Size = new System.Drawing.Size(184, 46); this.label1.TabIndex = 3; this.label1.Text = "Physician ID:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // - this.label2.Location = new System.Drawing.Point(116, 157); + this.label2.Location = new System.Drawing.Point(174, 242); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(123, 30); + this.label2.Size = new System.Drawing.Size(184, 46); this.label2.TabIndex = 4; this.label2.Text = "First Name:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label3 // - this.label3.Location = new System.Drawing.Point(116, 187); + this.label3.Location = new System.Drawing.Point(174, 288); + this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(123, 30); + this.label3.Size = new System.Drawing.Size(184, 46); this.label3.TabIndex = 5; this.label3.Text = "Last Name:"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label4 // - this.label4.Location = new System.Drawing.Point(116, 217); + this.label4.Location = new System.Drawing.Point(174, 334); + this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(123, 30); + this.label4.Size = new System.Drawing.Size(184, 46); this.label4.TabIndex = 6; this.label4.Text = "Middle Initial:"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label5 // - this.label5.Location = new System.Drawing.Point(116, 247); + this.label5.Location = new System.Drawing.Point(174, 380); + this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(123, 30); + this.label5.Size = new System.Drawing.Size(184, 46); this.label5.TabIndex = 7; this.label5.Text = "Date of Birth:"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label6 // - this.label6.Location = new System.Drawing.Point(404, 127); + this.label6.Location = new System.Drawing.Point(606, 195); + this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(123, 30); + this.label6.Size = new System.Drawing.Size(184, 46); this.label6.TabIndex = 8; this.label6.Text = "City:"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label7 // - this.label7.Location = new System.Drawing.Point(404, 157); + this.label7.Location = new System.Drawing.Point(606, 242); + this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(123, 30); + this.label7.Size = new System.Drawing.Size(184, 46); this.label7.TabIndex = 9; this.label7.Text = "State:"; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label8 // - this.label8.Location = new System.Drawing.Point(404, 187); + this.label8.Location = new System.Drawing.Point(606, 288); + this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(123, 30); + this.label8.Size = new System.Drawing.Size(184, 46); this.label8.TabIndex = 10; this.label8.Text = "Zip Code:"; this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label9 // - this.label9.Location = new System.Drawing.Point(116, 277); + this.label9.Location = new System.Drawing.Point(174, 426); + this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(123, 30); + this.label9.Size = new System.Drawing.Size(184, 46); this.label9.TabIndex = 11; this.label9.Text = "Gender (M/F):"; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label10 // - this.label10.Location = new System.Drawing.Point(404, 217); + this.label10.Location = new System.Drawing.Point(606, 334); + this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(123, 30); + this.label10.Size = new System.Drawing.Size(184, 46); this.label10.TabIndex = 12; this.label10.Text = "Phone Number:"; this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label11 // - this.label11.Location = new System.Drawing.Point(116, 307); + this.label11.Location = new System.Drawing.Point(174, 472); + this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(123, 30); + this.label11.Size = new System.Drawing.Size(184, 46); this.label11.TabIndex = 13; this.label11.Text = "Speciality"; this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // txtPhyID // - this.txtPhyID.Location = new System.Drawing.Point(245, 133); + this.txtPhyID.Location = new System.Drawing.Point(368, 205); + this.txtPhyID.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtPhyID.Name = "txtPhyID"; - this.txtPhyID.Size = new System.Drawing.Size(100, 20); - this.txtPhyID.TabIndex = 14; + this.txtPhyID.Size = new System.Drawing.Size(148, 26); + this.txtPhyID.TabIndex = 1; // // txtFirstName // - this.txtFirstName.Location = new System.Drawing.Point(245, 163); + this.txtFirstName.Location = new System.Drawing.Point(368, 251); + this.txtFirstName.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtFirstName.Name = "txtFirstName"; - this.txtFirstName.Size = new System.Drawing.Size(100, 20); - this.txtFirstName.TabIndex = 15; + this.txtFirstName.Size = new System.Drawing.Size(148, 26); + this.txtFirstName.TabIndex = 2; // // txtLastName // - this.txtLastName.Location = new System.Drawing.Point(245, 193); + this.txtLastName.Location = new System.Drawing.Point(368, 297); + this.txtLastName.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtLastName.Name = "txtLastName"; - this.txtLastName.Size = new System.Drawing.Size(100, 20); - this.txtLastName.TabIndex = 16; + this.txtLastName.Size = new System.Drawing.Size(148, 26); + this.txtLastName.TabIndex = 3; // // txtMiddleInit // - this.txtMiddleInit.Location = new System.Drawing.Point(245, 223); + this.txtMiddleInit.Location = new System.Drawing.Point(368, 343); + this.txtMiddleInit.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtMiddleInit.Name = "txtMiddleInit"; - this.txtMiddleInit.Size = new System.Drawing.Size(100, 20); - this.txtMiddleInit.TabIndex = 17; + this.txtMiddleInit.Size = new System.Drawing.Size(148, 26); + this.txtMiddleInit.TabIndex = 4; // // txtDOB // - this.txtDOB.Location = new System.Drawing.Point(245, 253); + this.txtDOB.Location = new System.Drawing.Point(368, 389); + this.txtDOB.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtDOB.Name = "txtDOB"; - this.txtDOB.Size = new System.Drawing.Size(100, 20); - this.txtDOB.TabIndex = 18; + this.txtDOB.Size = new System.Drawing.Size(148, 26); + this.txtDOB.TabIndex = 5; // // txtGender // - this.txtGender.Location = new System.Drawing.Point(245, 283); + this.txtGender.Location = new System.Drawing.Point(368, 435); + this.txtGender.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtGender.Name = "txtGender"; - this.txtGender.Size = new System.Drawing.Size(100, 20); - this.txtGender.TabIndex = 19; + this.txtGender.Size = new System.Drawing.Size(148, 26); + this.txtGender.TabIndex = 6; // // txtSpeciality // - this.txtSpeciality.Location = new System.Drawing.Point(245, 313); + this.txtSpeciality.Location = new System.Drawing.Point(368, 482); + this.txtSpeciality.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtSpeciality.Name = "txtSpeciality"; - this.txtSpeciality.Size = new System.Drawing.Size(100, 20); - this.txtSpeciality.TabIndex = 20; + this.txtSpeciality.Size = new System.Drawing.Size(148, 26); + this.txtSpeciality.TabIndex = 7; // // txtCity // - this.txtCity.Location = new System.Drawing.Point(533, 133); + this.txtCity.Location = new System.Drawing.Point(800, 205); + this.txtCity.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtCity.Name = "txtCity"; - this.txtCity.Size = new System.Drawing.Size(100, 20); - this.txtCity.TabIndex = 21; + this.txtCity.Size = new System.Drawing.Size(148, 26); + this.txtCity.TabIndex = 8; // // txtState // - this.txtState.Location = new System.Drawing.Point(533, 163); + this.txtState.Location = new System.Drawing.Point(800, 251); + this.txtState.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtState.Name = "txtState"; - this.txtState.Size = new System.Drawing.Size(100, 20); - this.txtState.TabIndex = 22; + this.txtState.Size = new System.Drawing.Size(148, 26); + this.txtState.TabIndex = 9; // // txtZip // - this.txtZip.Location = new System.Drawing.Point(533, 193); + this.txtZip.Location = new System.Drawing.Point(800, 297); + this.txtZip.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtZip.Name = "txtZip"; - this.txtZip.Size = new System.Drawing.Size(100, 20); - this.txtZip.TabIndex = 23; + this.txtZip.Size = new System.Drawing.Size(148, 26); + this.txtZip.TabIndex = 10; // // txtPhone // - this.txtPhone.Location = new System.Drawing.Point(533, 223); + this.txtPhone.Location = new System.Drawing.Point(800, 343); + this.txtPhone.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtPhone.Name = "txtPhone"; - this.txtPhone.Size = new System.Drawing.Size(100, 20); - this.txtPhone.TabIndex = 24; + this.txtPhone.Size = new System.Drawing.Size(148, 26); + this.txtPhone.TabIndex = 11; // // frmPhysician // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); + this.ClientSize = new System.Drawing.Size(1200, 692); this.Controls.Add(this.txtPhone); this.Controls.Add(this.txtZip); this.Controls.Add(this.txtState); @@ -292,6 +317,7 @@ namespace Louis__Pharmacy_CNSA212_FP this.Controls.Add(this.btnClose); this.Controls.Add(this.btnGO); this.Controls.Add(this.lblDisPurpose); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.Name = "frmPhysician"; this.Text = "frmPhysician"; this.Load += new System.EventHandler(this.frmPhysician_Load); diff --git a/Louis'-Pharmacy_CNSA212-FP/frmPhysician.cs b/Louis'-Pharmacy_CNSA212-FP/frmPhysician.cs index 45cb088..3308821 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmPhysician.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmPhysician.cs @@ -28,6 +28,17 @@ namespace Louis__Pharmacy_CNSA212_FP lblDisPurpose.Text = "Edit Physician"; btnGO.Text = "Update"; } + KeyPreview = true; + KeyDown += frmPhysician_KeyDown; + } + + + private void frmPhysician_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Escape) + Close(); + + if (e.KeyCode == Keys.Enter) btnGO_Click(sender, e); } private void btnClose_Click(object sender, EventArgs e)