public IHttpActionResult UpdateUserDetails(StaffMemberData update) {
      var userName = User.Identity.Name;

      var user = repo_.UpdateStaffMember(userName, update);
      
      return Ok(user);
    } // UpdateUserDetails
Exemplo n.º 2
0
        private DataTable GetStaffMemberTable()
        {
            DataTable dt;
            int       PersonID = 0;
            Guid?     MinistryLUID;
            string    Name1 = String.Empty;
            string    Name2 = String.Empty;

            AttributeService attributeService = new AttributeService(new Rock.Data.RockContext());
            int ministryAreaAttributeID       = 0;
            int positionAttributeID           = 0;

            if (MinistryAreaAttributeGuid.HasValue)
            {
                ministryAreaAttributeID = attributeService.Get(MinistryAreaAttributeGuid.Value).Id;
            }
            if (PositionAttributeGuid.HasValue)
            {
                positionAttributeID = attributeService.Get(PositionAttributeGuid.Value).Id;
            }
            MinistryLUID = ddlMinistry.SelectedValue.AsGuidOrNull();

            if (ParseName(out PersonID, out Name1, out Name2))
            {
                if (PersonID > 0)
                {
                    dt = new StaffMemberData().GetStaffMembersDTByPersonID(ministryAreaAttributeID, positionAttributeID, PersonID);
                }
                else
                {
                    if (MinistryLUID.HasValue)
                    {
                        dt = new StaffMemberData().GetStaffMembersDTByNameMinistry(ministryAreaAttributeID, positionAttributeID, Name1, Name2, MinistryLUID);
                    }
                    else
                    {
                        dt = new StaffMemberData().GetStaffMembersDTByName(ministryAreaAttributeID, positionAttributeID, Name1, Name2);
                    }
                }
            }
            else
            {
                dt = new StaffMemberData().GetStaffMembersDTByMinistryID(ministryAreaAttributeID, positionAttributeID, MinistryLUID);
            }
            return(dt);
        }
Exemplo n.º 3
0
        protected override StaffGroupData Export(StaffGroup entity, IReadContext context)
        {
            StaffGroupData data = new StaffGroupData();

            data.Deactivated = entity.Deactivated;
            data.Name        = entity.Name;
            data.Description = entity.Description;
            data.Elective    = entity.Elective;

            data.Members = CollectionUtils.Map <Staff, StaffMemberData>(
                entity.Members,
                delegate(Staff staff)
            {
                StaffMemberData s = new StaffMemberData();
                s.Id = staff.Id;
                return(s);
            });

            return(data);
        }
Exemplo n.º 4
0
 public Manager(StaffMemberData smd,
                ProjectOrganisationData pod) :
     base(smd, pod) {
 } // Manager
Exemplo n.º 5
0
 public Supervisor(StaffMemberData smd,
                ProjectOrganisationData pod) : 
     base(smd, pod) {
   Projects = pod.Projects.Select(p => new Project(p)).OrderBy(p => p.Name).ToList();
   Locations = pod.Locations.Select(l => new Location(l)).OrderBy(l => l.Name).ToList();
 } // Supervisor
Exemplo n.º 6
0
 public Coordinator(StaffMemberData smd,
                    ProjectOrganisationData pod) :
     base(smd, pod) {
 } // Coordinator
Exemplo n.º 7
0
 public Advisor(StaffMemberData smd,
                ProjectOrganisationData pod) : 
     base(smd, pod) {
   Projects = pod.Projects.Where(p => smd.Projects().Contains(p.Id)).Select(p => new Project(p)).OrderBy(p => p.Name).ToList();
   Locations = pod.Locations.Where(l => smd.Projects().Intersect(l.Projects()).Count() != 0).Select(l => new Location(l)).OrderBy(l => l.Name).ToList();
 } // Advisor
Exemplo n.º 8
0
 public Staff(StaffMemberData smd,
              ProjectOrganisationData pod) {
   smd_ = smd;
   org_ = new Organisation(pod.Details);
 } // Advisor
Exemplo n.º 9
0
    } // StaffMember

    public StaffMember() {
      sd_ = new StaffMemberData();
      projectIds_ = new List<Guid>();
      roles_ = new List<string>();
    } // StaffMemberData
Exemplo n.º 10
0
 public StaffMember(StaffMemberData sd, IList<string> roles) {
   sd_ = sd;
   projectIds_ = sd.Projects();
   roles_ = roles;
 } // StaffMember