initial commit
parent
889b0d8043
commit
8bb23ddbc6
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<connectionStrings>
|
||||
<add name="Default" connectionString="Data Source=.\DBwizard.db;Version=3" providerName="System.Data.SqlClient"/>
|
||||
</connectionStrings>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{42D31E64-C955-4C6F-9BE2-1FC06E252F37}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>DBWizard</RootNamespace>
|
||||
<AssemblyName>DBWizard</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CsvHelper, Version=15.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL">
|
||||
<HintPath>packages\CsvHelper.15.0.5\lib\net47\CsvHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapper, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Dapper.2.0.35\lib\net461\Dapper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SQLite, Version=1.0.112.1, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Data.SQLite.Core.1.0.112.1\lib\net40\System.Data.SQLite.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.DirectoryServices" />
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainProgram.cs" />
|
||||
<Compile Include="Models\Parent.cs" />
|
||||
<Compile Include="Models\Program.cs" />
|
||||
<Compile Include="Models\School.cs" />
|
||||
<Compile Include="Models\Student.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SqliteDataAccess.cs" />
|
||||
<None Include="Resources\student.png" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Content Include="DBWizard.db">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\DataSources\DBWizard.Models.Student.datasource" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="packages\System.Data.SQLite.Core.1.0.112.1\build\net40\System.Data.SQLite.Core.targets" Condition="Exists('packages\System.Data.SQLite.Core.1.0.112.1\build\net40\System.Data.SQLite.Core.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('packages\System.Data.SQLite.Core.1.0.112.1\build\net40\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\System.Data.SQLite.Core.1.0.112.1\build\net40\System.Data.SQLite.Core.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
Binary file not shown.
|
@ -0,0 +1,25 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29806.167
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBWizard", "DBWizard.csproj", "{42D31E64-C955-4C6F-9BE2-1FC06E252F37}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{42D31E64-C955-4C6F-9BE2-1FC06E252F37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{42D31E64-C955-4C6F-9BE2-1FC06E252F37}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{42D31E64-C955-4C6F-9BE2-1FC06E252F37}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{42D31E64-C955-4C6F-9BE2-1FC06E252F37}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {4AB6A6F8-500A-4828-875F-1F1AE37E8234}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,832 @@
|
|||
namespace DBWizard
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
System.Windows.Forms.Label lastNameLabel;
|
||||
System.Windows.Forms.Label firstNameLabel;
|
||||
System.Windows.Forms.Label student_idLabel;
|
||||
System.Windows.Forms.Label dOBLabel;
|
||||
System.Windows.Forms.Label programNameLabel;
|
||||
System.Windows.Forms.Label addressLabel;
|
||||
System.Windows.Forms.Label schoolLabel;
|
||||
System.Windows.Forms.Label genderLabel;
|
||||
System.Windows.Forms.Label gradeLevelLabel;
|
||||
System.Windows.Forms.Label lastNameLabel1;
|
||||
System.Windows.Forms.Label firstNameLabel1;
|
||||
System.Windows.Forms.Label phoneNumberLabel;
|
||||
System.Windows.Forms.Label emailAddressLabel;
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
|
||||
this.topTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.mainMenuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.newStudentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveStudentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.reportsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.studentBySchoolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.studentsByProgramToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exitsavesDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.studentBindingNavigator = new System.Windows.Forms.BindingNavigator(this.components);
|
||||
this.bindingNavigatorAddNewItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorCountItem = new System.Windows.Forms.ToolStripLabel();
|
||||
this.bindingNavigatorDeleteItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorMoveFirstItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorMovePreviousItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorSeparator = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.bindingNavigatorPositionItem = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.bindingNavigatorSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.bindingNavigatorMoveNextItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorMoveLastItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.studentBindingNavigatorSaveItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.student_pictureBox = new System.Windows.Forms.PictureBox();
|
||||
this.lastNameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.firstNameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.student_idTextBox = new System.Windows.Forms.TextBox();
|
||||
this.dob_dateTimePicker = new System.Windows.Forms.DateTimePicker();
|
||||
this.programComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.addressTextBox = new System.Windows.Forms.TextBox();
|
||||
this.schoolComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.genderComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.gradeLevelComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.save_button = new System.Windows.Forms.Button();
|
||||
this.parent_groupBox = new System.Windows.Forms.GroupBox();
|
||||
this.emailAddressTextBox = new System.Windows.Forms.TextBox();
|
||||
this.phoneNumberNumericUpDown = new System.Windows.Forms.NumericUpDown();
|
||||
this.parent_firstNameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.parent_lastNameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.clear_button = new System.Windows.Forms.Button();
|
||||
this.delete_button = new System.Windows.Forms.Button();
|
||||
this.pic_openFileDialog = new System.Windows.Forms.OpenFileDialog();
|
||||
this.lblSearch = new System.Windows.Forms.Label();
|
||||
this.search_textBox = new System.Windows.Forms.TextBox();
|
||||
this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
|
||||
this.toolTips = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.btnChaosMonkey = new System.Windows.Forms.Button();
|
||||
this.foundStudents_comboBox = new System.Windows.Forms.ComboBox();
|
||||
this.lblFoundStudents = new System.Windows.Forms.Label();
|
||||
this.studentBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
lastNameLabel = new System.Windows.Forms.Label();
|
||||
firstNameLabel = new System.Windows.Forms.Label();
|
||||
student_idLabel = new System.Windows.Forms.Label();
|
||||
dOBLabel = new System.Windows.Forms.Label();
|
||||
programNameLabel = new System.Windows.Forms.Label();
|
||||
addressLabel = new System.Windows.Forms.Label();
|
||||
schoolLabel = new System.Windows.Forms.Label();
|
||||
genderLabel = new System.Windows.Forms.Label();
|
||||
gradeLevelLabel = new System.Windows.Forms.Label();
|
||||
lastNameLabel1 = new System.Windows.Forms.Label();
|
||||
firstNameLabel1 = new System.Windows.Forms.Label();
|
||||
phoneNumberLabel = new System.Windows.Forms.Label();
|
||||
emailAddressLabel = new System.Windows.Forms.Label();
|
||||
this.topTableLayoutPanel.SuspendLayout();
|
||||
this.mainMenuStrip.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.studentBindingNavigator)).BeginInit();
|
||||
this.studentBindingNavigator.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.student_pictureBox)).BeginInit();
|
||||
this.parent_groupBox.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.phoneNumberNumericUpDown)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.studentBindingSource)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lastNameLabel
|
||||
//
|
||||
lastNameLabel.AutoSize = true;
|
||||
lastNameLabel.Location = new System.Drawing.Point(183, 38);
|
||||
lastNameLabel.Name = "lastNameLabel";
|
||||
lastNameLabel.Size = new System.Drawing.Size(90, 20);
|
||||
lastNameLabel.TabIndex = 3;
|
||||
lastNameLabel.Text = "Last Name:";
|
||||
//
|
||||
// firstNameLabel
|
||||
//
|
||||
firstNameLabel.AutoSize = true;
|
||||
firstNameLabel.Location = new System.Drawing.Point(380, 38);
|
||||
firstNameLabel.Name = "firstNameLabel";
|
||||
firstNameLabel.Size = new System.Drawing.Size(90, 20);
|
||||
firstNameLabel.TabIndex = 4;
|
||||
firstNameLabel.Text = "First Name:";
|
||||
//
|
||||
// student_idLabel
|
||||
//
|
||||
student_idLabel.AutoSize = true;
|
||||
student_idLabel.Location = new System.Drawing.Point(12, 200);
|
||||
student_idLabel.Name = "student_idLabel";
|
||||
student_idLabel.Size = new System.Drawing.Size(83, 20);
|
||||
student_idLabel.TabIndex = 6;
|
||||
student_idLabel.Text = "student id:";
|
||||
//
|
||||
// dOBLabel
|
||||
//
|
||||
dOBLabel.AutoSize = true;
|
||||
dOBLabel.Location = new System.Drawing.Point(10, 266);
|
||||
dOBLabel.Name = "dOBLabel";
|
||||
dOBLabel.Size = new System.Drawing.Size(48, 20);
|
||||
dOBLabel.TabIndex = 8;
|
||||
dOBLabel.Text = "DOB:";
|
||||
//
|
||||
// programNameLabel
|
||||
//
|
||||
programNameLabel.AutoSize = true;
|
||||
programNameLabel.Location = new System.Drawing.Point(380, 108);
|
||||
programNameLabel.Name = "programNameLabel";
|
||||
programNameLabel.Size = new System.Drawing.Size(73, 20);
|
||||
programNameLabel.TabIndex = 10;
|
||||
programNameLabel.Text = "Program:";
|
||||
//
|
||||
// addressLabel
|
||||
//
|
||||
addressLabel.AutoSize = true;
|
||||
addressLabel.Location = new System.Drawing.Point(185, 177);
|
||||
addressLabel.Name = "addressLabel";
|
||||
addressLabel.Size = new System.Drawing.Size(70, 20);
|
||||
addressLabel.TabIndex = 12;
|
||||
addressLabel.Text = "address:";
|
||||
//
|
||||
// schoolLabel
|
||||
//
|
||||
schoolLabel.AutoSize = true;
|
||||
schoolLabel.Location = new System.Drawing.Point(380, 177);
|
||||
schoolLabel.Name = "schoolLabel";
|
||||
schoolLabel.Size = new System.Drawing.Size(62, 20);
|
||||
schoolLabel.TabIndex = 14;
|
||||
schoolLabel.Text = "School:";
|
||||
//
|
||||
// genderLabel
|
||||
//
|
||||
genderLabel.AutoSize = true;
|
||||
genderLabel.Location = new System.Drawing.Point(185, 108);
|
||||
genderLabel.Name = "genderLabel";
|
||||
genderLabel.Size = new System.Drawing.Size(67, 20);
|
||||
genderLabel.TabIndex = 16;
|
||||
genderLabel.Text = "Gender:";
|
||||
//
|
||||
// gradeLevelLabel
|
||||
//
|
||||
gradeLevelLabel.AutoSize = true;
|
||||
gradeLevelLabel.Location = new System.Drawing.Point(390, 262);
|
||||
gradeLevelLabel.Name = "gradeLevelLabel";
|
||||
gradeLevelLabel.Size = new System.Drawing.Size(99, 20);
|
||||
gradeLevelLabel.TabIndex = 18;
|
||||
gradeLevelLabel.Text = "Grade Level:";
|
||||
//
|
||||
// lastNameLabel1
|
||||
//
|
||||
lastNameLabel1.AutoSize = true;
|
||||
lastNameLabel1.Location = new System.Drawing.Point(34, 42);
|
||||
lastNameLabel1.Name = "lastNameLabel1";
|
||||
lastNameLabel1.Size = new System.Drawing.Size(90, 20);
|
||||
lastNameLabel1.TabIndex = 0;
|
||||
lastNameLabel1.Text = "Last Name:";
|
||||
//
|
||||
// firstNameLabel1
|
||||
//
|
||||
firstNameLabel1.AutoSize = true;
|
||||
firstNameLabel1.Location = new System.Drawing.Point(34, 90);
|
||||
firstNameLabel1.Name = "firstNameLabel1";
|
||||
firstNameLabel1.Size = new System.Drawing.Size(90, 20);
|
||||
firstNameLabel1.TabIndex = 2;
|
||||
firstNameLabel1.Text = "First Name:";
|
||||
//
|
||||
// phoneNumberLabel
|
||||
//
|
||||
phoneNumberLabel.AutoSize = true;
|
||||
phoneNumberLabel.Location = new System.Drawing.Point(6, 139);
|
||||
phoneNumberLabel.Name = "phoneNumberLabel";
|
||||
phoneNumberLabel.Size = new System.Drawing.Size(119, 20);
|
||||
phoneNumberLabel.TabIndex = 4;
|
||||
phoneNumberLabel.Text = "Phone Number:";
|
||||
//
|
||||
// emailAddressLabel
|
||||
//
|
||||
emailAddressLabel.AutoSize = true;
|
||||
emailAddressLabel.Location = new System.Drawing.Point(10, 192);
|
||||
emailAddressLabel.Name = "emailAddressLabel";
|
||||
emailAddressLabel.Size = new System.Drawing.Size(115, 20);
|
||||
emailAddressLabel.TabIndex = 6;
|
||||
emailAddressLabel.Text = "Email Address:";
|
||||
//
|
||||
// topTableLayoutPanel
|
||||
//
|
||||
this.topTableLayoutPanel.ColumnCount = 2;
|
||||
this.topTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.topTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 382F));
|
||||
this.topTableLayoutPanel.Controls.Add(this.mainMenuStrip, 0, 0);
|
||||
this.topTableLayoutPanel.Controls.Add(this.studentBindingNavigator, 1, 0);
|
||||
this.topTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.topTableLayoutPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.topTableLayoutPanel.Name = "topTableLayoutPanel";
|
||||
this.topTableLayoutPanel.RowCount = 1;
|
||||
this.topTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.topTableLayoutPanel.Size = new System.Drawing.Size(992, 35);
|
||||
this.topTableLayoutPanel.TabIndex = 0;
|
||||
//
|
||||
// mainMenuStrip
|
||||
//
|
||||
this.mainMenuStrip.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.mainMenuStrip.GripMargin = new System.Windows.Forms.Padding(2, 2, 0, 2);
|
||||
this.mainMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||
this.mainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileToolStripMenuItem});
|
||||
this.mainMenuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.mainMenuStrip.Name = "mainMenuStrip";
|
||||
this.mainMenuStrip.Size = new System.Drawing.Size(610, 35);
|
||||
this.mainMenuStrip.TabIndex = 0;
|
||||
this.mainMenuStrip.Text = "mainMenuStrip";
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.newStudentToolStripMenuItem,
|
||||
this.saveStudentToolStripMenuItem,
|
||||
this.reportsToolStripMenuItem,
|
||||
this.exitsavesDataToolStripMenuItem});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(54, 29);
|
||||
this.fileToolStripMenuItem.Text = "&File";
|
||||
//
|
||||
// newStudentToolStripMenuItem
|
||||
//
|
||||
this.newStudentToolStripMenuItem.Name = "newStudentToolStripMenuItem";
|
||||
this.newStudentToolStripMenuItem.Size = new System.Drawing.Size(239, 34);
|
||||
this.newStudentToolStripMenuItem.Text = "&New Student";
|
||||
//
|
||||
// saveStudentToolStripMenuItem
|
||||
//
|
||||
this.saveStudentToolStripMenuItem.Name = "saveStudentToolStripMenuItem";
|
||||
this.saveStudentToolStripMenuItem.Size = new System.Drawing.Size(239, 34);
|
||||
this.saveStudentToolStripMenuItem.Text = "&Save Student";
|
||||
//
|
||||
// reportsToolStripMenuItem
|
||||
//
|
||||
this.reportsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.studentBySchoolToolStripMenuItem,
|
||||
this.studentsByProgramToolStripMenuItem});
|
||||
this.reportsToolStripMenuItem.Name = "reportsToolStripMenuItem";
|
||||
this.reportsToolStripMenuItem.Size = new System.Drawing.Size(239, 34);
|
||||
this.reportsToolStripMenuItem.Text = "Reports";
|
||||
//
|
||||
// studentBySchoolToolStripMenuItem
|
||||
//
|
||||
this.studentBySchoolToolStripMenuItem.Name = "studentBySchoolToolStripMenuItem";
|
||||
this.studentBySchoolToolStripMenuItem.Size = new System.Drawing.Size(283, 34);
|
||||
this.studentBySchoolToolStripMenuItem.Text = "Students by school";
|
||||
//
|
||||
// studentsByProgramToolStripMenuItem
|
||||
//
|
||||
this.studentsByProgramToolStripMenuItem.Name = "studentsByProgramToolStripMenuItem";
|
||||
this.studentsByProgramToolStripMenuItem.Size = new System.Drawing.Size(283, 34);
|
||||
this.studentsByProgramToolStripMenuItem.Text = "Students by program";
|
||||
//
|
||||
// exitsavesDataToolStripMenuItem
|
||||
//
|
||||
this.exitsavesDataToolStripMenuItem.Name = "exitsavesDataToolStripMenuItem";
|
||||
this.exitsavesDataToolStripMenuItem.Size = new System.Drawing.Size(239, 34);
|
||||
this.exitsavesDataToolStripMenuItem.Text = "E&xit (saves data)";
|
||||
//
|
||||
// studentBindingNavigator
|
||||
//
|
||||
this.studentBindingNavigator.AddNewItem = this.bindingNavigatorAddNewItem;
|
||||
this.studentBindingNavigator.BindingSource = this.studentBindingSource;
|
||||
this.studentBindingNavigator.CountItem = this.bindingNavigatorCountItem;
|
||||
this.studentBindingNavigator.DeleteItem = this.bindingNavigatorDeleteItem;
|
||||
this.studentBindingNavigator.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.studentBindingNavigator.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||
this.studentBindingNavigator.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.bindingNavigatorMoveFirstItem,
|
||||
this.bindingNavigatorMovePreviousItem,
|
||||
this.bindingNavigatorSeparator,
|
||||
this.bindingNavigatorPositionItem,
|
||||
this.bindingNavigatorCountItem,
|
||||
this.bindingNavigatorSeparator1,
|
||||
this.bindingNavigatorMoveNextItem,
|
||||
this.bindingNavigatorMoveLastItem,
|
||||
this.bindingNavigatorSeparator2,
|
||||
this.bindingNavigatorAddNewItem,
|
||||
this.bindingNavigatorDeleteItem,
|
||||
this.studentBindingNavigatorSaveItem});
|
||||
this.studentBindingNavigator.Location = new System.Drawing.Point(610, 0);
|
||||
this.studentBindingNavigator.MoveFirstItem = this.bindingNavigatorMoveFirstItem;
|
||||
this.studentBindingNavigator.MoveLastItem = this.bindingNavigatorMoveLastItem;
|
||||
this.studentBindingNavigator.MoveNextItem = this.bindingNavigatorMoveNextItem;
|
||||
this.studentBindingNavigator.MovePreviousItem = this.bindingNavigatorMovePreviousItem;
|
||||
this.studentBindingNavigator.Name = "studentBindingNavigator";
|
||||
this.studentBindingNavigator.PositionItem = this.bindingNavigatorPositionItem;
|
||||
this.studentBindingNavigator.Size = new System.Drawing.Size(382, 35);
|
||||
this.studentBindingNavigator.TabIndex = 2;
|
||||
this.studentBindingNavigator.Text = "bindingNavigator1";
|
||||
//
|
||||
// bindingNavigatorAddNewItem
|
||||
//
|
||||
this.bindingNavigatorAddNewItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorAddNewItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorAddNewItem.Image")));
|
||||
this.bindingNavigatorAddNewItem.Name = "bindingNavigatorAddNewItem";
|
||||
this.bindingNavigatorAddNewItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorAddNewItem.Size = new System.Drawing.Size(34, 30);
|
||||
this.bindingNavigatorAddNewItem.Text = "Add new";
|
||||
//
|
||||
// bindingNavigatorCountItem
|
||||
//
|
||||
this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
|
||||
this.bindingNavigatorCountItem.Size = new System.Drawing.Size(54, 30);
|
||||
this.bindingNavigatorCountItem.Text = "of {0}";
|
||||
this.bindingNavigatorCountItem.ToolTipText = "Total number of items";
|
||||
//
|
||||
// bindingNavigatorDeleteItem
|
||||
//
|
||||
this.bindingNavigatorDeleteItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorDeleteItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorDeleteItem.Image")));
|
||||
this.bindingNavigatorDeleteItem.Name = "bindingNavigatorDeleteItem";
|
||||
this.bindingNavigatorDeleteItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorDeleteItem.Size = new System.Drawing.Size(34, 30);
|
||||
this.bindingNavigatorDeleteItem.Text = "Delete";
|
||||
//
|
||||
// bindingNavigatorMoveFirstItem
|
||||
//
|
||||
this.bindingNavigatorMoveFirstItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorMoveFirstItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveFirstItem.Image")));
|
||||
this.bindingNavigatorMoveFirstItem.Name = "bindingNavigatorMoveFirstItem";
|
||||
this.bindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorMoveFirstItem.Size = new System.Drawing.Size(34, 30);
|
||||
this.bindingNavigatorMoveFirstItem.Text = "Move first";
|
||||
//
|
||||
// bindingNavigatorMovePreviousItem
|
||||
//
|
||||
this.bindingNavigatorMovePreviousItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorMovePreviousItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMovePreviousItem.Image")));
|
||||
this.bindingNavigatorMovePreviousItem.Name = "bindingNavigatorMovePreviousItem";
|
||||
this.bindingNavigatorMovePreviousItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorMovePreviousItem.Size = new System.Drawing.Size(34, 30);
|
||||
this.bindingNavigatorMovePreviousItem.Text = "Move previous";
|
||||
//
|
||||
// bindingNavigatorSeparator
|
||||
//
|
||||
this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator";
|
||||
this.bindingNavigatorSeparator.Size = new System.Drawing.Size(6, 35);
|
||||
//
|
||||
// bindingNavigatorPositionItem
|
||||
//
|
||||
this.bindingNavigatorPositionItem.AccessibleName = "Position";
|
||||
this.bindingNavigatorPositionItem.AutoSize = false;
|
||||
this.bindingNavigatorPositionItem.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||
this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
|
||||
this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(50, 31);
|
||||
this.bindingNavigatorPositionItem.Text = "0";
|
||||
this.bindingNavigatorPositionItem.ToolTipText = "Current position";
|
||||
//
|
||||
// bindingNavigatorSeparator1
|
||||
//
|
||||
this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator1";
|
||||
this.bindingNavigatorSeparator1.Size = new System.Drawing.Size(6, 35);
|
||||
//
|
||||
// bindingNavigatorMoveNextItem
|
||||
//
|
||||
this.bindingNavigatorMoveNextItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorMoveNextItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveNextItem.Image")));
|
||||
this.bindingNavigatorMoveNextItem.Name = "bindingNavigatorMoveNextItem";
|
||||
this.bindingNavigatorMoveNextItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorMoveNextItem.Size = new System.Drawing.Size(34, 30);
|
||||
this.bindingNavigatorMoveNextItem.Text = "Move next";
|
||||
//
|
||||
// bindingNavigatorMoveLastItem
|
||||
//
|
||||
this.bindingNavigatorMoveLastItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorMoveLastItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveLastItem.Image")));
|
||||
this.bindingNavigatorMoveLastItem.Name = "bindingNavigatorMoveLastItem";
|
||||
this.bindingNavigatorMoveLastItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorMoveLastItem.Size = new System.Drawing.Size(34, 30);
|
||||
this.bindingNavigatorMoveLastItem.Text = "Move last";
|
||||
//
|
||||
// bindingNavigatorSeparator2
|
||||
//
|
||||
this.bindingNavigatorSeparator2.Name = "bindingNavigatorSeparator2";
|
||||
this.bindingNavigatorSeparator2.Size = new System.Drawing.Size(6, 35);
|
||||
//
|
||||
// studentBindingNavigatorSaveItem
|
||||
//
|
||||
this.studentBindingNavigatorSaveItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.studentBindingNavigatorSaveItem.Enabled = false;
|
||||
this.studentBindingNavigatorSaveItem.Image = ((System.Drawing.Image)(resources.GetObject("studentBindingNavigatorSaveItem.Image")));
|
||||
this.studentBindingNavigatorSaveItem.Name = "studentBindingNavigatorSaveItem";
|
||||
this.studentBindingNavigatorSaveItem.Size = new System.Drawing.Size(34, 30);
|
||||
this.studentBindingNavigatorSaveItem.Text = "Save Data";
|
||||
//
|
||||
// student_pictureBox
|
||||
//
|
||||
this.student_pictureBox.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.student_pictureBox.Image = ((System.Drawing.Image)(resources.GetObject("student_pictureBox.Image")));
|
||||
this.student_pictureBox.Location = new System.Drawing.Point(12, 38);
|
||||
this.student_pictureBox.Name = "student_pictureBox";
|
||||
this.student_pictureBox.Size = new System.Drawing.Size(156, 156);
|
||||
this.student_pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.student_pictureBox.TabIndex = 1;
|
||||
this.student_pictureBox.TabStop = false;
|
||||
this.student_pictureBox.Tag = "DefaultImage";
|
||||
this.student_pictureBox.Click += new System.EventHandler(this.pictureBox1_Click);
|
||||
//
|
||||
// lastNameTextBox
|
||||
//
|
||||
this.lastNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.studentBindingSource, "LastName", true));
|
||||
this.lastNameTextBox.Location = new System.Drawing.Point(187, 61);
|
||||
this.lastNameTextBox.Name = "lastNameTextBox";
|
||||
this.lastNameTextBox.Size = new System.Drawing.Size(167, 26);
|
||||
this.lastNameTextBox.TabIndex = 4;
|
||||
this.lastNameTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.String_TextBox_Validating);
|
||||
//
|
||||
// firstNameTextBox
|
||||
//
|
||||
this.firstNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.studentBindingSource, "FirstName", true));
|
||||
this.firstNameTextBox.Location = new System.Drawing.Point(384, 61);
|
||||
this.firstNameTextBox.Name = "firstNameTextBox";
|
||||
this.firstNameTextBox.Size = new System.Drawing.Size(177, 26);
|
||||
this.firstNameTextBox.TabIndex = 5;
|
||||
this.firstNameTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.String_TextBox_Validating);
|
||||
//
|
||||
// student_idTextBox
|
||||
//
|
||||
this.student_idTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.studentBindingSource, "student_id", true));
|
||||
this.student_idTextBox.Location = new System.Drawing.Point(12, 223);
|
||||
this.student_idTextBox.Name = "student_idTextBox";
|
||||
this.student_idTextBox.Size = new System.Drawing.Size(135, 26);
|
||||
this.student_idTextBox.TabIndex = 7;
|
||||
this.student_idTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.student_idTextBox_Validating);
|
||||
//
|
||||
// dob_dateTimePicker
|
||||
//
|
||||
this.dob_dateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Short;
|
||||
this.dob_dateTimePicker.Location = new System.Drawing.Point(12, 289);
|
||||
this.dob_dateTimePicker.MinDate = new System.DateTime(1900, 1, 1, 0, 0, 0, 0);
|
||||
this.dob_dateTimePicker.Name = "dob_dateTimePicker";
|
||||
this.dob_dateTimePicker.Size = new System.Drawing.Size(135, 26);
|
||||
this.dob_dateTimePicker.TabIndex = 9;
|
||||
this.dob_dateTimePicker.Validating += new System.ComponentModel.CancelEventHandler(this.dob_dateTimePicker_Validating);
|
||||
//
|
||||
// programComboBox
|
||||
//
|
||||
this.programComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.programComboBox.FormattingEnabled = true;
|
||||
this.programComboBox.Location = new System.Drawing.Point(384, 131);
|
||||
this.programComboBox.Name = "programComboBox";
|
||||
this.programComboBox.Size = new System.Drawing.Size(177, 28);
|
||||
this.programComboBox.TabIndex = 11;
|
||||
this.programComboBox.Validating += new System.ComponentModel.CancelEventHandler(this.ComboBox_Validating);
|
||||
//
|
||||
// addressTextBox
|
||||
//
|
||||
this.addressTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.studentBindingSource, "address", true));
|
||||
this.addressTextBox.Location = new System.Drawing.Point(187, 200);
|
||||
this.addressTextBox.Multiline = true;
|
||||
this.addressTextBox.Name = "addressTextBox";
|
||||
this.addressTextBox.Size = new System.Drawing.Size(167, 115);
|
||||
this.addressTextBox.TabIndex = 13;
|
||||
this.addressTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.String_TextBox_Validating);
|
||||
//
|
||||
// schoolComboBox
|
||||
//
|
||||
this.schoolComboBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.studentBindingSource, "School.name", true));
|
||||
this.schoolComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.schoolComboBox.FormattingEnabled = true;
|
||||
this.schoolComboBox.Location = new System.Drawing.Point(384, 200);
|
||||
this.schoolComboBox.Name = "schoolComboBox";
|
||||
this.schoolComboBox.Size = new System.Drawing.Size(177, 28);
|
||||
this.schoolComboBox.TabIndex = 15;
|
||||
this.schoolComboBox.Validating += new System.ComponentModel.CancelEventHandler(this.ComboBox_Validating);
|
||||
//
|
||||
// genderComboBox
|
||||
//
|
||||
this.genderComboBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.studentBindingSource, "gender", true));
|
||||
this.genderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.genderComboBox.FormattingEnabled = true;
|
||||
this.genderComboBox.Items.AddRange(new object[] {
|
||||
"Male",
|
||||
"Female"});
|
||||
this.genderComboBox.Location = new System.Drawing.Point(189, 131);
|
||||
this.genderComboBox.Name = "genderComboBox";
|
||||
this.genderComboBox.Size = new System.Drawing.Size(121, 28);
|
||||
this.genderComboBox.TabIndex = 17;
|
||||
this.genderComboBox.Validating += new System.ComponentModel.CancelEventHandler(this.ComboBox_Validating);
|
||||
//
|
||||
// gradeLevelComboBox
|
||||
//
|
||||
this.gradeLevelComboBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.studentBindingSource, "GradeLevel", true));
|
||||
this.gradeLevelComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.gradeLevelComboBox.FormattingEnabled = true;
|
||||
this.gradeLevelComboBox.Items.AddRange(new object[] {
|
||||
"K",
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"10",
|
||||
"11",
|
||||
"12"});
|
||||
this.gradeLevelComboBox.Location = new System.Drawing.Point(384, 287);
|
||||
this.gradeLevelComboBox.Name = "gradeLevelComboBox";
|
||||
this.gradeLevelComboBox.Size = new System.Drawing.Size(121, 28);
|
||||
this.gradeLevelComboBox.TabIndex = 19;
|
||||
this.gradeLevelComboBox.Validating += new System.ComponentModel.CancelEventHandler(this.ComboBox_Validating);
|
||||
//
|
||||
// save_button
|
||||
//
|
||||
this.save_button.Location = new System.Drawing.Point(14, 350);
|
||||
this.save_button.Name = "save_button";
|
||||
this.save_button.Size = new System.Drawing.Size(104, 54);
|
||||
this.save_button.TabIndex = 20;
|
||||
this.save_button.Text = "Save";
|
||||
this.save_button.UseVisualStyleBackColor = true;
|
||||
this.save_button.Click += new System.EventHandler(this.save_button_Click);
|
||||
//
|
||||
// parent_groupBox
|
||||
//
|
||||
this.parent_groupBox.Controls.Add(emailAddressLabel);
|
||||
this.parent_groupBox.Controls.Add(this.emailAddressTextBox);
|
||||
this.parent_groupBox.Controls.Add(phoneNumberLabel);
|
||||
this.parent_groupBox.Controls.Add(this.phoneNumberNumericUpDown);
|
||||
this.parent_groupBox.Controls.Add(firstNameLabel1);
|
||||
this.parent_groupBox.Controls.Add(this.parent_firstNameTextBox);
|
||||
this.parent_groupBox.Controls.Add(lastNameLabel1);
|
||||
this.parent_groupBox.Controls.Add(this.parent_lastNameTextBox);
|
||||
this.parent_groupBox.Location = new System.Drawing.Point(606, 51);
|
||||
this.parent_groupBox.Name = "parent_groupBox";
|
||||
this.parent_groupBox.Size = new System.Drawing.Size(344, 235);
|
||||
this.parent_groupBox.TabIndex = 21;
|
||||
this.parent_groupBox.TabStop = false;
|
||||
this.parent_groupBox.Text = "Parent Information";
|
||||
//
|
||||
// emailAddressTextBox
|
||||
//
|
||||
this.emailAddressTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.studentBindingSource, "Parent.EmailAddress", true));
|
||||
this.emailAddressTextBox.Location = new System.Drawing.Point(131, 189);
|
||||
this.emailAddressTextBox.Name = "emailAddressTextBox";
|
||||
this.emailAddressTextBox.Size = new System.Drawing.Size(172, 26);
|
||||
this.emailAddressTextBox.TabIndex = 7;
|
||||
this.toolTips.SetToolTip(this.emailAddressTextBox, "Enter a valid email address with @");
|
||||
this.emailAddressTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.emailAddressTextBox_Validating);
|
||||
//
|
||||
// phoneNumberNumericUpDown
|
||||
//
|
||||
this.phoneNumberNumericUpDown.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.studentBindingSource, "Parent.PhoneNumber", true));
|
||||
this.phoneNumberNumericUpDown.Location = new System.Drawing.Point(131, 139);
|
||||
this.phoneNumberNumericUpDown.Maximum = new decimal(new int[] {
|
||||
1410065407,
|
||||
2,
|
||||
0,
|
||||
0});
|
||||
this.phoneNumberNumericUpDown.Minimum = new decimal(new int[] {
|
||||
1000000000,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.phoneNumberNumericUpDown.Name = "phoneNumberNumericUpDown";
|
||||
this.phoneNumberNumericUpDown.Size = new System.Drawing.Size(172, 26);
|
||||
this.phoneNumberNumericUpDown.TabIndex = 5;
|
||||
this.toolTips.SetToolTip(this.phoneNumberNumericUpDown, "Enter 9 digit phone number with no symbols.");
|
||||
this.phoneNumberNumericUpDown.Value = new decimal(new int[] {
|
||||
1000000000,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.phoneNumberNumericUpDown.Validating += new System.ComponentModel.CancelEventHandler(this.phoneNumberNumericUpDown_Validating);
|
||||
//
|
||||
// parent_firstNameTextBox
|
||||
//
|
||||
this.parent_firstNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.studentBindingSource, "Parent.FirstName", true));
|
||||
this.parent_firstNameTextBox.Location = new System.Drawing.Point(130, 87);
|
||||
this.parent_firstNameTextBox.Name = "parent_firstNameTextBox";
|
||||
this.parent_firstNameTextBox.Size = new System.Drawing.Size(173, 26);
|
||||
this.parent_firstNameTextBox.TabIndex = 3;
|
||||
this.parent_firstNameTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.String_TextBox_Validating);
|
||||
//
|
||||
// parent_lastNameTextBox
|
||||
//
|
||||
this.parent_lastNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.studentBindingSource, "Parent.LastName", true));
|
||||
this.parent_lastNameTextBox.Location = new System.Drawing.Point(130, 39);
|
||||
this.parent_lastNameTextBox.Name = "parent_lastNameTextBox";
|
||||
this.parent_lastNameTextBox.Size = new System.Drawing.Size(173, 26);
|
||||
this.parent_lastNameTextBox.TabIndex = 1;
|
||||
this.parent_lastNameTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.String_TextBox_Validating);
|
||||
//
|
||||
// clear_button
|
||||
//
|
||||
this.clear_button.Location = new System.Drawing.Point(169, 350);
|
||||
this.clear_button.Name = "clear_button";
|
||||
this.clear_button.Size = new System.Drawing.Size(116, 54);
|
||||
this.clear_button.TabIndex = 22;
|
||||
this.clear_button.Text = "Clear form for new student";
|
||||
this.clear_button.UseVisualStyleBackColor = true;
|
||||
this.clear_button.Click += new System.EventHandler(this.clear_button_Click);
|
||||
//
|
||||
// delete_button
|
||||
//
|
||||
this.delete_button.Location = new System.Drawing.Point(320, 350);
|
||||
this.delete_button.Name = "delete_button";
|
||||
this.delete_button.Size = new System.Drawing.Size(104, 54);
|
||||
this.delete_button.TabIndex = 23;
|
||||
this.delete_button.Text = "Delete";
|
||||
this.delete_button.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pic_openFileDialog
|
||||
//
|
||||
this.pic_openFileDialog.DefaultExt = "*.png";
|
||||
this.pic_openFileDialog.FileName = "pic_openFileDialog";
|
||||
this.pic_openFileDialog.Filter = "Photos|*.png";
|
||||
this.pic_openFileDialog.Title = "Upload student photo";
|
||||
this.pic_openFileDialog.FileOk += new System.ComponentModel.CancelEventHandler(this.pic_openFileDialog_FileOk);
|
||||
//
|
||||
// lblSearch
|
||||
//
|
||||
this.lblSearch.AutoSize = true;
|
||||
this.lblSearch.Location = new System.Drawing.Point(612, 295);
|
||||
this.lblSearch.Name = "lblSearch";
|
||||
this.lblSearch.Size = new System.Drawing.Size(226, 20);
|
||||
this.lblSearch.TabIndex = 24;
|
||||
this.lblSearch.Text = "Search Student by Last Name:";
|
||||
//
|
||||
// search_textBox
|
||||
//
|
||||
this.search_textBox.Location = new System.Drawing.Point(616, 318);
|
||||
this.search_textBox.Name = "search_textBox";
|
||||
this.search_textBox.Size = new System.Drawing.Size(284, 26);
|
||||
this.search_textBox.TabIndex = 25;
|
||||
this.toolTips.SetToolTip(this.search_textBox, "Type last name of student and hit enter");
|
||||
this.search_textBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.search_textBox_KeyDown);
|
||||
//
|
||||
// errorProvider1
|
||||
//
|
||||
this.errorProvider1.ContainerControl = this;
|
||||
//
|
||||
// btnChaosMonkey
|
||||
//
|
||||
this.btnChaosMonkey.Location = new System.Drawing.Point(475, 350);
|
||||
this.btnChaosMonkey.Name = "btnChaosMonkey";
|
||||
this.btnChaosMonkey.Size = new System.Drawing.Size(96, 66);
|
||||
this.btnChaosMonkey.TabIndex = 26;
|
||||
this.btnChaosMonkey.Text = "CHAOS MONKEY";
|
||||
this.btnChaosMonkey.UseVisualStyleBackColor = true;
|
||||
this.btnChaosMonkey.Click += new System.EventHandler(this.btnChaosMonkey_Click);
|
||||
//
|
||||
// foundStudents_comboBox
|
||||
//
|
||||
this.foundStudents_comboBox.FormattingEnabled = true;
|
||||
this.foundStudents_comboBox.Location = new System.Drawing.Point(620, 376);
|
||||
this.foundStudents_comboBox.Name = "foundStudents_comboBox";
|
||||
this.foundStudents_comboBox.Size = new System.Drawing.Size(284, 28);
|
||||
this.foundStudents_comboBox.TabIndex = 27;
|
||||
this.foundStudents_comboBox.SelectionChangeCommitted += new System.EventHandler(this.foundStudents_comboBox_SelectionChangeCommitted);
|
||||
this.foundStudents_comboBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.foundStudents_comboBox_KeyDown);
|
||||
//
|
||||
// lblFoundStudents
|
||||
//
|
||||
this.lblFoundStudents.AutoSize = true;
|
||||
this.lblFoundStudents.Location = new System.Drawing.Point(612, 350);
|
||||
this.lblFoundStudents.Name = "lblFoundStudents";
|
||||
this.lblFoundStudents.Size = new System.Drawing.Size(128, 20);
|
||||
this.lblFoundStudents.TabIndex = 28;
|
||||
this.lblFoundStudents.Text = "Found Students:";
|
||||
//
|
||||
// studentBindingSource
|
||||
//
|
||||
this.studentBindingSource.DataSource = typeof(DBWizard.Models.Student);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(992, 450);
|
||||
this.Controls.Add(this.lblFoundStudents);
|
||||
this.Controls.Add(this.foundStudents_comboBox);
|
||||
this.Controls.Add(this.btnChaosMonkey);
|
||||
this.Controls.Add(this.search_textBox);
|
||||
this.Controls.Add(this.lblSearch);
|
||||
this.Controls.Add(this.delete_button);
|
||||
this.Controls.Add(this.clear_button);
|
||||
this.Controls.Add(this.parent_groupBox);
|
||||
this.Controls.Add(this.save_button);
|
||||
this.Controls.Add(gradeLevelLabel);
|
||||
this.Controls.Add(this.gradeLevelComboBox);
|
||||
this.Controls.Add(genderLabel);
|
||||
this.Controls.Add(this.genderComboBox);
|
||||
this.Controls.Add(schoolLabel);
|
||||
this.Controls.Add(this.schoolComboBox);
|
||||
this.Controls.Add(addressLabel);
|
||||
this.Controls.Add(this.addressTextBox);
|
||||
this.Controls.Add(this.programComboBox);
|
||||
this.Controls.Add(programNameLabel);
|
||||
this.Controls.Add(this.dob_dateTimePicker);
|
||||
this.Controls.Add(dOBLabel);
|
||||
this.Controls.Add(student_idLabel);
|
||||
this.Controls.Add(this.student_idTextBox);
|
||||
this.Controls.Add(firstNameLabel);
|
||||
this.Controls.Add(this.firstNameTextBox);
|
||||
this.Controls.Add(lastNameLabel);
|
||||
this.Controls.Add(this.lastNameTextBox);
|
||||
this.Controls.Add(this.student_pictureBox);
|
||||
this.Controls.Add(this.topTableLayoutPanel);
|
||||
this.MainMenuStrip = this.mainMenuStrip;
|
||||
this.Name = "Form1";
|
||||
this.Text = "KentYouthDB";
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
this.topTableLayoutPanel.ResumeLayout(false);
|
||||
this.topTableLayoutPanel.PerformLayout();
|
||||
this.mainMenuStrip.ResumeLayout(false);
|
||||
this.mainMenuStrip.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.studentBindingNavigator)).EndInit();
|
||||
this.studentBindingNavigator.ResumeLayout(false);
|
||||
this.studentBindingNavigator.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.student_pictureBox)).EndInit();
|
||||
this.parent_groupBox.ResumeLayout(false);
|
||||
this.parent_groupBox.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.phoneNumberNumericUpDown)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.studentBindingSource)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel topTableLayoutPanel;
|
||||
private System.Windows.Forms.MenuStrip mainMenuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
||||
private System.Windows.Forms.BindingNavigator studentBindingNavigator;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorAddNewItem;
|
||||
private System.Windows.Forms.BindingSource studentBindingSource;
|
||||
private System.Windows.Forms.ToolStripLabel bindingNavigatorCountItem;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorDeleteItem;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorMoveFirstItem;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorMovePreviousItem;
|
||||
private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator;
|
||||
private System.Windows.Forms.ToolStripTextBox bindingNavigatorPositionItem;
|
||||
private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator1;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorMoveNextItem;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorMoveLastItem;
|
||||
private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator2;
|
||||
private System.Windows.Forms.ToolStripButton studentBindingNavigatorSaveItem;
|
||||
private System.Windows.Forms.PictureBox student_pictureBox;
|
||||
private System.Windows.Forms.TextBox lastNameTextBox;
|
||||
private System.Windows.Forms.TextBox firstNameTextBox;
|
||||
private System.Windows.Forms.TextBox student_idTextBox;
|
||||
private System.Windows.Forms.DateTimePicker dob_dateTimePicker;
|
||||
private System.Windows.Forms.ComboBox programComboBox;
|
||||
private System.Windows.Forms.TextBox addressTextBox;
|
||||
private System.Windows.Forms.ComboBox schoolComboBox;
|
||||
private System.Windows.Forms.ComboBox genderComboBox;
|
||||
private System.Windows.Forms.ComboBox gradeLevelComboBox;
|
||||
private System.Windows.Forms.ToolStripMenuItem newStudentToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem saveStudentToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem reportsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem studentBySchoolToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem studentsByProgramToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem exitsavesDataToolStripMenuItem;
|
||||
private System.Windows.Forms.Button save_button;
|
||||
private System.Windows.Forms.GroupBox parent_groupBox;
|
||||
private System.Windows.Forms.TextBox emailAddressTextBox;
|
||||
private System.Windows.Forms.NumericUpDown phoneNumberNumericUpDown;
|
||||
private System.Windows.Forms.TextBox parent_firstNameTextBox;
|
||||
private System.Windows.Forms.TextBox parent_lastNameTextBox;
|
||||
private System.Windows.Forms.Button clear_button;
|
||||
private System.Windows.Forms.Button delete_button;
|
||||
private System.Windows.Forms.OpenFileDialog pic_openFileDialog;
|
||||
private System.Windows.Forms.Label lblSearch;
|
||||
private System.Windows.Forms.TextBox search_textBox;
|
||||
private System.Windows.Forms.ErrorProvider errorProvider1;
|
||||
private System.Windows.Forms.ToolTip toolTips;
|
||||
private System.Windows.Forms.Button btnChaosMonkey;
|
||||
private System.Windows.Forms.Label lblFoundStudents;
|
||||
private System.Windows.Forms.ComboBox foundStudents_comboBox;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,335 @@
|
|||
using DBWizard.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
/* References
|
||||
* https://www.youtube.com/watch?v=ayp3tHEkRc0
|
||||
* https://www.coderslexicon.com/passing-data-between-forms-using-delegates-and-events/
|
||||
* https://dapper-tutorial.net/parameter-anonymous
|
||||
* https://www.sqlitetutorial.net/sqlite-foreign-key/
|
||||
* https://stackoverflow.com/questions/289680/difference-between-2-dates-in-sqlite
|
||||
* https://dzone.com/articles/convert-object-byte-array-and
|
||||
*/
|
||||
// Using a delegate to trigger method on the customer view form
|
||||
// https://www.coderslexicon.com/passing-data-between-forms-using-delegates-and-events/
|
||||
|
||||
|
||||
|
||||
namespace DBWizard
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
SqliteDataAccess SqliteDataAccess = new SqliteDataAccess();
|
||||
bool bStudentRecordExists = false;
|
||||
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
FillComboBoxes();
|
||||
}
|
||||
|
||||
/* Fills program and school combo boxes on the form
|
||||
* with the static data from the sqlite db.
|
||||
* input: no input
|
||||
* output: void
|
||||
*/
|
||||
private void FillComboBoxes()
|
||||
{
|
||||
List<Program> programs = new List<Program>();
|
||||
programs = SqliteDataAccess.GetPrograms();
|
||||
|
||||
foreach (Program p in programs)
|
||||
{
|
||||
programComboBox.Items.Add(p.name);
|
||||
}
|
||||
|
||||
List<School> schools = new List<School>();
|
||||
schools = SqliteDataAccess.GetSchools();
|
||||
foreach (School s in schools)
|
||||
{
|
||||
schoolComboBox.Items.Add(s.name);
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: implement
|
||||
private void student_pictureBox_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult dr = pic_openFileDialog.ShowDialog();
|
||||
if(dr == DialogResult.OK)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void pic_openFileDialog_FileOk(object sender, CancelEventArgs e)
|
||||
{
|
||||
byte[] dickpic;
|
||||
|
||||
//Chunk file into bytes.
|
||||
//If file > 2147483647 bytes long, reject file.
|
||||
dickpic = ObjectToByteArray(student_pictureBox.Image);
|
||||
if (dickpic.Length >= 2147483647) //THAT'S WHAT SHE SAID
|
||||
{
|
||||
MessageBox.Show("The selected student photo size is too large. Choose a smaller photo size or shrink the photo.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: implement
|
||||
private void pictureBox1_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult dr = pic_openFileDialog.ShowDialog();
|
||||
if(dr == DialogResult.OK)
|
||||
{
|
||||
//Place in dicpic box
|
||||
|
||||
//change tag of pic box to something else
|
||||
student_pictureBox.Tag = "dickpic";
|
||||
}
|
||||
}
|
||||
|
||||
private void save_button_Click(object sender, EventArgs e)
|
||||
{
|
||||
byte[] dickpic;
|
||||
|
||||
//Perform sanity check, ensure all data is filled except picture
|
||||
|
||||
// Check to see if any control is in error.
|
||||
foreach (Control c in errorProvider1.ContainerControl.Controls)
|
||||
{
|
||||
if (errorProvider1.GetError(c) != "")
|
||||
{
|
||||
MessageBox.Show("Please fix the errors on the form!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Validate the picture is under 2147483647 characters in length.
|
||||
dickpic = ObjectToByteArray(student_pictureBox.Image);
|
||||
if(dickpic.Length >= 2147483647) //THAT'S WHAT SHE SAID
|
||||
{
|
||||
MessageBox.Show("The selected student photo size is too large. Choose a smaller photo size or shrink the photo.");
|
||||
return;
|
||||
}
|
||||
|
||||
//Collect form data in student object
|
||||
Student student = new Student();
|
||||
student.student_id = student_idTextBox.Text;
|
||||
student.FirstName = firstNameTextBox.Text;
|
||||
student.LastName = lastNameTextBox.Text;
|
||||
student.DOB = dob_dateTimePicker.Value.ToString();
|
||||
student.gender = genderComboBox.Text;
|
||||
student.address = addressTextBox.Text;
|
||||
student.program_id = programComboBox.SelectedIndex + 1;
|
||||
student.school_id = schoolComboBox.SelectedIndex + 1;
|
||||
student.GradeLevel = gradeLevelComboBox.Text;
|
||||
|
||||
if (student_pictureBox.Tag.ToString() == "DefaultImage")
|
||||
student.photo = null;
|
||||
else
|
||||
student.photo = ObjectToByteArray(student_pictureBox.Image);
|
||||
|
||||
//collect parent
|
||||
Parent parent = new Parent();
|
||||
parent.LastName = parent_lastNameTextBox.Text;
|
||||
parent.FirstName = parent_firstNameTextBox.Text;
|
||||
parent.PhoneNumber = long.Parse(phoneNumberNumericUpDown.Value.ToString());
|
||||
parent.EmailAddress = emailAddressTextBox.Text;
|
||||
|
||||
//save data to sqldb.
|
||||
//update existing student.
|
||||
if(SqliteDataAccess.FindStudentByStudentId(student.student_id).Count > 0)
|
||||
{
|
||||
SqliteDataAccess.UpdateStudent(student);
|
||||
SqliteDataAccess.UpdateParent(parent,student.parent_id);
|
||||
}
|
||||
else //new student
|
||||
{
|
||||
student.parent_id = SqliteDataAccess.InsertNewParent(parent);
|
||||
SqliteDataAccess.InsertNewStudent(student);
|
||||
MessageBox.Show("Student successfully added");
|
||||
}
|
||||
}
|
||||
|
||||
//Convert student photo to byte array for saving to db.
|
||||
//Also used to see if the photo is too large for the db blob type.
|
||||
private byte[] ObjectToByteArray(Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return null;
|
||||
|
||||
BinaryFormatter bf = new BinaryFormatter();
|
||||
MemoryStream ms = new MemoryStream();
|
||||
bf.Serialize(ms, obj);
|
||||
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
//Convert student photo from byte array to object.
|
||||
// Convert a byte array to an Object
|
||||
private Object ByteArrayToObject(byte[] arrBytes)
|
||||
|
||||
{
|
||||
MemoryStream memStream = new MemoryStream();
|
||||
BinaryFormatter binForm = new BinaryFormatter();
|
||||
|
||||
memStream.Write(arrBytes, 0, arrBytes.Length);
|
||||
memStream.Seek(0, SeekOrigin.Begin);
|
||||
Object obj = (Object)binForm.Deserialize(memStream);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
// Basic input validation on a string given a textbox control
|
||||
// ensures only values a-z, with length two or greater.
|
||||
private void String_TextBox_Validating(object sender, CancelEventArgs e)
|
||||
{
|
||||
TextBox tb = (TextBox)sender;
|
||||
if (!Regex.IsMatch(tb.Text, "[A-Za-z]{2,}"))
|
||||
errorProvider1.SetError(tb, "Enter a value a-z only of length two or longer.");
|
||||
else
|
||||
errorProvider1.SetError(tb, "");
|
||||
}
|
||||
|
||||
private void ComboBox_Validating(object sender, CancelEventArgs e)
|
||||
{
|
||||
ComboBox cb = (ComboBox)sender;
|
||||
|
||||
if (cb.SelectedIndex < 0)
|
||||
{ errorProvider1.SetError(cb, "Select an item."); }
|
||||
else
|
||||
{ errorProvider1.SetError(cb, ""); }
|
||||
}
|
||||
|
||||
/* Does not really check to see if it is a valid phone number
|
||||
* since the phone companies introduce new area codes all the damn time.
|
||||
* Only checks to see the most likely case that the user of the program
|
||||
* has left the phone number value as the default minimum value.
|
||||
*/
|
||||
private void phoneNumberNumericUpDown_Validating(object sender, CancelEventArgs e)
|
||||
{
|
||||
if(phoneNumberNumericUpDown.Value == phoneNumberNumericUpDown.Minimum
|
||||
|| phoneNumberNumericUpDown.Value == phoneNumberNumericUpDown.Maximum)
|
||||
{ errorProvider1.SetError(phoneNumberNumericUpDown, "Type in a valid phone number"); }
|
||||
else
|
||||
{ errorProvider1.SetError(phoneNumberNumericUpDown, ""); }
|
||||
}
|
||||
|
||||
private void emailAddressTextBox_Validating(object sender, CancelEventArgs e)
|
||||
{
|
||||
//email address regex
|
||||
//^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$
|
||||
if (!Regex.IsMatch(emailAddressTextBox.Text, @"^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$"))
|
||||
errorProvider1.SetError(emailAddressTextBox, "Enter a valid email address: user@domain.com");
|
||||
else
|
||||
errorProvider1.SetError(emailAddressTextBox, "");
|
||||
}
|
||||
|
||||
private void dob_dateTimePicker_Validating(object sender, CancelEventArgs e)
|
||||
{
|
||||
if(dob_dateTimePicker.Value == DateTime.Now)
|
||||
{ errorProvider1.SetError(dob_dateTimePicker, "Please choose DOB."); }
|
||||
else
|
||||
{ errorProvider1.SetError(dob_dateTimePicker, ""); }
|
||||
}
|
||||
|
||||
private void student_idTextBox_Validating(object sender, CancelEventArgs e)
|
||||
{
|
||||
TextBox tb = (TextBox)sender;
|
||||
if (!Regex.IsMatch(tb.Text, "[A-Za-z0-9]{2,}"))
|
||||
errorProvider1.SetError(tb, "Enter a value a-z0-9 only of length two or longer.");
|
||||
else
|
||||
errorProvider1.SetError(tb, "");
|
||||
|
||||
}
|
||||
|
||||
//TODO: Remove Chaos Monkey button
|
||||
private void btnChaosMonkey_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("CHAOS MONKEY");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
private void clear_button_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearForm();
|
||||
}
|
||||
|
||||
// clears the form
|
||||
private void ClearForm()
|
||||
{
|
||||
foreach(Control c in this.Controls)
|
||||
{
|
||||
if (c is TextBox)
|
||||
{
|
||||
TextBox tb = (TextBox)c;
|
||||
tb.Text = null;
|
||||
}
|
||||
|
||||
if(c is ComboBox)
|
||||
{
|
||||
ComboBox cb = (ComboBox)c;
|
||||
cb.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
if(c is DateTimePicker)
|
||||
{
|
||||
DateTimePicker dtp = (DateTimePicker)c;
|
||||
dtp.Value = DateTime.Today;
|
||||
}
|
||||
|
||||
if(c is NumericUpDown)
|
||||
{
|
||||
NumericUpDown nud = (NumericUpDown)c;
|
||||
nud.Value = nud.Minimum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void search_textBox_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
List<Student> foundStudents = new List<Student>();
|
||||
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
foundStudents_comboBox.Items.Clear();
|
||||
foundStudents_comboBox.Text = String.Empty;
|
||||
|
||||
foundStudents = SqliteDataAccess.FindStudentByLastname(search_textBox.Text);
|
||||
|
||||
foreach (Student s in foundStudents)
|
||||
{
|
||||
foundStudents_comboBox.Items.Add(s);
|
||||
}
|
||||
|
||||
foundStudents_comboBox.Text = (foundStudents.Count > 0) ? "Students found, click here" : "No students found";
|
||||
}
|
||||
}
|
||||
|
||||
//Do nothing if the user tries to type in the found student combobox.
|
||||
private void foundStudents_comboBox_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
|
||||
//TODO:Populate the form based on the found student.
|
||||
private void foundStudents_comboBox_SelectionChangeCommitted(object sender, EventArgs e)
|
||||
{
|
||||
ClearForm();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,305 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||