提交代码
This commit is contained in:
@@ -665,5 +665,31 @@ namespace BLL
|
||||
if (now.Month < birthDate.Month || (now.Month == birthDate.Month && now.Day < birthDate.Day)) age--;
|
||||
return age;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///根据userid获取当前人的单位类型(0总公司,1分公司,2其他)
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetUnitTypeByUserId(string userId)
|
||||
{
|
||||
int result = 0;
|
||||
var user = Person_PersonsService.GetPerson_PersonsById(userId);
|
||||
|
||||
|
||||
if ((userId == Const.hfnbdId || userId == Const.sysglyId) || (!string.IsNullOrEmpty(user.UnitId) && user.UnitId == BLL.Const.UnitId_SEDIN))//公司级别
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(user.UnitId) && UnitService.GetUnitByUnitId(user.UnitId).IsBranch == true && user.IsOffice == true) //子公司级数据
|
||||
{
|
||||
result = 1;
|
||||
}
|
||||
else //外来账户
|
||||
{
|
||||
result = 2;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user