Ejemplo n.º 1
0
        /// <summary>
        /// Handles event when user clicks on "OK" button.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void OKButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                string reason = ReasonListBox.SelectedItem.Text;

                if (!String.IsNullOrEmpty(SaveReasonAsName.Text))
                {
                    SaveCustomReason();
                    reason = SaveReasonAsName.Text;
                }

                if (StudyEdited != null)
                {
                    List <UpdateItem> modifiedFields = GetChanges();
                    if (modifiedFields != null && modifiedFields.Count > 0)
                    {
                        var studyController = new StudyController();
                        studyController.EditStudy(Study, modifiedFields, reason + ImageServerConstants.ReasonCommentSeparator[0] + Comment.Text);
                        AuditLog(Study, modifiedFields);
                        StudyEdited();
                    }
                }

                Close();
            }
            else
            {
                EnsureDialogVisible();
            }
        }