/// <summary> /// بررسی و مقداردهی مدیر از روی شناسه کاربری /// </summary> /// <returns></returns> private bool InitManager() { if (manager == null) { if (Utility.IsEmpty(this.Username)) { this.Username = Security.BUser.CurrentUser.UserName; } BManager businessManager = new BManager(); manager = businessManager.GetManagerByUsername(this.Username); } if (manager.ID == 0)// جانشین { SubstituteRepository subRep = new SubstituteRepository(false); if (subRep.IsSubstitute(Security.BUser.CurrentUser.Person.ID)) { IList <Substitute> sub = subRep.GetSubstitute(Security.BUser.CurrentUser.Person.ID); manager = sub.First().Manager; } } if (manager.ID > 0) { return(true); } return(false); }
public void GetByUsername_Test() { manager_testObject = busManager.GetManagerByUsername(ADOUser1.UserName); Assert.AreEqual(manager_testObject.ID, ADOManager1.ID); }