• 大小: 3.61MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-15
  • 语言: C#
  • 标签: C#  考勤  请假  sql  server  

资源简介

基于sql server的学校考勤系统,具有签到,请假,审批请假与基本信息管理的功能

资源截图

代码片段和文件信息

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

namespace WindowsForms1
{
    public partial class Form1 : Form
    {
        int my_choice = -1;//记录单选按钮状态初始状态为-1表示尚未选择
        public static string myUserName = “MYNULL“;
        public static string my_id = ““;
        public static string my_class = ““;
        public static int ts = -1;

        public Form1()
        {
            InitializeComponent();
            this.skinEngine1.SkinFile = “DiamondBlue.ssk“;
        }

        private void radioButton1_CheckedChanged(object sender EventArgs e)
        {
            my_choice = 1; //教师为1
            ts = 1;
        }

        private void radioButton2_CheckedChanged(object sender EventArgs e)
        {
            my_choice = 0; //学生为0
            ts = 0;
        }

        private void button1_Click(object sender EventArgs e)
        {
             int column = 0;//记录不同登录人员信息表密码所在列号
            if (my_choice == -1)
            {
                MessageBox.Show(“您尚未选择身份!“);
                return;
            }
            
            if (textBox1.Text == ““ || textBox2.Text == ““)
            {
                MessageBox.Show(“您尚未添加用户名或密码信息!“);
                return;
            }
            SqlConnection conn = new SqlConnection(@“Server=SDWM--20170826E;Integrated Security=True;“ + “Database=teacher-student“);
            try
            {
                conn.Open();
                string[] cmd = new string[2];//C#中字符串数组必须要用委托
                cmd[0] = “Select * from 学生“;//查询学生语句下同
                cmd[1] = “Select * from 教师“;//教师
              
                SqlDataAdapter adapter = new SqlDataAdapter(cmd[my_choice] conn);
                DataTable myTable = new DataTable();
                adapter.Fill(myTable);//查询登录人员表中的数据,与填入界面的信息对比
                if (my_choice == 0) //记录学生密码所在列
                    column = 6;
                else if (my_choice == 1)//记录教师密码所在列
                    column = 4;

                if (column == 0)
                {
                    MessageBox.Show(“出现未知错误………………“);
                    return;
                }
                for (int i = 0; i < myTable.Rows.Count; i++)
                {
                    if (myTable.Rows[i][0].ToString().Trim() == this.textBox1.Text.ToString().Trim() && myTable.Rows[i][column].ToString().Trim() == this.textBox2.Text.ToString().Trim())
                    {
                        myUserName = myTable.Rows[i][1].ToString().Trim();//记录登录用户名
                        my_id = myTable.Rows[i][0].ToString().Trim();//记录用户的登录名
                        my_class = myTable.Rows[i][3].ToString().Trim(); ;
                        if (my_choice == 0)
                        {
                       

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

     文件     557056  2010-09-12 13:09  WindowsForms1\irisskin4.dll\IrisSkin4.dll\IrisSkin4.dll

     文件      20139  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\Calmness.ssk

     文件      20271  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\CalmnessColor1.ssk

     文件      20208  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\CalmnessColor2.ssk

     文件       5032  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\DeepCyan.ssk

     文件       5037  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\DeepGreen.ssk

     文件       4908  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\DeepOrange.ssk

     文件      16021  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\DiamondBlue.ssk

     文件      16669  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\DiamondGreen.ssk

     文件      16211  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\DiamondOlive.ssk

     文件      16031  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\DiamondPurple.ssk

     文件      15998  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\DiamondRed.ssk

     文件      10439  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\Eighteen.ssk

     文件      10382  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\EighteenColor1.ssk

     文件       9746  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\EighteenColor2.ssk

     文件      12591  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\Emerald.ssk

     文件      12261  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\EmeraldColor1.ssk

     文件      12360  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\EmeraldColor2.ssk

     文件      11422  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\EmeraldColor3.ssk

     文件      18859  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\GlassBrown.ssk

     文件      16097  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\GlassGreen.ssk

     文件      17010  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\GlassOrange.ssk

     文件      18988  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\Longhorn.ssk

     文件      15156  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\MacOS.ssk

     文件      12477  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\Midsummer.ssk

     文件      12542  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\MidsummerColor1.ssk

     文件      12238  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\MidsummerColor2.ssk

     文件      12127  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\MidsummerColor3.ssk

     文件      15899  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\mp10.ssk

     文件      15664  2010-04-04 21:03  WindowsForms1\irisskin4.dll\IrisSkin4.dll\Skins\mp10green.ssk

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

评论

共有 条评论