コード例 #1
0
ファイル: Form1.cs プロジェクト: sergiygladkyy/mbo
        // Update profile
        private void UpdateProfileCredentials()
        {
            try
            {
                if (String.IsNullOrWhiteSpace(profileTextBox.Text) ||
                    String.IsNullOrWhiteSpace(resultIdTextBox.Text))
                {
                    return;
                }

                var profileBody = profileTextBox.Text;
                var resultId = Guid.Parse(resultIdTextBox.Text.Trim());
                var profileRepository = new ProfileRepository();
                var profile = profileRepository.GetProfile(resultId);

                if (profile == null)
                {
                    MessageBox.Show("Wrong result Id");
                    return;
                }

                // Parse profile text
                profileTextBox.Text = ParseProfile(profileBody,
                                                   Constraints.KInterpretationDirectoryUrlPath + profile.ImageDirectory);

                // Copy images from Consul integrator to specific profile folder
                CopyImageFilesFromProfile(profileTextBox.Text, resultId);

                // Update profile in DB
                profileRepository.UpdateProfileBody(resultId, profileTextBox.Text);

                //MessageBox.Show("Profile updated");
                statusUpdated.Visible = true;

                ProfileUpatedEvent();
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: sergiygladkyy/mbo
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                var resultId = Guid.Parse(resultIdTextBox.Text.Trim());

                var profileRepository = new ProfileRepository();

                profileRepository.UpdateProfileBody(resultId, profileTextBox.Text);

                MessageBox.Show("Profile updated");
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }