DAL/AdminUser.cs

(开头部分) 8KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Models;
using System.Data.SqlClient;

namespace DAL
{
    public class AdminUser
    {
        //查询当前管理员或者用户或药品的最大编号
        public string Max_ID(string Table,string PK) 
        {
            string Strsql = "select("+"select top 1 "+ PK + " from " + Table +" order by "+ PK +" desc) +1";
            StringBuilder sql = new StringBuilder();
            sql.Append(Strsql); 
            return DBHelperSQL.ExecuteSqlCell(sql.ToString());
        
        }

        /*绑定数据降序*/
        public DataSet AllBind(int a, int b, string c, string table)
        {
            int size = Convert.ToInt32(table.Length) - 3;
            String sql = "select * from " + table + " order by " + table.Substring(3,size) + "id desc";
            return SQLHelper.PagedataSet(sql, a, b, c);

        }


        /*绑定数据升序*/
        public DataSet AllBindAsc(int a, int b, string c, string table)
        {
            int size = Convert.ToInt32(table.Length) - 3;
            String sql = "select * from " + table + " order by " + table.Substring(3, size) + "id asc";
            return SQLHelper.PagedataSet(sql, a, b, c);

        }

        //查询表中共有多少条数据
        public int resultCount(string table)
        {

            string sqlstr = "select count(*) from " +table;
            int result;
            if (DBHelperSQL.ExecuteSqlCell(sqlstr) == null)
            {
                result = 0;

            }
            else
            {
                result =Convert.ToInt32(DBHelperSQL.ExecuteSqlCell(sqlstr));
            }
            return result;
        }


后面还有 147 行代码,购买后查看完整代码

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

AI 解读 AI

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

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