public static Approvers getAdvApprovers(AP_Staff_AdvanceRequest adv, double LargeTransaction, DotNetNuke.Entities.Users.UserInfo authUser, DotNetNuke.Entities.Users.UserInfo authAuthUser) { StaffBroker.StaffBrokerDataContext dStaff = new StaffBroker.StaffBrokerDataContext(); Approvers rtn = new Approvers(); var st = StaffBrokerFunctions.GetStaffMember((int)adv.UserId ); rtn.Name = st.DisplayName; int SpouseId = StaffBrokerFunctions.GetSpouseId((int)adv.UserId); rtn.AmountSpecial = ((double)adv.RequestAmount)>LargeTransaction ; rtn.SpouseSpecial = false; rtn.UserIds = new List<DotNetNuke.Entities.Users.UserInfo>(); var app2 = StaffBrokerFunctions.GetLeaders((int)adv.UserId, true); rtn.SpouseSpecial = (app2.Count() == 1 && ((app2.First() == SpouseId) || (app2.First() == (int)adv.UserId))); if (rtn.AmountSpecial || rtn.SpouseSpecial || app2.Count() == 0) { rtn.UserIds.Add(authUser.UserID == adv.UserId ? authAuthUser : authUser); if (app2.Contains((authUser.UserID == adv.UserId ? (authAuthUser.UserID) : authUser.UserID))) { rtn.AmountSpecial = false; } } else { foreach (int i in (from c in app2 where c != adv.UserId && c != SpouseId select c)) rtn.UserIds.Add(DotNetNuke.Entities.Users.UserController.GetUserById(adv.PortalId, i)); } return rtn; }
partial void UpdateAP_Staff_AdvanceRequest(AP_Staff_AdvanceRequest instance);
partial void DeleteAP_Staff_AdvanceRequest(AP_Staff_AdvanceRequest instance);
partial void InsertAP_Staff_AdvanceRequest(AP_Staff_AdvanceRequest instance);