/// <summary> /// 得到一个人员的分管领导 /// </summary> /// <param name="userID"></param> /// <returns></returns> public string GetChargeLeader(Guid userID) { var mainStation = GetMainStation(userID); if (mainStation == null) { return(""); } RoadFlow.Platform.Organize borg = new Organize(); var station = borg.Get(mainStation); if (station == null) { return(""); } if (!station.ChargeLeader.IsNullOrEmpty()) { return(station.ChargeLeader); } var parents = borg.GetAllParent(station.Number); foreach (var parent in parents) { if (!parent.ChargeLeader.IsNullOrEmpty()) { return(parent.ChargeLeader); } } return(""); }
/// <summary> /// 得到一个人员的分管领导。 /// </summary> /// <param name="userId"></param> /// <returns></returns> public string GetChargeLeader(Guid userId) { Guid organizeId = this.GetMainStation(userId); if (organizeId == null) { return(string.Empty); } Organize organizeBll = new Organize(); Data.Model.Organize organize = organizeBll.Get(organizeId); if (organize == null) { return(string.Empty); } if (!string.IsNullOrEmpty(organize.ChargeLeader)) { return(organize.ChargeLeader); } var parents = organizeBll.GetAllParent(organize.Number); foreach (var current in parents) { if (!string.IsNullOrEmpty(current.ChargeLeader)) { return(current.ChargeLeader); } } return(string.Empty); }
/// <summary> /// 得到一个人员的主管。 /// </summary> /// <param name="userId"></param> /// <returns></returns> public string GetLeader(Guid userId) { Guid organizeId = this.GetMainStation(userId); if (Guid.Empty.Equals(organizeId)) { return(string.Empty); } Organize organizeBll = new Organize(); Data.Model.Organize organize = organizeBll.Get(organizeId); if (organize == null) { return(string.Empty); } if (!string.IsNullOrEmpty(organize.Leader)) { return(organize.Leader); } List <Data.Model.Organize> list = organizeBll.GetAllParent(organize.Number); foreach (Data.Model.Organize current in list) { if (!string.IsNullOrEmpty(current.Leader)) { return(current.Leader); } } return(string.Empty); }
public string GetParentDeptLeader(Guid userID) { Guid mainStation = this.GetMainStation(userID); Organize organize1 = new Organize(); RoadFlow.Data.Model.Organize organize2 = organize1.Get(mainStation); if (organize2 == null) { return(""); } foreach (RoadFlow.Data.Model.Organize organize3 in organize1.GetAllParent(organize2.Number)) { if (!organize3.Leader.IsNullOrEmpty()) { return(organize3.Leader); } } return(""); }
/// <summary> /// 获取一个用户所在的部门。 /// </summary> /// <param name="userId">用户ID。</param> /// <returns></returns> public Data.Model.Organize GetDeptByUserID(Guid userId) { Guid organizeId = this.GetMainStation(userId); if (organizeId.Equals(Guid.Empty)) { return(null); } Organize organize = new Organize(); List <Data.Model.Organize> list = organize.GetAllParent(organizeId); foreach (Data.Model.Organize current in list) { if (current.Type.Equals(1) || current.Type.Equals(2)) { return(current); } } return(null); }
public string GetChargeLeader(Guid userID) { Guid mainStation = GetMainStation(userID); Organize organize = new Organize(); RoadFlow.Data.Model.Organize organize2 = organize.Get(mainStation); if (organize2 == null) { return(""); } if (!organize2.ChargeLeader.IsNullOrEmpty()) { return(organize2.ChargeLeader); } foreach (RoadFlow.Data.Model.Organize item in organize.GetAllParent(organize2.Number)) { if (!item.ChargeLeader.IsNullOrEmpty()) { return(item.ChargeLeader); } } return(""); }