コード例 #1
0
        /// <summary>
        /// Overload to call bindMembers with the default sorting
        /// </summary>
        private void bindMembers()
        {
            List <DepartmentMember> uniqueMembers = DepartmentMemberBLL.GetUniqueByPosition(currentPosition);

            lviewMembers.DataSource = uniqueMembers;
            lviewMembers.DataBind();
        }
コード例 #2
0
        protected void btnUpdateAccess_Click(object sender, EventArgs e)
        {
            foreach (var row in lviewMembers.Items)
            {
                if (row.ItemType == ListViewItemType.DataItem)
                {
                    CheckBox cboxCommittee = row.FindControl(STR_ChkAllowCommittee) as CheckBox;
                    CheckBox cboxFaculty   = row.FindControl(STR_ChkAllowFaculty) as CheckBox;
                    CheckBox cboxReview    = row.FindControl(STR_ChkAllowReview) as CheckBox;

                    //Get the departmental member associated with this row
                    int departmentMemberID  = (int)lviewMembers.DataKeys[row.DataItemIndex]["id"];
                    DepartmentMember member = DepartmentMemberBLL.GetByID(departmentMemberID);

                    using (var ts = new TransactionScope())
                    {
                        DepartmentMemberBLL.UpdateAccess(member, currentPosition, cboxCommittee.Checked, cboxFaculty.Checked, cboxReview.Checked);

                        ts.CommitTransaction();
                    }
                }
            }

            this.bindMembers();

            this.ShowUpdateAcessRegion();

            //Display an update successful message
            lblCommitteeUpdated.Text = "Committee Membership Successfully Updated";
        }
コード例 #3
0
        protected void btnAddMember_Click(object sender, EventArgs e)
        {
            //Create the new department member
            DepartmentMember member = new DepartmentMember();

            member.DepartmentFIS       = STR_FRAC;
            member.FirstName           = txtFName.Text;
            member.LastName            = txtLName.Text;
            member.OtherDepartmentName = string.IsNullOrEmpty(txtDepartment.Text) ? "Other" : txtDepartment.Text;
            member.LoginID             = txtLoginID.Text.ToLower().Trim();

            //Create the membership object
            CommitteeMember committeeAccess = new CommitteeMember();

            committeeAccess.AssociatedPosition = currentPosition;
            committeeAccess.DepartmentMember   = member;

            switch (dlistMemberType.SelectedValue)
            {
            case "Committee":
                committeeAccess.MemberType = MemberTypeBLL.GetByID((int)MemberTypes.CommitteeMember);
                break;

            case "Faculty":
                committeeAccess.MemberType = MemberTypeBLL.GetByID((int)MemberTypes.FacultyMember);
                break;

            case "Review":
                committeeAccess.MemberType = MemberTypeBLL.GetByID((int)MemberTypes.Reviewer);
                break;
            }

            //save the department member and add to the position committee for this position
            using (var ts = new TransactionScope())
            {
                DepartmentMemberBLL.EnsurePersistent(member);

                committeeAccess.DepartmentMember = member;

                currentPosition.CommitteeMembers.Add(committeeAccess);

                Position position = currentPosition;

                PositionBLL.EnsurePersistent(position);

                ts.CommitTransaction();
            }

            //Display an update successful message
            lblCommitteeUpdated.Text = "Committee Membership Successfully Updated";

            //rebind the datagrid
            this.bindMembers();

            this.ShowUpdateAcessRegion();
        }
コード例 #4
0
        protected void btnRemove_Click(object sender, EventArgs e)
        {
            LinkButton lbtn = (LinkButton)sender;

            int departmentMemberID  = int.Parse(lbtn.CommandArgument);
            DepartmentMember member = DepartmentMemberBLL.GetByID(departmentMemberID);

            using (var ts = new TransactionScope())
            {
                member.Inactive = true; //Mark the member as inactive

                DepartmentMemberBLL.EnsurePersistent(member);

                ts.CommitTransaction();
            }

            lviewApplications.DataBind();
        }
コード例 #5
0
        protected void btnAddMember_Click(object sender, EventArgs e)
        {
            DepartmentMember member = new DepartmentMember();

            member.LoginID   = txtLoginID.Text.ToLower().Trim();
            member.FirstName = txtFName.Text;
            member.LastName  = txtLName.Text;

            member.DepartmentFIS = dlistDepartment.SelectedValue;

            using (var ts = new TransactionScope())
            {
                DepartmentMemberBLL.EnsurePersistent(member);

                ts.CommitTransaction();
            }

            //Now we have a new member, so rebind the grid
            lviewApplications.DataBind();
        }
