public void GetCrudStatus(Infrastructure.LcpsDbContext context) { CrudStatus = ImportCrudStatus.None; // ---------- Validate Staff HRStaff staff = context.StaffMembers.FirstOrDefault(x => x.StaffId.ToLower() == this.StaffId.ToLower()); if (staff == null) CrudStatus = ImportCrudStatus.InsertMember | ImportCrudStatus.CreateMembership; else { if(staff.LastName == "Stanislas") { int z = 0; z++; } AnvilEntity sm = new AnvilEntity(this); sm.CompareFields.Add("StaffId"); sm.CompareFields.Add("FirstName"); sm.CompareFields.Add("MiddleInitial"); sm.CompareFields.Add("LastName"); sm.CompareFields.Add("Birthdate"); sm.CompareFields.Add("Gender"); sm.Compare(staff); if (sm.Compare(staff).Count() > 0) CrudStatus = CrudStatus | ImportCrudStatus.UpdateMember; } if (staff != null) { // ------- Vadlidate Position HRStaffPosition position = context.StaffPositions .FirstOrDefault(x => x.StaffMemberId.Equals(staff.StaffKey) & x.BuildingKey.Equals(_staffDefinition.Building.BuildingKey) & x.EmployeeTypeKey.Equals(_staffDefinition.EmployeeType.EmployeeTypeLinkId) & x.JobTitleKey.Equals(_staffDefinition.JobTitle.JobTitleKey)); if (position == null) CrudStatus = CrudStatus | ImportCrudStatus.CreateMembership; else { AnvilEntity pm = new AnvilEntity(this); pm.CompareFields.Add("FiscalYear"); pm.CompareFields.Add("Status"); if (pm.Compare(position).Count() > 0) CrudStatus = CrudStatus | ImportCrudStatus.UpdateMembership; } } }
public bool IsSyncJustified() { AnvilEntity e = new AnvilEntity(this); HRBuilding b = db.Buildings.First(x => x.BuildingId == this.BuildingId); return (e.Compare(b).Count() > 0); }
public bool IsSyncJustified() { Student s = ToStudent(); Student t = DbContext.Students.First(x => x.StudentId == this.StudentId); AnvilEntity e = new AnvilEntity(s); return (e.Compare(t)).Count() > 0; }
public bool IsSyncJustified() { AnvilEntity e = new AnvilEntity(this); HRJobTitle jt = db.JobTitles.First(x => x.JobTitleId == this.JobTitleId); return (e.Compare(jt).Count() > 0); }
public void GetCrudStatus(Infrastructure.LcpsDbContext context) { CrudStatus = ImportCrudStatus.None; LdapAccount ac = context.LdapAccounts .FirstOrDefault( x => x.UserKey.Equals(_userKey) & x.UserName.ToLower() == this.UserName.ToLower() ); if (ac == null) CrudStatus = ImportCrudStatus.InsertMember; else { AnvilEntity e = new AnvilEntity(this); e.CompareFields.Add("Active"); if(e.Compare(ac).Count() > 0) CrudStatus = ImportCrudStatus.UpdateMembership; } }
public bool IsSyncJustified() { AnvilEntity e = new AnvilEntity(this); HREmployeeType jt = db.EmployeeTypes.First(x => x.EmployeeTypeId == this.EmployeeTypeId); return (e.Compare(jt).Count() > 0); }
public bool IsSyncJustified() { AnvilEntity e = new AnvilEntity(this); HRStaff b = db.StaffMembers.First(x => x.StaffKey == this.StaffKey); return (e.Compare(b).Count() > 0); }
public bool IsSyncJustified() { InstructionalLevel i = ToInstructionalLevel(); InstructionalLevel t = DbContext.InstructionalLevels.First(x => x.InstructionalLevelId == this.InstructionalLevelId); AnvilEntity e = new AnvilEntity(i); return (e.Compare(t).Count() > 0); }