コード例 #1
0
        private void btnSelectUser_Click(object sender, EventArgs e)
        {
            btnSelectTrafficArea.DisableServerSideValidation();

            if (Page.IsValid)
            {
                // Add this planner to this traffic area.
                int  identityId = Convert.ToInt32(cboAddPlanner.SelectedValue);
                bool success    = false;

                using (Facade.ITrafficArea facTrafficArea = new Facade.Traffic())
                    success = facTrafficArea.CreateUser(m_trafficArea, identityId, ((Entities.CustomPrincipal)Page.User).UserName);

                if (success)
                {
                    lblConfirmation.Text = "The planner is now attached to the traffic area.";
                    ConfigureTrafficAreaManupulation(eTrafficAreaManipulation.ConfigurePlanners);
                }
                else
                {
                    lblConfirmation.Text = "The planner could not be attached to the traffic area.";
                }

                lblConfirmation.Visible = true;
            }
        }