• 大小: 2.9MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-14
  • 语言: C#
  • 标签: C#  管理员  教师  学生  

资源简介

用VS2012开发的基于winform的学生管理系统,其中分为管理员、教师、学生等不同的权限,并给窗体添加了皮肤,使其更加美观。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace Manage.Class
{
    public class Class
    {
        SqlConnection sqlCon;
        public Class(string strConectionString)
        {
            sqlCon = new SqlConnection(strConectionString);
        }
       
        public int AddClass(Model.Class.Class objClass out string strErr)//增加班级信息
        {
            int iRent = 0;
            strErr = ““;
            SqlCommand sqlCom = new SqlCommand();

            string strSql = “insert into Class(classnoclassnameremarktype)“;
            strSql += “values(‘“ + objClass.ClassNo + “‘‘“ + objClass.ClassName +“‘‘“ + objClass.Remark + “‘1)“;

            sqlCom.CommandText = strSql;
            sqlCom.Connection = sqlCon;
            try
            {
                sqlCon.Open();
                sqlCom.ExecuteNonQuery();
                iRent = 1;
            }
            catch (Exception exErr)
            {
                strErr = exErr.ToString();
                iRent = 0;
            }
            finally
            {
                sqlCon.Close();
                sqlCom.Dispose();
            }
            return iRent;
        }

        public int DelClass(string classNostring className out string strErr)//删除班级信息,同时会删除class_course表和class_teacher表相关联的信息。
        {
            int iRent = 0;
            strErr = ““;
            SqlCommand sqlCom = new SqlCommand();
            string strSql = “ update class set type = 0 where classno = ‘“ + classNo + “‘ “;
            strSql += “update Class_course set type = 0 where classid in (select classid from class where classNo =‘“+ classNo +“‘) “;
            strSql += “update Class_teacher set type = 0 where classid in (select classid from class where classNo =‘“+ classNo +“‘) “;
            sqlCom.CommandText = strSql;
            sqlCom.Connection = sqlCon;
            try
            {
                sqlCon.Open();
                sqlCom.ExecuteNonQuery();
                iRent = 1;
            }
            catch (Exception exErr)
            {
                strErr = exErr.ToString();
                iRent = 0;
            }
            finally
            {
                sqlCon.Close();
                sqlCom.Dispose();
            }
            return iRent;
        }
        public int JudgeExistStu(string classNo)//判断该班级里是否还有学生,有学生时不允许删除班级
        {
            string strErr = ““;
            DataSet ds = new DataSet();
            string strConnection = System.Configuration.ConfigurationManager.ConnectionStrings[“StudentManager“].ConnectionString;
             string strSql = “ select stuId from student where classid in ( select classid from class where  classno = ‘“ + classNo + “‘)and type =1 “;
            SqlConnection sqlCon = new SqlConnection();
            sqlCon.ConnectionString = strConnection;
            sqlC

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      86016  2008-09-24 09:42  StudentManage\Manage\bin\Debug\Manage.dll

     文件     103936  2008-09-24 09:42  StudentManage\Manage\bin\Debug\Manage.pdb

     文件      24576  2008-08-20 16:16  StudentManage\Manage\bin\Debug\Model.dll

     文件      75264  2008-08-20 16:16  StudentManage\Manage\bin\Debug\Model.pdb

     文件      13505  2008-08-21 17:05  StudentManage\Manage\Class\Class.cs

    ..A.SHR       107  2008-08-21 17:05  StudentManage\Manage\Class\vssver2.scc

     文件      12442  2008-08-21 11:22  StudentManage\Manage\Course\Course.cs

    ..A.SHR       109  2008-08-21 11:23  StudentManage\Manage\Course\vssver2.scc

     文件      13208  2008-08-21 11:24  StudentManage\Manage\Login\Login.cs

    ..A.SHR       107  2008-08-21 11:24  StudentManage\Manage\Login\vssver2.scc

     文件       2646  2004-09-02 14:35  StudentManage\Manage\Manage.csproj

     文件        784  2008-09-24 09:40  StudentManage\Manage\obj\Debug\CSC27.tmp

     文件      86016  2008-09-24 09:42  StudentManage\Manage\obj\Debug\Manage.dll

     文件     103936  2008-09-24 09:42  StudentManage\Manage\obj\Debug\Manage.pdb

     文件      20480  2008-08-21 09:04  StudentManage\Manage\obj\Debug\Refactor\Manage.dll

     文件       3693  2008-08-20 16:16  StudentManage\Manage\obj\Debug\ResolveAssemblyReference.cache

     文件        172  2008-09-28 10:06  StudentManage\Manage\obj\Manage.csproj.FileList.txt

     文件       1226  2004-09-02 14:35  StudentManage\Manage\obj\Manage.csproj.FileListAbsolute.txt

     文件       1315  2008-08-12 19:45  StudentManage\Manage\Properties\AssemblyInfo.cs

    ..A.SHR       119  2008-08-13 13:28  StudentManage\Manage\Properties\vssver2.scc

     文件      26402  2008-08-20 16:16  StudentManage\Manage\Score\Score.cs

    ..A.SHR       107  2008-08-20 16:16  StudentManage\Manage\Score\vssver2.scc

     文件      15339  2008-08-21 11:23  StudentManage\Manage\Student\Student.cs

    ..A.SHR       111  2008-08-21 11:23  StudentManage\Manage\Student\vssver2.scc

     文件      12645  2008-08-21 10:10  StudentManage\Manage\Teacher\Teacher.cs

    ..A.SHR       111  2008-08-21 10:10  StudentManage\Manage\Teacher\vssver2.scc

     文件      21800  2008-09-24 09:40  StudentManage\Manage\Teacher_Course_Class\T_C_C.cs

    ..A.SHR       122  2008-08-20 16:42  StudentManage\Manage\Teacher_Course_Class\vssver2.scc

     文件      24576  2008-08-20 16:16  StudentManage\Model\bin\Debug\Model.dll

     文件      75264  2008-08-20 16:16  StudentManage\Model\bin\Debug\Model.pdb

............此处省略235个文件信息

评论

共有 条评论