WELOA.DAL/Attendance/kq_attendancedetailsDAO.cs

(开头部分) 11KB

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

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

namespace KQDAL_SQL
{
    public class kq_attendancedetailsDAO
    {
        
        private ls_departmentDAO departmentDAO = new ls_departmentDAO();
        private DateSetInformation dsinfo = new DateSetInformation();
        private ls_exception exlog = new ls_exception();
        private Polytechnic trinfo = new Polytechnic();

        
        public Polytechnic delData(int nIdStar, int nIdEnd, string strStaff, string strDepartment, DateTime dtDateStar, DateTime dtDateEnd)
        {
            this.trinfo.nException = -1;
            this.trinfo.rowsnum = -1;
            string str = "";
            if (strDepartment == "所有")
            {
                str = string.Concat(new object[] { "((([staffid]='", strStaff, "') OR ([staffname] LIKE '%", strStaff, "%')) AND [attendancedetails]>='", dtDateStar, "' AND [attendancedetails]<='", dtDateEnd, "')" });
            }
            else
            {
                str = string.Concat(new object[] { "((([staffid]='", strStaff, "') OR ([staffname] LIKE '%", strStaff, "%'))AND [department]='", strDepartment, "'AND [attendancedetails]>='", dtDateStar, "' AND [attendancedetails]<='", dtDateEnd, "')" });
            }
            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["lsstring"].ConnectionString))
            {
                SqlCommand command = connection.CreateCommand();
                command.CommandType = CommandType.Text;
                command.CommandText = "DELETE kq_attendancedetails where [id]>=@nIdStar AND [id]<=@nIdEnd AND " + str;
                command.Parameters.AddWithValue("@nIdStar", nIdStar);
                command.Parameters.AddWithValue("@nIdEnd", nIdEnd);
                try
                {
                    if (connection.State == ConnectionState.Closed)
                    {
                        connection.Open();
                    }
                    this.trinfo.rowsnum = command.ExecuteNonQuery();
                }
                catch (Exception exception)
                {
                    this.exlog.insexception("kq_attendancedetailsDAO.cs delData", exception.Message);
                    this.trinfo.nException = 1;
                    return this.trinfo;
                }
            }
            return this.trinfo;
        }

        public DateSetInformation insAttendancedetails(DataSet ds)
后面还有 172 行代码,解锁后查看完整代码

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

AI 解读

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

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