Kaynağa Gözat

教师注册编号生成

大厂分支
zhichao lei 4 yıl önce
ebeveyn
işleme
7950b54549
2 değiştirilmiş dosya ile 25 ekleme ve 0 silme
  1. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config
  2. +22
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs

+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config Dosyayı Görüntüle

@@ -138,4 +138,7 @@
<add key="verifypwd" value="false"/>
<!--疫情防控组角色Id-->
<add key="EpidemicControlTeamRoleId" value="87f38e4e-b0a6-472c-b01a-2620b8f1ec46" />
<!--注册教师生成编号 金隅:jy;西昌:xc;大厂:dc-->
<add key="EmpNoRule" value="jy"/>

</appSettings>

+ 22
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs Dosyayı Görüntüle

@@ -3,6 +3,7 @@ using Learun.DataBase.Repository;
using Learun.Util;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;
@@ -21,6 +22,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
public class EmpInfoService : RepositoryFactory
{
private object Select;

#region 获取数据

/// <summary>
@@ -562,6 +565,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
//生成编号
var ruleName = ConfigurationManager.AppSettings["EmpNoRule"];
if (ruleName == "jy")
{
var strHead = DateTime.Now.ToString("yyyyMM");
var SerialNum = 1;
var empInfoEntities = this.BaseRepository("CollegeMIS").FindList<EmpInfoEntity>(a => a.EmpNo.Contains(strHead));
if (empInfoEntities.Count() > 0)
{
var aa = empInfoEntities.Where(a => a.EmpNo.Length >= 8);
var bb = aa.Select(a => a.EmpNo.Substring(a.EmpNo.Length - 2, 2));
var cc = bb.Select(a => int.Parse(a));
SerialNum = cc.Max() + 1;
}
entity.EmpNo = strHead + SerialNum.ToString().PadLeft(2, '0');


}

UserIBLL userIBLL = new UserBLL();
if (!string.IsNullOrEmpty(keyValue))
{


Yükleniyor…
İptal
Kaydet