WELOA.DAL/Attendance/kq_install.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WELOA.Model;
using System.Data.SqlClient;
using LSDAL_SQL;
using System.Data;
using System.Configuration;

namespace KQDAL_SQL
{
    public class kq_install
    {
        
        private ls_exception exlog = new ls_exception();
        private Polytechnic trinfo = new Polytechnic();

        
        public Polytechnic createTable_AttendanceDetails()
        {
            this.trinfo.nException = -1;
            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["lsstring"].ConnectionString))
            {
                SqlCommand command = connection.CreateCommand();
                command.CommandText = "CREATE TABLE kq_attendancedetails ([id] [int] IDENTITY (1,1) not null , [staffid] [varchar] (50) not null,[staffname] [varchar] (50) not null,[department] [varchar] (50) not null,[attendancedetails] [datetime]  not null,[remarks] [varchar] (50) null ) ";
                SqlCommand command2 = connection.CreateCommand();
                command2.CommandText = "CREATE CLUSTERED INDEX ix_kq_attendancedetails ON kq_attendancedetails ([staffid]) ";
                try
                {
                    if (connection.State == ConnectionState.Closed)
                    {
                        connection.Open();
                    }
                    command.ExecuteNonQuery();
                    command2.ExecuteNonQuery();
                }
                catch (Exception exception)
                {
                    this.exlog.insexception("kq_install.cs createTable_AttendanceDetails", exception.Message);
                    this.trinfo.nException = 1;
                    return this.trinfo;
                }
            }
            return this.trinfo;
        }

        public Polytechnic createTable_postanddepartment()
        {
            this.trinfo.nException = -1;
            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["lsstring"].ConnectionString))
            {
                SqlCommand command = connection.CreateCommand();
                command.CommandText = "CREATE TABLE kq_postanddepartment([id] [int] IDENTITY (1,1) not null  primary key, [部门] [varchar] (50) not null ) ";
                try
                {
                    if (connection.State == ConnectionState.Closed)
                    {
                        connection.Open();
                    }
后面还有 44 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。