WELOA.DAL/WEL/ls_managersDAO.cs

(开头部分) 17KB

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

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

namespace LSDAL_SQL
{
 public class ls_managersDAO
{
    
    private SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["lsstring"].ConnectionString);
    private DateSetInformation dsinfo = new DateSetInformation();
    private ls_exception exlog = new ls_exception();
    private ls_managerlogDAO managerlogDAO = new ls_managerlogDAO();
    private Polytechnic trinfo = new Polytechnic();

    
    public Polytechnic delmanager(int nid)
    {
        this.trinfo.nException = -1;
        this.trinfo.rowsnum = -1;
        SqlCommand command = this.conn.CreateCommand();
        command.CommandType = CommandType.Text;
        command.CommandText = "DELETE ls_managers WHERE id=@nid";
        command.Parameters.AddWithValue("@nid", nid);
        try
        {
            if (this.conn.State == ConnectionState.Closed)
            {
                this.conn.Open();
            }
            this.trinfo.rowsnum = command.ExecuteNonQuery();
            this.conn.Close();
        }
        catch (Exception exception)
        {
            this.exlog.insexception("ls_managersDAO.cs delmanager", exception.Message);
            this.trinfo.nException = 1;
            return this.trinfo;
        }
        return this.trinfo;
    }

    public Polytechnic insmanager(string strLoginName, string strPassword, string strManagerName, string strManagerId, string strRank, string strZhuangtai)
    {
        this.trinfo.nException = -1;
        this.trinfo.rowsnum = -1;
        SqlCommand command = this.conn.CreateCommand();
        command.CommandType = CommandType.Text;
        command.CommandText = "INSERT INTO  ls_managers VALUES(@strLoginName,@strPassword,@strManagerName,@strManagerId,@strRank,@strZhuangtai)";
        command.Parameters.AddWithValue("@strLoginName", strLoginName);
        command.Parameters.AddWithValue("@strPassword", strPassword);
        command.Parameters.AddWithValue("@strManagerName", strManagerName);
        command.Parameters.AddWithValue("@strManagerId", strManagerId);
        command.Parameters.AddWithValue("@strRank", strRank);
        command.Parameters.AddWithValue("@strZhuangtai", strZhuangtai);
后面还有 398 行代码,解锁后查看完整代码

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

AI 解读

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

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