コード例 #1
0
        private void saveSpecifiedSkillsButton_Click(object sender, EventArgs e)
        {
            string []   sArr     = skillsIdTextBox.Text.Split(',');
            int[]       skillIds = sArr.Select(int.Parse).ToArray();
            UserFullDTO ufDTO    = userController.saveSkills(skillIds, userIdSelect.Text);

            if (ufDTO == null)
            {
                MessageBox.Show("Could not save specified skills.");
            }
            else
            {
                string userDesc = "";

                //NOTE: Due to instruction server not working properly author is not sure whether returned object is DetailsFullDTO.
                PropertyInfo[] fields = typeof(DetailsFullDTO).GetProperties(BindingFlags.NonPublic | BindingFlags.Instance);
                foreach (var field in fields)
                {
                    userDesc += field.Name + " : " + field.GetValue(ufDTO) + Environment.NewLine;
                }
                MessageBox.Show(userDesc);
            }

            this.Close();
        }
コード例 #2
0
ファイル: Models.cs プロジェクト: kamiguz/CommApp
 public DetailsFullDTO(string foStudy, string fName, string ID, string lName, string uni, UserFullDTO User, int yoStudy)
 {
     fieldOfStudy = foStudy;
     firstName    = fName;
     id           = ID;
     lastName     = lName;
     university   = uni;
     user         = User;
     yearOfStudy  = yoStudy;
 }