培训
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -12,7 +10,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 根据主键获取信息
|
||||
/// </summary>
|
||||
/// <param name="groupId"></param>
|
||||
/// <param name="departId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Base_Depart GetDepartById(string departId)
|
||||
{
|
||||
@@ -22,7 +20,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="?"></param>
|
||||
/// <param name="depart"></param>
|
||||
public static void AddDepart(Model.Base_Depart depart)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
@@ -41,7 +39,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="teamGroup"></param>
|
||||
/// <param name="depart"></param>
|
||||
public static void UpdateDepart(Model.Base_Depart depart)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
@@ -82,7 +80,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 根据主键获取信息
|
||||
/// </summary>
|
||||
/// <param name="groupId"></param>
|
||||
/// <param name="departId"></param>
|
||||
/// <returns></returns>
|
||||
public static string getDepartNameById(string departId)
|
||||
{
|
||||
@@ -113,5 +111,64 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据多部门ID得到岗位名称字符串
|
||||
|
||||
/// <summary>
|
||||
/// 根据多部门ID得到岗位名称字符串
|
||||
/// </summary>
|
||||
/// <param name="departIdsIds"></param>
|
||||
/// <returns></returns>
|
||||
public static string getDepartNamesByIds(object departIdsIds)
|
||||
{
|
||||
string departName = string.Empty;
|
||||
if (departIdsIds != null)
|
||||
{
|
||||
string[] ids = departIdsIds.ToString().Split(',');
|
||||
foreach (string id in ids)
|
||||
{
|
||||
var q = GetDepartById(id);
|
||||
if (q != null)
|
||||
{
|
||||
departName += q.DepartName + ",";
|
||||
}
|
||||
}
|
||||
if (departName != string.Empty)
|
||||
{
|
||||
departName = departName.Substring(0, departName.Length - 1); ;
|
||||
}
|
||||
}
|
||||
|
||||
return departName;
|
||||
}
|
||||
public static string getDepartNamesByIdsForApi(object departIdsIds)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string departName = string.Empty;
|
||||
if (departIdsIds != null)
|
||||
{
|
||||
string[] ids = departIdsIds.ToString().Split(',');
|
||||
foreach (string id in ids)
|
||||
{
|
||||
var q = db.Base_Depart.FirstOrDefault(e => e.DepartId == id);
|
||||
if (q != null)
|
||||
{
|
||||
departName += q.DepartName + ",";
|
||||
}
|
||||
}
|
||||
if (departName != string.Empty)
|
||||
{
|
||||
departName = departName.Substring(0, departName.Length - 1); ;
|
||||
}
|
||||
}
|
||||
|
||||
return departName;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user