please code in c#.
please note that im a complete beginner.
northwind.mdf.
northwind_log.ldf
OrderDetailsMaintenance.zip
1. Include the two above files in the root of your OrderDetailsMaintenance project.
2. Make sure to mark them as "Content" and "Copy Always" or "Copy if newer" in the properties
window of those two files.
3. Run the Scaffold-DbContext command to create a context class as well as a class to
encapsulate the Orders objects from the associated table in the mdf file. Make sure to include the
parameters for -Tables Customers (only worry about the attributes associated with the text boxes,
you don't need to worry about any other rows from the table)
4. Once you have ran the command, include an app.config file and add a connection string
element. Make sure to copy the connection string from your Context class to your app.config.
Then edit your context to grab the connection string from the app.config
(ConfigurationManager.ConnectionString["Northwind"].ConnectionString)
5. Code the Find button to Find the customer id and populate the details in the below text boxes.
1. If no order is found, display a message box.
6. Code the exit button
7. Code the Save button to update its attributes and call Update and SaveChanges() on that
particular entity.
1. Note: If you close the program, reopen it, and search for the entity you recently updated. You
may not see the changes depending on how you setup the mdf file in your project (because it
copies a new version to the bin directory each time you run the program). So, if you don't see
your changes, don't be alarmed.
============
HERE IS WHAT I HAVE SO FAR
frmCustomerMaintenance.cs
namespace OrderDetailsMaintenance
{
public partial class frmCustomerMaintenance : Form
{
public frmCustomerMaintenance()
{
InitializeComponent();
}
}
}
frmCustomerMaintenance.resx
<root>
<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>
Program.cs
namespace OrderDetailsMaintenance
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new frmCustomerMaintenance());
}
}
}
Validator.cs
namespace OrderDetailsMaintenance
{
public static class Validator
{
private static string title = "Entry Error";
public static string Title
{
get => title;
set => title = value;
}
public static bool IsPresent(TextBox textBox)
{
if (textBox.Text == "")
{
MessageBox.Show(textBox.Tag + " is a required field.", Title);
textBox.Focus();
return false;
}
return true;
}
public static bool IsDecimal(TextBox textBox)
{
decimal number = 0m;
if (Decimal.TryParse(textBox.Text, out number))
{
return true;
}
else
{
MessageBox.Show(textBox.Tag + " must be a decimal value.", Title);
textBox.Focus();
return false;
}
}
public static bool IsInt32(TextBox textBox)
{
int number = 0;
if (Int32.TryParse(textBox.Text, out number))
{
return true;
}
else
{
MessageBox.Show(textBox.Tag + " must be an integer.", Title);
textBox.Focus();
return false;
}
}
public static bool IsWithinRange(TextBox textBox, decimal min, decimal max)
{
decimal number = Convert.ToDecimal(textBox.Text);
if (number < min || number > max)
{
MessageBox.Show(textBox.Tag + " must be between " + min
+ " and " + max + ".", Title);
textBox.Focus();
return false;
}
return true;
}
}
}
frmCustomerMaintenance.Designer.cs
namespace OrderDetailsMaintenance
{
partial class frmCustomerMaintenance
{
/// <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.label1 = new System.Windows.Forms.Label();
this.btnFind = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.txtCustomerId = new System.Windows.Forms.TextBox();
this.txtContact = new System.Windows.Forms.TextBox();
this.txtAddress = new System.Windows.Forms.TextBox();
this.txtCity = new System.Windows.Forms.TextBox();
this.btnSave = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.txtCountry = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(82, 39);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(130, 15);
this.label1.TabIndex = 0;
this.label1.Text = "Search by Customer ID:";
//
// btnFind
//
this.btnFind.Location = new System.Drawing.Point(509, 35);
this.btnFind.Name = "btnFind";
this.btnFind.Size = new System.Drawing.Size(75, 23);
this.btnFind.TabIndex = 5;
this.btnFind.Text = "&Find";
this.btnFind.UseVisualStyleBackColor = true;
//
// btnExit
//
this.btnExit.Location = new System.Drawing.Point(405, 338);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(75, 23);
this.btnExit.TabIndex = 6;
this.btnExit.Text = "E&xit";
this.btnExit.UseVisualStyleBackColor = true;
//
// txtCustomerId
//
this.txtCustomerId.Location = new System.Drawing.Point(234, 35);
this.txtCustomerId.Name = "txtCustomerId";
this.txtCustomerId.Size = new System.Drawing.Size(248, 23);
this.txtCustomerId.TabIndex = 7;
//
// txtContact
//
this.txtContact.Location = new System.Drawing.Point(234, 125);
this.txtContact.Name = "txtContact";
this.txtContact.Size = new System.Drawing.Size(248, 23);
this.txtContact.TabIndex = 9;
//
// txtAddress
//
this.txtAddress.Location = new System.Drawing.Point(234, 181);
this.txtAddress.Name = "txtAddress";
this.txtAddress.Size = new System.Drawing.Size(248, 23);
this.txtAddress.TabIndex = 10;
//
// txtCity
//
this.txtCity.Location = new System.Drawing.Point(234, 228);
this.txtCity.Name = "txtCity";
this.txtCity.Size = new System.Drawing.Size(248, 23);
this.txtCity.TabIndex = 11;
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(274, 338);
this.btnSave.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(81, 22);
this.btnSave.TabIndex = 12;
this.btnSave.Text = "&Save";
this.btnSave.UseVisualStyleBackColor = true;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(82, 128);
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(52, 15);
this.label3.TabIndex = 14;
this.label3.Text = "Contact:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(82, 184);
this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(78, 15);
this.label4.TabIndex = 15;
this.label4.Text = "Ship Address:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(82, 231);
this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(57, 15);
this.label5.TabIndex = 16;
this.label5.Text = "Ship City:";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(82, 284);
this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(79, 15);
this.label6.TabIndex = 17;
this.label6.Text = "Ship Country:";
//
// txtCountry
//
this.txtCountry.Location = new System.Drawing.Point(234, 279);
this.txtCountry.Name = "txtCountry";
this.txtCountry.Size = new System.Drawing.Size(248, 23);
this.txtCountry.TabIndex = 18;
//
// frmCustomerMaintenance
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.txtCountry);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.btnSave);
this.Controls.Add(this.txtCity);
this.Controls.Add(this.txtAddress);
this.Controls.Add(this.txtContact);
this.Controls.Add(this.txtCustomerId);
this.Controls.Add(this.btnExit);
this.Controls.Add(this.btnFind);
this.Controls.Add(this.label1);
this.Name = "frmCustomerMaintenance";
this.Text = "Customer Maintenance";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Label label1;
private Button btnFind;
private Button btnExit;
private TextBox txtCustomerId;
private TextBox txtContact;
private TextBox txtAddress;
private TextBox txtCity;
private Button btnSave;
private Label label3;
private Label label4;
private Label label5;
private Label label6;
private TextBox txtCountry;
}
}
please code in c#- please note that im a complete beginner-  northwind.docx

