信息工程学院C#程序设计综合实验设计报告设计题目:基于C/S的WPF简易银行管理系统专业班级:软件工程2015级 3 班课题组长:俞江跃课题成员:张世洋张栋吴文浩王玉飞小组成绩:指导教师:***课题工作时间:2017-06-05 至2017-06-10信息工程学院 C#程序设计综合实验设计报告指导教师:马宗保日期:2017年6月6日成绩评定表组长姓名:俞江跃学号:2511150342 专业/班级:软件工程2015级 3 班目录第一章设计简介及设计方案论述 (2)1.1 系统功能设计 (2)1.2 系统数据库设计 (3)1.3系统已实现功能 (3)第二章程序代码 (8)2.1 职工管理功能 (8)2.2 职工工资管理功能 (10)2.3 存款查询功能 (12)第三章设计结果及分析 (15)3.1职员管理功能运行结果及分析 (15)3. 2 职员工资调整功能运行结果及分析 (16)3. 3 存款查询功能运行结果及分析 (16)第一章设计简介及设计方案论述1.1 系统功能设计本银行账户管理信息系统能实现的主要功能有:登录页面;开户、存款、取款;当日汇总,汇总查询,存款查询;职员管理,工资调整;更改账户密码,更改操作员密码。
利率设置。
1.2 系统数据库设计1.3系统已实现功能登录模块进入系统前首先进入登录这个界面,当用户登录成功后,可以进入主界面。
图1.3-1 登陆模块存款取款模块拥有开户,存款,取款的功能。
图1.3-2开户图1.3-3存款图1.3-4取款汇总查询模块图1.3-5当日汇总图1.3-6汇总查询利率设置模块图1.3-7利率设置第二章程序代码2.1 职工管理功能可以对员工进行修改,删除。
<StackPanel><DataGrid Name="dataGrid1" AutoGenerateColumns="False"Background="#FFDDFBF9"><DataGrid.Columns><DataGridTextColumn Header="员工号" Binding="{Binding EmployeeNo }" Width="70" /><DataGridTextColumn Header="员工名" Binding="{Binding EmployeeName}" Width="70" /><DataGridTextColumn Header="性别" Binding="{Binding sex}" Width="50" /><DataGridTextColumn Header="员工类型" Binding="{Binding classid }" Width="70" /><DataGridTextColumn Header="电话" Binding="{Binding telphone}" Width="*" /></DataGrid.Columns></DataGrid><Button Content="保存" Width="70" Margin="0 10 0 0" Click="Button_Click_1" /></StackPanel>C#代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;namespace BankManage.employee{/// <summary>/// EmployeeBase.xaml 的交互逻辑/// </summary>public partial class EmployeeBase : Page{BankEntities context = new BankEntities();public EmployeeBase(){InitializeComponent();this.Unloaded +=EmployeePage_Unloaded;var q = from t in context.EmployeeInfoselect t;dataGrid1.ItemsSource = q.ToList();}void EmployeePage_Unloaded(object sender, RoutedEventArgs e) {context.Dispose();}private void Button_Click_1(object sender, RoutedEventArgs e) {try{context.SaveChanges();MessageBox.Show("保存成功!");}catch (Exception ex){MessageBox.Show(ex.Message, "保存失败");}}}}2.2 职工工资管理功能可以调整员工工资。
<StackPanel><DataGrid Name="dataGrid1" AutoGenerateColumns="False"Background="#FFDDFBF9"><DataGrid.Columns><DataGridTextColumn Header="员工号" Binding="{Binding EmployeeNo }" Width="70" /><DataGridTextColumn Header="员工名" Binding="{Binding EmployeeName}" Width="70" /><DataGridTextColumn Header="员工类型" Binding="{Binding classid }" Width="70" /><DataGridTextColumn Header="员工工资" Binding="{Binding gongzi}" Width="*" /></DataGrid.Columns></DataGrid><Button Content="保存" Width="70" Margin="0 10 0 0" Click="Button_Click_1" /></StackPanel>C#代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;namespace BankManage.employee{/// <summary>/// ChangePay.xaml 的交互逻辑/// </summary>public partial class ChangePay : Page{BankEntities context = new BankEntities();public ChangePay(){InitializeComponent();this.Unloaded += ChangePage_Unloaded;var q = from t in context.EmployeeInfoselect t;dataGrid1.ItemsSource = q.ToList();}void ChangePage_Unloaded(object sender, RoutedEventArgs e){context.Dispose();}//保存private void Button_Click_1(object sender, RoutedEventArgs e){try{context.SaveChanges();MessageBox.Show("保存成功!");}catch (Exception ex){MessageBox.Show(ex.Message, "保存失败");}}}}2.3 存款查询功能Xaml代码:<Grid><Grid.RowDefinitions><RowDefinition Height="Auto"></RowDefinition><RowDefinition Height="*"></RowDefinition></Grid.RowDefinitions><Grid Grid.Row="0"><Grid.ColumnDefinitions><ColumnDefinition Width="Auto"></ColumnDefinition><ColumnDefinition></ColumnDefinition><ColumnDefinition Width="Auto"></ColumnDefinition></Grid.ColumnDefinitions><Grid.RowDefinitions><RowDefinition Height="Auto"></RowDefinition><RowDefinition Height="*"></RowDefinition></Grid.RowDefinitions><TextBlock Text="存款查询" FontSize="20" TextAlignment="Center" Grid.Row="0" Grid.ColumnSpan="3" ></TextBlock><TextBlock Margin="7" Grid.Row="1">身份证号:</TextBlock><TextBox Name="txtID2" Margin="5" Grid.Column="1" Grid.Row="1"></TextBox><Button Margin="5" Padding="2" Grid.Column="2" Grid.Row="1" Click="Button_Click_1">查询</Button></Grid><Grid Grid.Row="1"><Grid.RowDefinitions><RowDefinition Height="Auto"></RowDefinition></Grid.RowDefinitions><DataGrid Grid.Row="0" AutoGenerateColumns="False" Background="#FFDDFBF9" Name="datagrid1" CanUserAddRows="False" CanUserDeleteRows="False" ><DataGrid.Columns><DataGridTextColumn Header="身份证号" Binding="{Binding IdCard}" Width="100" /><DataGridTextColumn Header="姓名" Binding="{Binding accountName }" Width="60"/><DataGridTextColumn Header="帐号" Binding="{Binding accountNo}" Width="100"/><DataGridTextColumn Header="存款类型" Binding="{Binding accountType}" Width="90"/><DataGridTextColumn Header="账户余额" Binding="{Binding accountPass}" Width="*" /></DataGrid.Columns></DataGrid></Grid></Grid>C#代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;namespace BankManage.query{/// <summary>/// Page1.xaml 的交互逻辑/// </summary>public partial class SaveQuery : Page{BankEntities context = new BankEntities();public SaveQuery(){InitializeComponent();this.Unloaded += TotalQuery_Unloaded;}void TotalQuery_Unloaded(object sender, RoutedEventArgs e){context.Dispose();}//查询当前账号的所有记录信息private void Button_Click_1(object sender, RoutedEventArgs e){var query = from t in context.AccountInfowhere t.IdCard == txtID2.Textselect t;datagrid1.ItemsSource = query.ToList();}}}第三章设计结果及分析3.1职员管理功能运行结果及分析图3.1职员管理功能运行结果分析:可以修改已有职员数据,但添加新数据时存在不足,添完后再次返回时新数据又会消失。