Пример #1
0
        public override void LoadData()
        {
            base.LoadData();

            //Add some applications
            Profile profile = ProfileBLL.GetByID(StaticProperties.ExistingProfileID);

            Application application = new Application();

            application.AppliedPosition   = PositionBLL.GetByID(StaticProperties.ExistingPositionID);
            application.AssociatedProfile = profile;
            application.Email             = StaticProperties.ExistingApplicantEmail;

            application.LastUpdated = DateTime.Now;

            profile.Applications = new List <Application> {
                application
            };

            using (var ts = new TransactionScope())
            {
                ApplicationBLL.EnsurePersistent(application);
                ProfileBLL.EnsurePersistent(profile);

                ts.CommitTransaction();
            }
        }
Пример #2
0
        /// <summary>
        /// After databound, find out if we should show the send emails button
        /// </summary>
        protected void lviewApplications_DataBound(object sender, EventArgs e)
        {
            bool applicationsExist = lviewApplications.Items.Count > 0;

            pnlApplicationsExist.Visible = applicationsExist;

            if (applicationsExist)
            {
                txtBccAddress.Text = PositionBLL.GetByID(int.Parse(dlistApplicants.SelectedValue)).HREmail;
            }
        }
Пример #3
0
        protected void lbtnAccept_Click(object sender, EventArgs e)
        {
            LinkButton lbtn = sender as LinkButton;

            //Grab the position associated with this button
            Position currentPosition = PositionBLL.GetByID(int.Parse(lbtn.CommandArgument));

            //Now set the adminAccepted property to true

            using (var ts = new TransactionScope())
            {
                currentPosition.AdminAccepted = true;
                PositionBLL.EnsurePersistent(currentPosition);

                ts.CommitTransaction();
            }

            //Now rebind the grid
            gViewPositions.DataBind();
        }
Пример #4
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();
            }
        }