DAL/Employee.cs

(开头部分) 14KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace DAL
{
    public class Employee
    {
        /// <summary>
        /// 精准查询
        /// </summary>
        /// <param name="id"></param>
        /// <param name="strsql"></param>
        /// <returns></returns>
        public DataTable ExactSelectEmployee(string id, string strsql)
        {
            string sql = " SELECT Rowid,Idno,name,Sex,Uid,Mobile,GraduationDate,HAddress FROM y_Employee";
            if (id == "1")
            {
                sql += " where Idno='" + strsql + "'";
            }
            if (id == "2")
            {
                sql += " where name='" + strsql + "'";
            }
            if (id == "3")
            {
                sql += " where  uid='" + strsql + "'";
            }
            if (id == "4")
            {
                sql += " where Mobile='" + strsql + "'";
            }
            return DBhelp.Gettable(sql, null);
        }
        /// <summary>
        /// 模糊查询
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="source"></param>
        /// <param name="edu"></param>
        /// <returns></returns>
        public DataTable VagueSelectEmployee(string sex, string source, string edu)
        {
            string sql = @"SELECT e.Rowid,Idno,name,Sex,Uid,Mobile,GraduationDate,HAddress FROM y_Employee e INNER JOIN y_parameterSrc p ON e.source=p.Parametercode AND p.Parametertype='HSource'INNER JOIN y_parameterSrc p2 on e.EducationBG=p2.Parametercode AND p2.Parametertype='HEducationBG'  ";
            if (sex != "请选择")
            {
                sql += "and e.sex='" + sex + "'";
            }
            if (source != "请选择")
            {
                sql += "and p.Parametercontent='" + source + "'";
            }
            if (edu != "请选择")
            {
                sql += "and p2.Parametercontent='" + edu + "'";
            }
            return DBhelp.Gettable(sql, null);
后面还有 222 行代码,购买后查看完整代码

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

AI 解读 AI

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

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