Smokewinetea.DAL/ConnectionDAL.cs

(开头部分) 6KB

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

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

namespace Smokewinetea.DAL
{
   public class ConnectionDAL
    {
       /// <summary>
       /// 加载
       /// </summary>
       /// <returns></returns>
       public static List<ConnectionModel> ConnectionModel()
       {
           StringBuilder strSql = new StringBuilder();
           strSql.Append("select Number,CustomName,CustomId,CustomSex,Corporation,CustomPhone,Frequency from Custom");
           SqlDataReader dr = DbHelper.ExecuteReader(strSql.ToString());
           List<ConnectionModel> Staff = new List<ConnectionModel>();
           ConnectionModel sta;
           while (dr.Read())
           {
               sta = new ConnectionModel();
               sta.Number = Convert.ToInt32(dr[0]);
               sta.CustomName = dr[1].ToString();
               sta.CustomId =Convert.ToString(dr[2]);
               sta.CustomSex = dr[3].ToString();
               sta.Corporation = dr[4].ToString();
               sta.CustomPhone = Convert.ToString(dr[5]);
               sta.Frequency =Convert.ToInt32(dr[6]);
               Staff.Add(sta);

           }
           dr.Close();
           DbHelper.ConClose();
           return Staff;
       }

       /// <summary>
       /// 添加
       /// </summary>
       /// <param name="staff"></param>
       /// <returns></returns>
       public static int ConnectInser(ConnectionModel staff)
       {

           StringBuilder sql = new StringBuilder();
           sql.Append("insert into Custom  values(@CustomName,@CustomId,@CustomSex,@Corporation,@CustomPhone,@Frequency)");
           SqlParameter[] sta = {
                                    
                                    new SqlParameter("CustomName",SqlDbType.VarChar,20),
                                    new SqlParameter("CustomId",SqlDbType.VarChar,20),
                                    new SqlParameter("CustomSex",SqlDbType.VarChar,20),
                                    new SqlParameter("Corporation",SqlDbType.VarChar,20),
                                    new SqlParameter("CustomPhone",SqlDbType.VarChar,20),
                                    new SqlParameter("Frequency",SqlDbType.VarChar,50)
                                };
后面还有 110 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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