• 大小: 1.44MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-31
  • 语言: C#
  • 标签: winform  管理系统  

资源简介

这是一个对学生宿舍进行管理的系统,运用c#语言编写,是一个窗体程序,里面附加有数据库

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 学生宿舍管理系统1
{
    public partial class addStudent : Form
    {
        private string num;
        public addStudent()
        {
            InitializeComponent();
        }
        public addStudent(string n)
        {
            InitializeComponent();
            num = n;
            txtRoomNum.Text = num;
        }

        public void GetData(string selectCommand)
        {
            try
            {
                String connectionString =
                    “Integrated Security=SSPI;Persist Security Info=False;“ +
                    “Initial Catalog=stuQuartersManage;Data Source=HASEE-PC\\SQLEXPRESS“;
                SqlDataAdapter dataAdapter = new SqlDataAdapter(selectCommand connectionString);

                SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter);
                DataTable table = new DataTable();
                table.Locale = System.Globalization.CultureInfo.InvariantCulture;
                dataAdapter.Fill(table);
                bindingSource1.DataSource = table;
                dataGridView1.AutoResizeColumns(
                    DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader);
            }
            catch (SqlException)
            {
                MessageBox.Show(“添加学生信息失败!“ “错误提示“);
            }
        }

        public int getConut()
        {
            SqlConnection con = new SqlConnection(@“Data Source=HASEE-PC\SQLEXPRESS;Initial Catalog=stuQuartersManage;Integrated Security=True“);
            con.Open();
            string str = “select * from Student where stuNum=‘“ + txtStuNum.Text + “‘“;           
            SqlCommand com = new SqlCommand(str con);            
            int intcont = Convert.ToInt32(com.ExecuteScalar());
            con.Close();
            com.Clone();
            return intcont;       
        }

        public string room()
        {
            SqlConnection con = new SqlConnection(@“Data Source=HASEE-PC\SQLEXPRESS;Initial Catalog=stuQuartersManage;Integrated Security=True“);
            con.Open();
            string str1 = “select roomNum from Room where roomNum = ‘“ + txtRoomNum.Text + “‘“;
            SqlCommand com1 = new SqlCommand(str1 con);
            string room = Convert.ToString(com1.ExecuteScalar());
            con.Close();
            com1.Clone();
            return room;
        }

        public int count()
        {
            SqlConnection con = new SqlConnection(@“Data Source=HASEE-PC\SQLEXPRESS;Initial Catalog=stuQuartersManage;Integrated Security=True“);
            con.Open();
            string str1 = “select count(roomNum) from Student where roomNum=‘“ + txtRoomNum.Text + “‘“;
            SqlCommand com1 = new SqlComm

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-06-09 09:26  学生宿舍管理系统1\
     目录           0  2011-06-09 09:26  学生宿舍管理系统1\学生宿舍管理系统1\
     目录           0  2011-06-09 09:26  学生宿舍管理系统1\学生宿舍管理系统1\Properties\
     文件        1442  2011-06-09 09:26  学生宿舍管理系统1\学生宿舍管理系统1\Properties\AssemblyInfo.cs
     文件        1769  2011-06-10 12:32  学生宿舍管理系统1\学生宿舍管理系统1\Properties\Settings.Designer.cs
     文件        5957  2011-06-09 10:49  学生宿舍管理系统1\学生宿舍管理系统1\Properties\Resources.resx
     文件        2874  2011-06-09 10:49  学生宿舍管理系统1\学生宿舍管理系统1\Properties\Resources.Designer.cs
     文件        1051  2011-06-10 12:32  学生宿舍管理系统1\学生宿舍管理系统1\Properties\Settings.settings
     文件        2411  2011-06-11 15:48  学生宿舍管理系统1\学生宿舍管理系统1\Login.cs
     文件        8541  2011-06-12 00:57  学生宿舍管理系统1\学生宿舍管理系统1\addStudent.cs
     文件        9742  2011-06-09 16:18  学生宿舍管理系统1\学生宿舍管理系统1\stuLook.Designer.cs
     文件        8964  2011-06-12 12:17  学生宿舍管理系统1\学生宿舍管理系统1\学生宿舍管理系统1.csproj
     目录           0  2011-06-09 09:26  学生宿舍管理系统1\学生宿舍管理系统1\bin\
     目录           0  2011-06-09 09:26  学生宿舍管理系统1\学生宿舍管理系统1\bin\Debug\
     文件       14328  2011-06-20 13:48  学生宿舍管理系统1\学生宿舍管理系统1\bin\Debug\学生宿舍管理系统1.vshost.exe
     文件      156672  2011-06-20 13:48  学生宿舍管理系统1\学生宿舍管理系统1\bin\Debug\学生宿舍管理系统1.exe
     文件       95744  2011-06-20 13:48  学生宿舍管理系统1\学生宿舍管理系统1\bin\Debug\学生宿舍管理系统1.pdb
     文件         450  2011-06-10 12:32  学生宿舍管理系统1\学生宿舍管理系统1\bin\Debug\学生宿舍管理系统1.exe.config
     文件         450  2011-06-10 12:32  学生宿舍管理系统1\学生宿舍管理系统1\bin\Debug\学生宿舍管理系统1.vshost.exe.config
     目录           0  2011-06-12 12:17  学生宿舍管理系统1\学生宿舍管理系统1\bin\Debug\database\
     文件     2293760  2011-06-12 12:16  学生宿舍管理系统1\学生宿舍管理系统1\bin\Debug\database\stuQuartersManage.mdf
     文件      573440  2011-06-12 12:16  学生宿舍管理系统1\学生宿舍管理系统1\bin\Debug\database\stuQuartersManage_log.LDF
     文件         490  2009-06-11 05:14  学生宿舍管理系统1\学生宿舍管理系统1\bin\Debug\学生宿舍管理系统1.vshost.exe.manifest
     目录           0  2011-06-12 12:18  学生宿舍管理系统1\学生宿舍管理系统1\bin\Release\
     文件         450  2011-06-10 12:32  学生宿舍管理系统1\学生宿舍管理系统1\bin\Release\学生宿舍管理系统1.exe.config
     文件         450  2011-06-10 12:32  学生宿舍管理系统1\学生宿舍管理系统1\bin\Release\学生宿舍管理系统1.vshost.exe.config
     文件         490  2009-06-11 05:14  学生宿舍管理系统1\学生宿舍管理系统1\bin\Release\学生宿舍管理系统1.vshost.exe.manifest
     文件       14328  2011-06-20 13:48  学生宿舍管理系统1\学生宿舍管理系统1\bin\Release\学生宿舍管理系统1.vshost.exe
     目录           0  2011-06-12 12:20  学生宿舍管理系统1\学生宿舍管理系统1\bin\Release\database\
     文件     2293760  2011-06-12 12:16  学生宿舍管理系统1\学生宿舍管理系统1\bin\Release\database\stuQuartersManage.mdf
     文件      573440  2011-06-12 12:16  学生宿舍管理系统1\学生宿舍管理系统1\bin\Release\database\stuQuartersManage_log.LDF
............此处省略73个文件信息

评论

共有 条评论