QiFeng.ZWY.Dal/McAccounts.cs

(开头部分) 16KB

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

using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using QiFeng.LMSD.DBUtility;
using QiFeng.LMSD.Model;
using QiFeng.LMSD.Model.Dto;
using QiFeng.LMSD.Utility;

namespace QiFeng.LMSD.Dal
{
    public partial class McAccountsDal : BaseDal<McAccountsDal>
    {
        #region 默认方法
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(McAccounts model)
        {
            var strSql = new StringBuilder();
            strSql.Append("insert into McAccounts(");
            strSql.Append("UserName,PasswordHash,RealName,Avatar,Gender,Age,BirthDate,Mobile,RoleId,DepartmentId,AccessFailedCount,IsLock,IsFrozen,IsMagAccount,UpdateAccountId,UpdateDate,JurisdictionAccountId,JurisdictionDate,AddDate,IsDelete");
            strSql.Append(") values (");
            strSql.Append("@UserName,@PasswordHash,@RealName,@Avatar,@Gender,@Age,@BirthDate,@Mobile,@RoleId,@DepartmentId,@AccessFailedCount,@IsLock,@IsFrozen,@IsMagAccount,@UpdateAccountId,@UpdateDate,@JurisdictionAccountId,@JurisdictionDate,@AddDate,@IsDelete");
            strSql.Append(") ");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                        new SqlParameter("@UserName", SqlDbType.NVarChar,50) ,
                        new SqlParameter("@PasswordHash", SqlDbType.NVarChar,50) ,
                        new SqlParameter("@RealName", SqlDbType.NVarChar,50) ,
                        new SqlParameter("@Avatar", SqlDbType.NVarChar,200) ,
                        new SqlParameter("@Gender", SqlDbType.Int,4) ,
                        new SqlParameter("@Age", SqlDbType.Int,4) ,
                        new SqlParameter("@BirthDate", SqlDbType.DateTime) ,
                        new SqlParameter("@Mobile", SqlDbType.NVarChar,50) ,
                        new SqlParameter("@RoleId", SqlDbType.Int,4) ,
                        new SqlParameter("@DepartmentId", SqlDbType.Int,4) ,
                        new SqlParameter("@AccessFailedCount", SqlDbType.Int,4) ,
                        new SqlParameter("@IsLock", SqlDbType.Bit,1) ,
                        new SqlParameter("@IsFrozen", SqlDbType.Bit,1) ,
                        new SqlParameter("@IsMagAccount", SqlDbType.Bit,1) ,
                        new SqlParameter("@UpdateAccountId", SqlDbType.Int,4) ,
                        new SqlParameter("@UpdateDate", SqlDbType.DateTime) ,
                        new SqlParameter("@JurisdictionAccountId", SqlDbType.Int,4) ,
                        new SqlParameter("@JurisdictionDate", SqlDbType.DateTime) ,
                        new SqlParameter("@AddDate", SqlDbType.DateTime) ,
                        new SqlParameter("@IsDelete", SqlDbType.Bit,1)

            };

            parameters[0].Value = model.UserName;
            parameters[1].Value = EncryptionLibCbc.Encrypt(model.PasswordHash, Encoding.UTF8);  //将密码加密
            parameters[2].Value = model.RealName;
            parameters[3].Value = model.Avatar;
            parameters[4].Value = model.Gender;
            parameters[5].Value = model.Age;
            parameters[6].Value = model.BirthDate;
            parameters[7].Value = model.Mobile;
            parameters[8].Value = model.RoleId;
后面还有 263 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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