教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 文库大全 > 教育文库 >

C#课程设计—自动取款机模拟软件设计(3)

来源:网络收集 时间:2026-08-24
导读: decimal jine = Convert.ToDecimal(dr[2]); string wo = Convert.ToString(dr[1]); decimal sqje = Convert.ToDecimal(maskedTextBox1.Text); dr.Close(); if (jine sqje) { MessageBox.Show(正在操作,请稍侯……)

decimal jine = Convert.ToDecimal(dr[2]); string wo = Convert.ToString(dr[1]);

decimal sqje = Convert.ToDecimal(maskedTextBox1.Text); dr.Close(); if (jine > sqje) {

MessageBox.Show("正在操作,请稍侯……"); decimal leftmoney = jine - sqje;

string ssql = "Update userinfo set yue = '" + leftmoney + "' where yonghu ='" + Form1.lockID + "'";

SqlCommand ccmd = new SqlCommand(ssql, conn);

int i = ccmd.ExecuteNonQuery(); if (i == 1) {

string sqql = "select * from userinfo where yonghu='" + maskedTextBox2.Text.Trim() + "'";

SqlCommand cmdd = new SqlCommand(sqql, conn); SqlDataReader drr = cmdd.ExecuteReader(); if (drr.Read()) {

decimal je = Convert.ToDecimal(drr[2]); string presentname = wo;

string cardid = "'" + Form1.lockID + "'"; decimal change = sqje;

string time = Convert.ToString(DateTime.Now); je = je + sqje; drr.Close();

string sqql1 = "Update userinfo set yue='" + je + "'where yonghu='" + maskedTextBox2.Text.Trim() + "'";

SqlCommand cmmdd = new SqlCommand(sqql1, conn); int n = cmmdd.ExecuteNonQuery(); if (n == 1) {

MessageBox.Show("转账成功!"); maskedTextBox2.Text = "";

C#课程设计—自动取款机模拟软件设计,附软件界面截图、程序源代码和数据库设计,仅供学习使用。

maskedTextBox1.Text = ""; } else {

MessageBox.Show("转账失败!"); maskedTextBox2.Text = ""; maskedTextBox1.Text = ""; }

} else {

MessageBox.Show("操作失败,请重试!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else

{ } } else {

MessageBox.Show("您的余额不足,请重新输入金额!"); maskedTextBox1.Text = ""; } }

private void button1_Click(object sender, EventArgs e) {

maskedTextBox1.Text = ""; }

private void button2_Click(object sender, EventArgs e) {

Form2 frm = new Form2(); frm.Show(); this.Hide(); }

private void Form5_Load(object sender, EventArgs e) { }

private void label2_Click(object sender, EventArgs e) { } } }

C#课程设计—自动取款机模拟软件设计,附软件界面截图、程序源代码和数据库设计,仅供学习使用。

(7)交费窗体:通过该界面用户可以自行交费,其界面如图2-8所示:

图2-8 交费窗口 代码如下:

namespace Windowasd {

public partial class Form6 : Form {

public Form6() {

InitializeComponent(); }

private void maskedTextBox1_MaskInputRejected(object sender, MaskInputRejectedEventArgs e) { }

private void button1_Click(object sender, EventArgs e) {

Form2 frm = new Form2(); frm.Show(); this.Hide(); }

private void button2_Click(object sender, EventArgs e) {

maskedTextBox1.Text = "";

…… 此处隐藏:194字,全部文档内容请下载后查看。喜欢就下载吧 ……
C#课程设计—自动取款机模拟软件设计(3).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wenku/109294.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)