示例#1
0
        private void deleteuserToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AssociationData association = FindAssociation(uxAssociationsListView.SelectedItems[0]);

            association.Role.Users.Remove(association.User);
            LoadAssociations();
        }
示例#2
0
        private void DeleteProfileFromRole()
        {
            AssociationData association = FindAssociation(uxAssociationsListView.SelectedItems[0]);

            association.Role.Profiles.Remove(association.Profile);
            LoadAssociations();
        }
示例#3
0
 private void OpenUserPropertiesForm(AssociationData association)
 {
     if (DialogResult.OK == new uxUserForm(association.User).ShowDialog(this))
     {
         LoadAssociations();
     }
 }
示例#4
0
        private void OpenProfilePropertiesForm()
        {
            AssociationData association = FindAssociation(uxAssociationsListView.SelectedItems[0]);

            if (association.Profile != null)
            {
                OpenProfilePropertiesForm(association);
            }
        }
示例#5
0
        private void lvAssociations_DoubleClick(object sender, EventArgs e)
        {
            AssociationData association = FindAssociation(uxAssociationsListView.SelectedItems[0]);

            if (association.User != null)
            {
                OpenUserPropertiesForm(association);
            }
            else if (association.Profile != null)
            {
                OpenProfilePropertiesForm(association);
            }
        }
        public ActionResult Edit(int id, int associationType, int constiuent)
        {
            var association = new Association();

            var constituentId =  Convert.ToInt32(Session["loggedInConstituentId"]);
            TryUpdateModel(association);
            association.Type = new AssociationType {Id = associationType};
            association.Constituent = new Constituent {Id =constituentId };
            association.AssociatedConstituent = new Constituent() { Id = constiuent };

            mapper = new AutoDataContractMapper();
            var associationData = new AssociationData();
            mapper.Map(association, associationData);

            HttpHelper.Put(string.Format(serviceBaseUri+"/Associations/{0}", id), associationData);
            return PartialView(new GridModel(GetAssociations( Convert.ToInt32(Session["loggedInConstituentId"]))));
        }
示例#7
0
        protected override void OnStart()
        {
            base.OnStart();

            _scoreController = _bootstrap.GetController(ControllerTypes.Score) as ScoreController;
            _register        = _bootstrap.GetController(ControllerTypes.Register) as RegisterController;

            _resourcesData = _bootstrap.GetModel(ModelTypes.Resources) as ResourcesDataBase;

            _timeController = _bootstrap.GetController(ControllerTypes.Time) as TimeController;
            if (_timeController != null)
            {
                _timeController.GameTimeout += TimeOut;
            }

            _SoundController = _bootstrap.GetController(ControllerTypes.SoundSFX) as SoundController;
            _questionsData   = _bootstrap.GetModel(ModelTypes.Questions) as QuestionsData;
            _AssociationData = _bootstrap.GetModel(ModelTypes.Association) as AssociationData;
        }
        public ActionResult Create(int associationType, int constiuent)
        {
            var association = new Association();
            TryUpdateModel(association);
            var constituentId =  Convert.ToInt32(Session["loggedInConstituentId"]);
            if (association.AssociatedConstituentId <= 0)
                association.AssociatedConstituent = null;
            association.AssociatedConstituent = new Constituent() { Id = constiuent };
            association.Constituent = new Constituent(){Id = constituentId};
            association.Type = new AssociationType { Id = associationType };

            mapper = new AutoDataContractMapper();
            var associationData = new AssociationData();
            mapper.Map(association, associationData);

            HttpHelper.Post(serviceBaseUri+"/Associations?ConstituentId="+constituentId, associationData);

            return PartialView(new GridModel(GetAssociations( Convert.ToInt32(Session["loggedInConstituentId"]))));
        }
示例#9
0
        private void LoadAssociations()
        {
            if (_currentRole == null)
            {
                return;
            }

            uxAssociationsListView.ContextMenuStrip = RoleMenu;

            uxAssociationsGroupBox.Enabled = true;
            uxRoleLabel.Text = "Gruppo corrente: " + uxRolesListBox.SelectedValue.ToString();

            uxAssociationsListView.Items.Clear();

            //load users
            foreach (User user in _currentRole.Users)
            {
                ListViewItem item = new ListViewItem(user.Username, 0, uxAssociationsListView.Groups[0]);
                uxAssociationsListView.Items.Add(item);

                AssociationData a = new AssociationData();
                a.Role         = (Role)_currentRole;
                a.User         = user;
                a.ListViewItem = item;
                _associations.Add(a);
            }

            //load profiles
            foreach (Profile profile in _currentRole.Profiles)
            {
                ListViewItem item = new ListViewItem(profile.Description, 1, uxAssociationsListView.Groups[1]);
                uxAssociationsListView.Items.Add(item);

                AssociationData a = new AssociationData();
                a.Role         = (Role)_currentRole;
                a.Profile      = profile;
                a.ListViewItem = item;
                _associations.Add(a);
            }
        }
示例#10
0
        private void cutuserToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AssociationData association = FindAssociation(uxAssociationsListView.SelectedItems[0]);

            _cuttedUser = association.User;
        }
示例#11
0
 private void OpenProfilePropertiesForm(AssociationData association)
 {
     new uxProfileForm(association.Profile, true).ShowDialog(this);
 }
示例#12
0
        private void OpenUserPropertiesForm()
        {
            AssociationData association = FindAssociation(uxAssociationsListView.SelectedItems[0]);

            OpenUserPropertiesForm(association);
        }