DAL/CompanyDAL.cs

(开头部分) 3KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using Entitry;
using Common;
namespace DAL
{
    public class CompanyDAL
    {
        public  List<company> GetCompany()
        {
            string sql = "select * from company where state=1";
            SqlDataReader sqlReader = DBHelp.SelectData(sql);

            List<company> Company = new List<company>();
            while (sqlReader.Read())
            {
                company f = new company();
                f.companyID = (int)sqlReader["companyID"];
                f.CText = (string)sqlReader["CText"];
                f.CName = (string)sqlReader["CName"];
                f.Lable = (string)sqlReader["Lable"];
                f.ProductPic = (string)sqlReader["ProductPic"];
                f.ProductName = (string)sqlReader["ProductName"];
                f.ProductUrl = (string)sqlReader["ProductUrl"];
                f.ProductTxt = (string)sqlReader["ProductTxt"];
                f.Address = (string)sqlReader["Address"];
                f.Count = (string)sqlReader["Count"];
                f.IndexUrl = (string)sqlReader["IndexUrl"];
                f.ThisFinacncing = (string)sqlReader["ThisFinacncing"];
                f.Finacning = (string)sqlReader["Finacning"];
                f.FinacningName = (string)sqlReader["FinacningName"];
                f.CreateName = (string)sqlReader["CreateName"];
                f.CreateTxt = (string)sqlReader["CreateTxt"];
                f.Report = (string)sqlReader["Report"];
                f.ReportUrl = (string)sqlReader["ReportUrl"];
                f.state=(int)sqlReader["state"];
                Company.Add(f);
            }
            sqlReader.Close();
            return Company;
        }
        public static List<company> SearchComp(string cmpName)
        {
            string sql = "select * from company where state=1 and CText='" + cmpName + "'";
            SqlDataReader sqlReader = DBHelp.SelectData(sql);

            List<company> Company = new List<company>();
            while (sqlReader.Read())
            {
                company f = new company();
                f.companyID = (int)sqlReader["companyID"];
                f.CText = (string)sqlReader["CText"];
                f.CName = (string)sqlReader["CName"];
                f.Lable = (string)sqlReader["Lable"];
                f.ProductPic = (string)sqlReader["ProductPic"];
                f.ProductName = (string)sqlReader["ProductName"];
后面还有 16 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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