资源简介
c#实验设备管理系统,实习做的,适合初学入门者,应该算是不错的源码
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace DeviceManagement
{
public partial class AddDevice : Form
{
public AddDevice()
{
InitializeComponent();
bind();
checkBox1.Checked = false;
textBox6.Enabled = false;
}
private void button1_Click(object sender EventArgs e)
{
addEquipment();
}
private void bind()
{
comboBox1.DataSource = GetEquipType();
comboBox1.DisplayMember = “TypeName“;
comboBox1.ValueMember = “TypeID“;
}
public DataTable GetEquipType()
{
string cmd = “select * from EquipmentType“;
return DBHelperSQL.QueryTb(cmd);
}
private void addEquipment()
{
List sqlcmds = new List();
int number=1 ;
if (comboBox1.SelectedValue==null)
{
return;
}
int TypeID =(int) comboBox1.SelectedValue;
string price = textBox2.Text.Trim();
string name=textBox8.Text.Trim();
string sign=textBox7.Text.Trim();
string modle=textBox1.Text.Trim();
DateTime buytime=dateTimePicker1.Value;
string madeplace=textBox5.Text.Trim();
string store=textBox4.Text.Trim();
string content=textBox3.Text.Trim();
if (!DBHelperSQL.IsDouble(price))
{
MessageBox.Show(“请输入真确的价格“);
return;
}
if (checkBox1.Checked)
{
try
{
number = int.Parse(textBox6.Text.Trim());
if (number<1)
{
MessageBox.Show(“请为设备个数输入非负数“);
return;
}
}
catch (Exception)
{
MessageBox.Show(“请正确输入设备数“);
return;
}
}
int baseNumber = GetMax();
if (baseNumber == 0)
{
baseNumber = int.Parse( TypeID.ToString()+“00000000“);
}
for (int i = 0; i < number; i++)
{
baseNumber += 1;
string cmd = “insert into EquipmentInf values(‘“ + baseNumber + “‘‘“ + name + “‘‘“ + TypeID + “‘‘“ + sign + “‘‘“ + modle + “‘‘“ + price + “‘1‘“ + madeplace + “‘‘“ + buytime + “‘‘“ + store + “‘‘“ + content + “‘)“;
sqlcmds.Add(cmd);
}
int result = DBHelperSQL.ExecuteSqls(sqlcmds);
if (result < 1)
{
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 938 2009-10-10 10:05 DeviceManagement\DeviceManagement.sln
..A..H. 72192 2009-10-18 15:58 DeviceManagement\DeviceManagement.suo
文件 1935 2009-10-14 22:19 DeviceManagement\DeviceManagement\Login.cs
文件 6682 2009-10-14 22:19 DeviceManagement\DeviceManagement\Login.Designer.cs
文件 479 2009-10-14 18:18 DeviceManagement\DeviceManagement\Program.cs
文件 14914 2009-10-18 14:47 DeviceManagement\DeviceManagement\DeviceManagement.csproj
文件 4885 2009-10-14 18:18 DeviceManagement\DeviceManagement\AddType.cs
文件 8978 2009-10-14 15:00 DeviceManagement\DeviceManagement\AddType.Designer.cs
文件 1406 2009-10-14 18:13 DeviceManagement\DeviceManagement\1.ico
文件 6524 2009-10-14 22:30 DeviceManagement\DeviceManagement\DMain.cs
文件 5814 2009-10-14 15:00 DeviceManagement\DeviceManagement\AddType.resx
文件 51224 2009-10-14 22:30 DeviceManagement\DeviceManagement\DMain.Designer.cs
文件 1842 2009-10-14 18:18 DeviceManagement\DeviceManagement\PasswordManage.cs
文件 7582 2009-10-14 18:07 DeviceManagement\DeviceManagement\PasswordManage.Designer.cs
文件 1083 2009-10-14 22:30 DeviceManagement\DeviceManagement\EMnue.cs
文件 6187 2009-10-14 22:19 DeviceManagement\DeviceManagement\Login.resx
文件 28048 2009-10-14 22:30 DeviceManagement\DeviceManagement\DMain.resx
文件 5987 2009-10-14 18:07 DeviceManagement\DeviceManagement\PasswordManage.resx
文件 4475 2009-10-14 18:18 DeviceManagement\DeviceManagement\AdminManage.cs
文件 14457 2009-10-13 23:45 DeviceManagement\DeviceManagement\AdminManage.Designer.cs
文件 5814 2009-10-13 23:45 DeviceManagement\DeviceManagement\AdminManage.resx
文件 11276 2009-10-14 22:30 DeviceManagement\DeviceManagement\EMnue.Designer.cs
文件 6216 2009-10-14 22:30 DeviceManagement\DeviceManagement\EMnue.resx
文件 1674 2009-10-18 14:23 DeviceManagement\DeviceManagement\Exit.cs
文件 5792 2009-10-18 14:23 DeviceManagement\DeviceManagement\Exit.Designer.cs
文件 5987 2009-10-18 14:23 DeviceManagement\DeviceManagement\Exit.resx
文件 4286 2009-10-14 18:17 DeviceManagement\DeviceManagement\AddDevice.cs
文件 17975 2009-10-14 15:00 DeviceManagement\DeviceManagement\AddDevice.Designer.cs
文件 5814 2009-10-14 15:00 DeviceManagement\DeviceManagement\AddDevice.resx
文件 12352 2009-10-14 22:20 DeviceManagement\DeviceManagement\RecentMange.cs
............此处省略167个文件信息
相关资源
- 全套源码-某电子购物商城系统C#实现
- 工资管理系统 C# 参考
- C#数字图像处理 关于遥感图像处理的
- C#留言板网站
- C#的电影院售票系统
- 《c#开发技术大全》明日科技随书代码
- C# 开发中常用的类大全,C#类
- C#winform高级设计工控与界面
- C#打印PDF的类库 PdfPrintingNet 无水印破
- C#利用DirectX技术玩转.x文件
- GDAL2.0.2 C# VS2013 X64 修改中文乱码
- C#实现视频监控
- 固高运动版卡例程C#版
- c#myQQ完整项目
- C#图像处理编程+源程序
- WEB课设-图书馆管理系统
- 深度学习手写识别C#源码
- C#深度学习源码
- C#+SQL 医院管理系统HIS完整工程源码及
- C#入门-基于C#的Windows窗口应用程序教
- C_本质论(中文版)
- C#ASP_NET仿新浪微博客V2
- TeeChart在C和C#下的应用
- C#写的UDP即时聊天程序
- 基于RFID的图书管理系统
- c#仿QQ源代码附带数据库,QQ界面设计
- C# winform皮肤主题切换源码
- C# 大华网络摄像头的demo winfrom
- C#银行管理系统含数据库
- .net经典ERP管理系统完整源码(多层架
评论
共有 条评论