More Related Content

PDF
Develop an inventory management system for an electronics store. The .pdf
PDF
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
PPTX
Cassandra
DOCX
Parameterization is nothing but giving multiple input
PDF
Capstone ms2
DOC
Open microsoft visual studio/tutorialoutlet
PDF
Having issues with passing my values through different functions aft.pdf
DOC
Pl sql using_xml
Develop an inventory management system for an electronics store. The .pdf
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
Cassandra
Parameterization is nothing but giving multiple input
Capstone ms2
Open microsoft visual studio/tutorialoutlet
Having issues with passing my values through different functions aft.pdf
Pl sql using_xml

Similar to please code in c#- please note that im a complete beginner- northwind.docx (20)

DOCX
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
DOC
Cis407 a ilab 4 web application development devry university
PPT
ASP.NET 08 - Data Binding And Representation
DOCX
Previous weeks work has been uploaded as well as any other pieces ne.docx
PDF
Clean code
PDF
JavaScript Refactoring
PPSX
Project: Call Center Management
DOCX
Lab11bRevf.docLab 11b Alien InvasionCS 122 • 15 Points .docx
PPT
Flex Maniacs 2007
PDF
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
DOCX
Simple ado program by visual studio
DOCX
Simple ado program by visual studio
PDF
React new features and intro to Hooks
PPT
Chapter2pp
PDF
Practical Google App Engine Applications In Py
PDF
Intake 37 ef2
DOCX
DOCX
Cis 407 i lab 4 of 7
PDF
Membuat aplikasi penjualan buku sederhana
PPT
2.overview of c++ ________lecture2
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
Cis407 a ilab 4 web application development devry university
ASP.NET 08 - Data Binding And Representation
Previous weeks work has been uploaded as well as any other pieces ne.docx
Clean code
JavaScript Refactoring
Project: Call Center Management
Lab11bRevf.docLab 11b Alien InvasionCS 122 • 15 Points .docx
Flex Maniacs 2007
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
Simple ado program by visual studio
Simple ado program by visual studio
React new features and intro to Hooks
Chapter2pp
Practical Google App Engine Applications In Py
Intake 37 ef2
Cis 407 i lab 4 of 7
Membuat aplikasi penjualan buku sederhana
2.overview of c++ ________lecture2
Ad

