WELOA.DAL/Wage/gz_projectDAO.cs

(开头部分) 11KB

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

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

namespace GZDAL_SQL
{
    public class gz_projectDAO
    {
        
        private DateSetInformation dsinfo = new DateSetInformation();
        private ls_exception exlog = new ls_exception();
        private ls_publicclass publicclassDAO = new ls_publicclass();
        private Polytechnic trinfo = new Polytechnic();

        
        public Polytechnic AddProjectA(int nId, string strProject, string strTableName)
        {
            this.trinfo.nException = -1;
            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["lsstring"].ConnectionString))
            {
                SqlCommand command = connection.CreateCommand();
                command.CommandText = "INSERT INTO gz_project_a (id,project,tablename)VALUES (@nId,@strProject,@strTableName)";
                command.Parameters.AddWithValue("@nId", nId);
                command.Parameters.AddWithValue("@strProject", strProject);
                command.Parameters.AddWithValue("@strTableName", strTableName);
                try
                {
                    if (connection.State == ConnectionState.Closed)
                    {
                        connection.Open();
                    }
                    this.trinfo.rowsnum = command.ExecuteNonQuery();
                }
                catch (Exception exception)
                {
                    this.exlog.insexception("gz_projectDAO.cs AddProjectA", exception.Message);
                    this.trinfo.nException = 1;
                    return this.trinfo;
                }
            }
            return this.trinfo;
        }

        public Polytechnic AddTable(string strTableName)
        {
            this.trinfo.nException = -1;
            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["lsstring"].ConnectionString))
            {
                SqlCommand command = connection.CreateCommand();
                command.CommandText = "CREATE TABLE " + strTableName + " ([序号] [int] IDENTITY (1,1) not null , [证件号] [varchar] (52) not null,[姓名] [varchar] (22) not null,[部门] [varchar] (30) not null,[日期] [int] not null, [摘要] [varchar] (102) default 'no' not null ) ";
                string str = "ix_" + strTableName;
                SqlCommand command2 = connection.CreateCommand();
                command2.CommandText = "CREATE CLUSTERED INDEX " + str + " ON " + strTableName + " ([证件号]) ";
                try
后面还有 215 行代码,解锁后查看完整代码

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

AI 解读

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

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