コード例 #6
0
        /*
         * /// <summary>
         * /// Gets the row's department member, and checks all of the appropriate boxes regarding the roles that the member
         * /// has in the current position
         * /// </summary>
         * protected void gviewMembers_RowDataBound(object sender, GridViewRowEventArgs e)
         * {
         *  GridView gview = (GridView)sender;
         *  CheckBox cboxCommittee = e.Row.FindControl(STR_ChkAllowCommittee) as CheckBox;
         *  CheckBox cboxFaculty = e.Row.FindControl(STR_ChkAllowFaculty) as CheckBox;
         *  CheckBox cboxReview = e.Row.FindControl(STR_ChkAllowReview) as CheckBox;
         *
         *  int DepartmentMemberID;
         *  DepartmentMember member;
         *
         *  if (e.Row.RowType == DataControlRowType.DataRow)
         *  {
         *      DepartmentMemberID = (int)gview.DataKeys[e.Row.RowIndex]["id"];
         *      member = DepartmentMemberBLL.GetByID(DepartmentMemberID);
         *
         *      //Now we have the departmental member, check the committee records for this position
         *      List<CommitteeMember> committeAccessList = CommitteeMemberBLL.GetByAssociationsPosition(currentPosition, member);
         *
         *      //Now we have a list of all access types for this department member, so go through and check the correct boxes
         *
         *      foreach (CommitteeMember cAccess in committeAccessList)
         *      {
         *          switch (cAccess.MemberType.ID)
         *          {
         *              case (int)MemberTypes.CommitteeMember:
         *                  cboxCommittee.Checked = true;
         *                  break;
         *              case (int)MemberTypes.FacultyMember:
         *                  cboxFaculty.Checked = true;
         *                  break;
         *              case (int)MemberTypes.Reviewer:
         *                  cboxReview.Checked = true;
         *                  break;
         *              default:
         *                  break;
         *          }
         *      }
         *  }
         * }
         */

        /// <summary>
        /// Gets the row's department member, and checks all of the appropriate boxes regarding the roles that the member
        /// has in the current position
        /// </summary>
        protected void lviewMembers_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            ListView         lview       = (ListView)sender;
            ListViewDataItem currentItem = (ListViewDataItem)e.Item;

            CheckBox cboxCommittee = currentItem.FindControl(STR_ChkAllowCommittee) as CheckBox;
            CheckBox cboxFaculty   = currentItem.FindControl(STR_ChkAllowFaculty) as CheckBox;
            CheckBox cboxReview    = currentItem.FindControl(STR_ChkAllowReview) as CheckBox;

            int DepartmentMemberID;
            DepartmentMember member;

            DepartmentMemberID = (int)lviewMembers.DataKeys[currentItem.DataItemIndex]["id"];
            member             = DepartmentMemberBLL.GetByID(DepartmentMemberID);

            //Now we have the departmental member, check the committee records for this position
            List <CommitteeMember> committeAccessList = CommitteeMemberBLL.GetByAssociationsPosition(currentPosition, member);

            //Now we have a list of all access types for this department member, so go through and check the correct boxes

            foreach (CommitteeMember cAccess in committeAccessList)
            {
                switch (cAccess.MemberType.ID)
                {
                case (int)MemberTypes.CommitteeMember:
                    cboxCommittee.Checked = true;
                    break;

                case (int)MemberTypes.FacultyMember:
                    cboxFaculty.Checked = true;
                    break;

                case (int)MemberTypes.Reviewer:
                    cboxReview.Checked = true;
                    break;

                default:
                    break;
                }
            }
        }
コード例 #7
0
        public override void LoadData()
        {
            base.LoadData();

            DepartmentMember departmentMember = new DepartmentMember
            {
                DepartmentFIS       = StaticProperties.TestString,
                FirstName           = StaticProperties.TestString,
                LastName            = StaticProperties.TestString,
                LoginID             = StaticProperties.TestString,
                OtherDepartmentName = StaticProperties.TestString
            };

            using (var ts = new TransactionScope())
            {
                DepartmentMemberBLL.EnsurePersistent(departmentMember);

                for (int i = 0; i < 4; i++)
                {
                    var memberType = new MemberType {
                        Type = StaticProperties.TestString
                    };

                    var committeeMember = new CommitteeMember
                    {
                        AssociatedPosition =
                            PositionBLL.GetByID(StaticProperties.ExistingPositionID),
                        DepartmentMember = departmentMember,
                        MemberType       = memberType
                    };


                    MemberTypeBLL.EnsurePersistent(memberType);
                    CommitteeMemberBLL.EnsurePersistent(committeeMember);
                }

                ts.CommitTransaction();
            }
        }
コード例 #8
0
 public DepartmentMember LookupKerberosUser(string loginID)
 {
     return(DepartmentMemberBLL.Search(loginID));
 }