资源简介

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个文件信息

评论

共有 条评论