More from AustinaGRPaigey (20)

DOCX
Please use one of the six Hofstede Cultural Dimensions to give an exam.docx
DOCX
PLEASE USE C+ language Q2- Let- a number that is divisible by 11 is ca (1).docx
DOCX
please show your work so I can follow and answer later questions on my.docx
DOCX
Please program both parts in Python- Please focus on part 2 and print.docx
DOCX
PLEASE HELP!! Which are affiliate of audit client Port Co A and which.docx
DOCX
Please Help!!! Stave Prinen and Chelsy Parnard formed a partaneship- d.docx
DOCX
Please help with these questions Arterial Dissection (tear)- may be.docx
DOCX
Please help with this question On June 13- the board of directors of S.docx
DOCX
Please help me create a jME 3D scene uses a root node- multiple child.docx
DOCX
please help What is the name of the Standard Lead configuration used.docx
DOCX
please answer both! Q2- The graph below shows one 12-hour spring tide.docx
DOCX
please explain as well 2- Let X1 and X2 be random variables (not neces.docx
DOCX
Please do both parts in Python and print the output- Thank you- Proble.docx
DOCX
Please check the accuracy of these questions- Loss of function alleles.docx
DOCX
Please assist me with a drawing of the following- Draw a side-by-side.docx
DOCX
Please assist with 5-10- This planet is -5544 AU from the sun- 5- Comp.docx
DOCX
Please answer the following in 1-2 paragraphs- 1- Why are some countri.docx
DOCX
Please answer the blank spaces Ine Retina The retina has 2 classes o.docx
DOCX
please answer all questions to the activites- The study of genetics an.docx
DOCX
Please add in depth explanation (HARD) Suppose you repeated the Bernar.docx
Please use one of the six Hofstede Cultural Dimensions to give an exam.docx
PLEASE USE C+ language Q2- Let- a number that is divisible by 11 is ca (1).docx
please show your work so I can follow and answer later questions on my.docx
Please program both parts in Python- Please focus on part 2 and print.docx
PLEASE HELP!! Which are affiliate of audit client Port Co A and which.docx
Please Help!!! Stave Prinen and Chelsy Parnard formed a partaneship- d.docx
Please help with these questions Arterial Dissection (tear)- may be.docx
Please help with this question On June 13- the board of directors of S.docx
Please help me create a jME 3D scene uses a root node- multiple child.docx
please help What is the name of the Standard Lead configuration used.docx
please answer both! Q2- The graph below shows one 12-hour spring tide.docx
please explain as well 2- Let X1 and X2 be random variables (not neces.docx
Please do both parts in Python and print the output- Thank you- Proble.docx
Please check the accuracy of these questions- Loss of function alleles.docx
Please assist me with a drawing of the following- Draw a side-by-side.docx
Please assist with 5-10- This planet is -5544 AU from the sun- 5- Comp.docx
Please answer the following in 1-2 paragraphs- 1- Why are some countri.docx
Please answer the blank spaces Ine Retina The retina has 2 classes o.docx
please answer all questions to the activites- The study of genetics an.docx
Please add in depth explanation (HARD) Suppose you repeated the Bernar.docx
Ad

Recently uploaded (20)

PDF
Hazard Identification & Risk Assessment .pdf
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
PDF
International_Financial_Reporting_Standa.pdf
PPTX
Education and Perspectives of Education.pptx
PDF
Empowerment Technology for Senior High School Guide
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PDF
Uderstanding digital marketing and marketing stratergie for engaging the digi...
PDF
HVAC Specification 2024 according to central public works department
PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PDF
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PPTX
What’s under the hood: Parsing standardized learning content for AI
PDF
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PDF
English Textual Question & Ans (12th Class).pdf
Hazard Identification & Risk Assessment .pdf
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
International_Financial_Reporting_Standa.pdf
Education and Perspectives of Education.pptx
Empowerment Technology for Senior High School Guide
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
Uderstanding digital marketing and marketing stratergie for engaging the digi...
HVAC Specification 2024 according to central public works department
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
What’s under the hood: Parsing standardized learning content for AI
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
FORM 1 BIOLOGY MIND MAPS and their schemes
English Textual Question & Ans (12th Class).pdf

please code in c#- please note that im a complete beginner- northwind.docx

  • 1. please code in c#. please note that im a complete beginner. northwind.mdf. northwind_log.ldf OrderDetailsMaintenance.zip 1. Include the two above files in the root of your OrderDetailsMaintenance project. 2. Make sure to mark them as "Content" and "Copy Always" or "Copy if newer" in the properties window of those two files. 3. Run the Scaffold-DbContext command to create a context class as well as a class to encapsulate the Orders objects from the associated table in the mdf file. Make sure to include the parameters for -Tables Customers (only worry about the attributes associated with the text boxes, you don't need to worry about any other rows from the table) 4. Once you have ran the command, include an app.config file and add a connection string element. Make sure to copy the connection string from your Context class to your app.config. Then edit your context to grab the connection string from the app.config (ConfigurationManager.ConnectionString["Northwind"].ConnectionString) 5. Code the Find button to Find the customer id and populate the details in the below text boxes. 1. If no order is found, display a message box. 6. Code the exit button 7. Code the Save button to update its attributes and call Update and SaveChanges() on that particular entity. 1. Note: If you close the program, reopen it, and search for the entity you recently updated. You may not see the changes depending on how you setup the mdf file in your project (because it copies a new version to the bin directory each time you run the program). So, if you don't see your changes, don't be alarmed. ============ HERE IS WHAT I HAVE SO FAR frmCustomerMaintenance.cs namespace OrderDetailsMaintenance
  • 2. { public partial class frmCustomerMaintenance : Form { public frmCustomerMaintenance() { InitializeComponent(); } } } frmCustomerMaintenance.resx <root> <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" />
  • 3. </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> Program.cs namespace OrderDetailsMaintenance { internal static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); Application.Run(new frmCustomerMaintenance());
  • 4. } } } Validator.cs namespace OrderDetailsMaintenance { public static class Validator { private static string title = "Entry Error"; public static string Title { get => title; set => title = value; } public static bool IsPresent(TextBox textBox) { if (textBox.Text == "") { MessageBox.Show(textBox.Tag + " is a required field.", Title); textBox.Focus(); return false; } return true; } public static bool IsDecimal(TextBox textBox) { decimal number = 0m; if (Decimal.TryParse(textBox.Text, out number)) { return true; } else { MessageBox.Show(textBox.Tag + " must be a decimal value.", Title); textBox.Focus(); return false; } } public static bool IsInt32(TextBox textBox) { int number = 0;
  • 5. if (Int32.TryParse(textBox.Text, out number)) { return true; } else { MessageBox.Show(textBox.Tag + " must be an integer.", Title); textBox.Focus(); return false; } } public static bool IsWithinRange(TextBox textBox, decimal min, decimal max) { decimal number = Convert.ToDecimal(textBox.Text); if (number < min || number > max) { MessageBox.Show(textBox.Tag + " must be between " + min + " and " + max + ".", Title); textBox.Focus(); return false; } return true; } } } frmCustomerMaintenance.Designer.cs namespace OrderDetailsMaintenance { partial class frmCustomerMaintenance { /// <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))
  • 6. { 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.label1 = new System.Windows.Forms.Label(); this.btnFind = new System.Windows.Forms.Button(); this.btnExit = new System.Windows.Forms.Button(); this.txtCustomerId = new System.Windows.Forms.TextBox(); this.txtContact = new System.Windows.Forms.TextBox(); this.txtAddress = new System.Windows.Forms.TextBox(); this.txtCity = new System.Windows.Forms.TextBox(); this.btnSave = new System.Windows.Forms.Button(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.txtCountry = new System.Windows.Forms.TextBox(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(82, 39); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(130, 15); this.label1.TabIndex = 0; this.label1.Text = "Search by Customer ID:"; // // btnFind // this.btnFind.Location = new System.Drawing.Point(509, 35); this.btnFind.Name = "btnFind"; this.btnFind.Size = new System.Drawing.Size(75, 23); this.btnFind.TabIndex = 5; this.btnFind.Text = "&Find"; this.btnFind.UseVisualStyleBackColor = true;
  • 7. // // btnExit // this.btnExit.Location = new System.Drawing.Point(405, 338); this.btnExit.Name = "btnExit"; this.btnExit.Size = new System.Drawing.Size(75, 23); this.btnExit.TabIndex = 6; this.btnExit.Text = "E&xit"; this.btnExit.UseVisualStyleBackColor = true; // // txtCustomerId // this.txtCustomerId.Location = new System.Drawing.Point(234, 35); this.txtCustomerId.Name = "txtCustomerId"; this.txtCustomerId.Size = new System.Drawing.Size(248, 23); this.txtCustomerId.TabIndex = 7; // // txtContact // this.txtContact.Location = new System.Drawing.Point(234, 125); this.txtContact.Name = "txtContact"; this.txtContact.Size = new System.Drawing.Size(248, 23); this.txtContact.TabIndex = 9; // // txtAddress // this.txtAddress.Location = new System.Drawing.Point(234, 181); this.txtAddress.Name = "txtAddress"; this.txtAddress.Size = new System.Drawing.Size(248, 23); this.txtAddress.TabIndex = 10; // // txtCity // this.txtCity.Location = new System.Drawing.Point(234, 228); this.txtCity.Name = "txtCity"; this.txtCity.Size = new System.Drawing.Size(248, 23); this.txtCity.TabIndex = 11; // // btnSave // this.btnSave.Location = new System.Drawing.Point(274, 338); this.btnSave.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1); this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(81, 22); this.btnSave.TabIndex = 12; this.btnSave.Text = "&Save";
  • 8. this.btnSave.UseVisualStyleBackColor = true; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(82, 128); this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(52, 15); this.label3.TabIndex = 14; this.label3.Text = "Contact:"; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(82, 184); this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(78, 15); this.label4.TabIndex = 15; this.label4.Text = "Ship Address:"; // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(82, 231); this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(57, 15); this.label5.TabIndex = 16; this.label5.Text = "Ship City:"; // // label6 // this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(82, 284); this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(79, 15); this.label6.TabIndex = 17; this.label6.Text = "Ship Country:"; // // txtCountry // this.txtCountry.Location = new System.Drawing.Point(234, 279); this.txtCountry.Name = "txtCountry";
  • 9. this.txtCountry.Size = new System.Drawing.Size(248, 23); this.txtCountry.TabIndex = 18; // // frmCustomerMaintenance // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); this.Controls.Add(this.txtCountry); this.Controls.Add(this.label6); this.Controls.Add(this.label5); this.Controls.Add(this.label4); this.Controls.Add(this.label3); this.Controls.Add(this.btnSave); this.Controls.Add(this.txtCity); this.Controls.Add(this.txtAddress); this.Controls.Add(this.txtContact); this.Controls.Add(this.txtCustomerId); this.Controls.Add(this.btnExit); this.Controls.Add(this.btnFind); this.Controls.Add(this.label1); this.Name = "frmCustomerMaintenance"; this.Text = "Customer Maintenance"; this.ResumeLayout(false); this.PerformLayout(); } #endregion private Label label1; private Button btnFind; private Button btnExit; private TextBox txtCustomerId; private TextBox txtContact; private TextBox txtAddress; private TextBox txtCity; private Button btnSave; private Label label3; private Label label4; private Label label5; private Label label6; private TextBox txtCountry; } }