예제 #1
0
        /// <summary>
        /// Shows the detail.
        /// </summary>
        /// <param name="restUserId">The rest user identifier.</param>
        public void ShowDetail(int restUserId)
        {
            var rockContext = new RockContext();

            Person restUser = null;

            if (!restUserId.Equals(0))
            {
                restUser = new PersonService(rockContext).Get(restUserId);
            }

            if (restUser == null)
            {
                restUser = new Person {
                    Id = 0
                };
            }

            bool editAllowed = restUser.IsAuthorized(Authorization.EDIT, CurrentPerson);

            hfRestUserId.Value = restUser.Id.ToString();
            lTitle.Text        = ActionTitle.Edit("REST Key").FormatAsHtmlTitle();
            if (restUser.Id > 0)
            {
                tbName.Text      = restUser.LastName;
                cbActive.Checked = false;
                var activeStatusId = DefinedValueCache.Get(Rock.SystemGuid.DefinedValue.PERSON_RECORD_STATUS_ACTIVE.AsGuid()).Id;
                if (restUser.RecordStatusValueId == activeStatusId)
                {
                    cbActive.Checked = true;
                }

                var noteService = new NoteService(rockContext);
                var description = noteService.Queryable().Where(a => a.EntityId == restUser.Id).FirstOrDefault();
                if (description != null)
                {
                    tbDescription.Text = description.Text;
                }

                var userLoginService = new UserLoginService(rockContext);
                var userLogin        = userLoginService.Queryable().Where(a => a.PersonId == restUser.Id).FirstOrDefault();
                if (userLogin != null)
                {
                    tbKey.Text = userLogin.ApiKey;
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Shows the edit.
        /// </summary>
        /// <param name="DeviceId">The device identifier.</param>
        public void ShowDetail(int signCategoryId)
        {
            pnlDetails.Visible = true;
            SignCategory signCategory = null;

            var rockContext = new RockContext();

            if (!signCategoryId.Equals(0))
            {
                signCategory      = new SignCategoryService(rockContext).Get(signCategoryId);
                lActionTitle.Text = ActionTitle.Edit(SignCategory.FriendlyTypeName).FormatAsHtmlTitle();
            }

            if (signCategory == null)
            {
                signCategory = new SignCategory {
                    Id = 0
                };
                lActionTitle.Text = ActionTitle.Add(SignCategory.FriendlyTypeName).FormatAsHtmlTitle();
            }

            hfSignCategoryId.Value = signCategory.Id.ToString();

            tbName.Text        = signCategory.Name;
            tbDescription.Text = signCategory.Description;

            // render UI based on Authorized and IsSystem
            bool readOnly = false;

            nbEditModeMessage.Text = string.Empty;
            if (!IsUserAuthorized(Authorization.EDIT))
            {
                readOnly = true;
                nbEditModeMessage.Text = EditModeMessage.ReadOnlyEditActionNotAllowed(SignCategory.FriendlyTypeName);
            }

            if (readOnly)
            {
                lActionTitle.Text = ActionTitle.View(SignCategory.FriendlyTypeName);
                btnCancel.Text    = "Close";
            }

            tbName.ReadOnly        = readOnly;
            tbDescription.ReadOnly = readOnly;

            btnSave.Visible = !readOnly;
        }
        /// <summary>
        /// Shows the edit details.
        /// </summary>
        /// <param name="category">The category.</param>
        private void ShowEditDetails(Category category)
        {
            if (category.Id > 0)
            {
                lTitle.Text = ActionTitle.Edit(Category.FriendlyTypeName).FormatAsHtmlTitle();
                lIcon.Text  = "<i class='fa fa-square-o'></i>";
            }
            else
            {
                lTitle.Text = ActionTitle.Add(Category.FriendlyTypeName).FormatAsHtmlTitle();

                if (!string.IsNullOrEmpty(category.IconCssClass))
                {
                    lIcon.Text = String.Format("<i class='{0}'></i>", category.IconCssClass);
                }
                else
                {
                    lIcon.Text = "<i class='fa fa-square-o'></i>";
                }
            }

            SetEditMode(true);

            tbName.Text = category.Name;

            if (category.EntityTypeId != 0)
            {
                var entityType = EntityTypeCache.Read(category.EntityTypeId);
                lblEntityTypeName.Text = entityType.Name;
            }
            else
            {
                lblEntityTypeName.Text = string.Empty;
            }

            cpParentCategory.EntityTypeId = category.EntityTypeId;
            cpParentCategory.EntityTypeQualifierColumn = category.EntityTypeQualifierColumn;
            cpParentCategory.EntityTypeQualifierValue  = category.EntityTypeQualifierValue;
            cpParentCategory.SetValue(category.ParentCategoryId);

            lblEntityTypeQualifierColumn.Visible = !string.IsNullOrWhiteSpace(category.EntityTypeQualifierColumn);
            lblEntityTypeQualifierColumn.Text    = category.EntityTypeQualifierColumn;
            lblEntityTypeQualifierValue.Visible  = !string.IsNullOrWhiteSpace(category.EntityTypeQualifierValue);
            lblEntityTypeQualifierValue.Text     = category.EntityTypeQualifierValue;
            tbIconCssClass.Text   = category.IconCssClass;
            tbHighlightColor.Text = category.HighlightColor;
        }
        /// <summary>
        /// Shows the detail.
        /// </summary>
        /// <param name="groupRequirementTypeId">The group requirement type identifier.</param>
        public void ShowDetail(int groupRequirementTypeId)
        {
            RockContext                 rockContext                 = new RockContext();
            GroupRequirementType        groupRequirementType        = null;
            GroupRequirementTypeService groupRequirementTypeService = new GroupRequirementTypeService(rockContext);

            if (!groupRequirementTypeId.Equals(0))
            {
                groupRequirementType = groupRequirementTypeService.Get(groupRequirementTypeId);
                lActionTitle.Text    = ActionTitle.Edit(GroupRequirementType.FriendlyTypeName).FormatAsHtmlTitle();
            }

            if (groupRequirementType == null)
            {
                groupRequirementType = new GroupRequirementType {
                    Id = 0
                };
                groupRequirementType.RequirementCheckType = RequirementCheckType.Manual;
                lActionTitle.Text = ActionTitle.Add(GroupRequirementType.FriendlyTypeName).FormatAsHtmlTitle();
            }

            hfGroupRequirementTypeId.Value = groupRequirementType.Id.ToString();
            tbName.Text          = groupRequirementType.Name;
            tbDescription.Text   = groupRequirementType.Description;
            tbPositiveLabel.Text = groupRequirementType.PositiveLabel;
            tbNegativeLabel.Text = groupRequirementType.NegativeLabel;
            tbWarningLabel.Text  = groupRequirementType.WarningLabel;
            tbCheckboxLabel.Text = groupRequirementType.CheckboxLabel;
            cbCanExpire.Checked  = groupRequirementType.CanExpire;
            nbExpireInDays.Text  = groupRequirementType.ExpireInDays.ToString();

            ceSqlExpression.Text = groupRequirementType.SqlExpression;
            ceSqlExpression.Help = @"A SQL expression that returns a list of Person Ids that meet the criteria. Example: <pre>SELECT [Id] FROM [Person] WHERE [LastName] = 'Decker'</pre>
The SQL can include Lava merge fields:";

            ceSqlExpression.Help += groupRequirementType.GetMergeObjects(new Group()).lavaDebugInfo();

            ceWarningSqlExpression.Text = groupRequirementType.WarningSqlExpression;

            dpDataView.EntityTypeId  = EntityTypeCache.Read <Person>().Id;
            dpDataView.SelectedValue = groupRequirementType.DataViewId.ToString();

            dpWarningDataView.EntityTypeId  = EntityTypeCache.Read <Person>().Id;
            dpWarningDataView.SelectedValue = groupRequirementType.WarningDataViewId.ToString();

            hfRequirementCheckType.Value = groupRequirementType.RequirementCheckType.ConvertToInt().ToString();
        }
        /// <summary>
        /// Shows the mode where the user can edit an existing exclusion
        /// </summary>
        private void ShowEditMode()
        {
            if (!IsEditMode())
            {
                return;
            }

            pnlEditDetails.Visible = true;
            pnlViewDetails.Visible = false;
            HideSecondaryBlocks(true);
            pdAuditDetails.Visible = true;

            var exclusion = GetExclusion();

            lReadOnlyTitle.Text  = ActionTitle.Edit(StreakTypeExclusion.FriendlyTypeName).FormatAsHtmlTitle();
            rlpLocation.Location = exclusion.Location;
        }
예제 #6
0
        /// <summary>
        /// Shows the edit details.
        /// </summary>
        /// <param name="track">The track.</param>
        private void ShowEditDetails(Track track)
        {
            if (track.Id > 0)
            {
                lActionTitle.Text = ActionTitle.Edit(Track.FriendlyTypeName);
            }
            else
            {
                lActionTitle.Text = ActionTitle.Add(Track.FriendlyTypeName);
            }

            SetEditMode(true);

            tbName.Text        = track.Name;
            tbDescription.Text = track.Description;
            lblPeriod.Text     = track.Period.Name;
        }
예제 #7
0
        /// <summary>
        /// Shows the edit.
        /// </summary>
        /// <param name="emailTemplateId">The email template id.</param>
        protected void ShowEdit(int emailTemplateId)
        {
            var globalAttributes = GlobalAttributesCache.Read();

            string globalFromName = globalAttributes.GetValue("OrganizationName");

            tbFromName.Help = string.Format("If a From Name value is not entered the 'Organization Name' Global Attribute value of '{0}' will be used when this template is sent.", globalFromName);

            string globalFrom = globalAttributes.GetValue("OrganizationEmail");

            tbFrom.Help = string.Format("If a From Address value is not entered the 'Organization Email' Global Attribute value of '{0}' will be used when this template is sent.", globalFrom);

            SystemEmailService emailTemplateService = new SystemEmailService(new RockContext());
            SystemEmail        emailTemplate        = emailTemplateService.Get(emailTemplateId);

            if (emailTemplate != null)
            {
                lActionTitle.Text       = ActionTitle.Edit(SystemEmail.FriendlyTypeName).FormatAsHtmlTitle();
                hfEmailTemplateId.Value = emailTemplate.Id.ToString();

                tbCategory.Text = emailTemplate.Category;
                tbTitle.Text    = emailTemplate.Title;
                tbFromName.Text = emailTemplate.FromName;
                tbFrom.Text     = emailTemplate.From;
                tbTo.Text       = emailTemplate.To;
                tbCc.Text       = emailTemplate.Cc;
                tbBcc.Text      = emailTemplate.Bcc;
                tbSubject.Text  = emailTemplate.Subject;
                tbBody.Text     = emailTemplate.Body;
            }
            else
            {
                lActionTitle.Text       = ActionTitle.Add(SystemEmail.FriendlyTypeName).FormatAsHtmlTitle();
                hfEmailTemplateId.Value = 0.ToString();

                tbCategory.Text = string.Empty;
                tbTitle.Text    = string.Empty;
                tbFromName.Text = string.Empty;
                tbFrom.Text     = string.Empty;
                tbTo.Text       = string.Empty;
                tbCc.Text       = string.Empty;
                tbBcc.Text      = string.Empty;
                tbSubject.Text  = string.Empty;
                tbBody.Text     = string.Empty;
            }
        }
        /// <summary>
        /// Shows the detail.
        /// </summary>
        /// <param name="itemKey">The item key.</param>
        /// <param name="itemKeyValue">The item key value.</param>
        /// <param name="binaryFileTypeId">The binary file type id.</param>
        public void ShowDetail(string itemKey, int itemKeyValue, int?binaryFileTypeId)
        {
            if (!itemKey.Equals("BinaryFileId"))
            {
                return;
            }

            var        rockContext       = new RockContext();
            var        binaryFileService = new BinaryFileService(rockContext);
            BinaryFile binaryFile        = null;

            if (!itemKeyValue.Equals(0))
            {
                binaryFile = binaryFileService.Get(itemKeyValue);
            }

            if (binaryFile != null)
            {
                lActionTitle.Text = ActionTitle.Edit(binaryFile.BinaryFileType.Name).FormatAsHtmlTitle();
            }
            else
            {
                binaryFile = new BinaryFile {
                    Id = 0, IsSystem = false, BinaryFileTypeId = binaryFileTypeId
                };

                string friendlyName = BinaryFile.FriendlyTypeName;
                if (binaryFileTypeId.HasValue)
                {
                    var binaryFileType = new BinaryFileTypeService(rockContext).Get(binaryFileTypeId.Value);
                    if (binaryFileType != null)
                    {
                        friendlyName = binaryFileType.Name;
                    }
                }

                lActionTitle.Text = ActionTitle.Add(friendlyName).FormatAsHtmlTitle();
            }

            binaryFile.LoadAttributes(rockContext);

            // initialize the fileUploader BinaryFileId to whatever file we are editing/viewing
            fsFile.BinaryFileId = binaryFile.Id;

            ShowBinaryFileDetail(binaryFile);
        }
예제 #9
0
        /// <summary>
        /// Shows the detail.
        /// </summary>
        /// <param name="clientId">The rest user identifier.</param>
        public void ShowDetail(int clientId)
        {
            var rockContext = new RockContext();

            AuthClient authClient = null;
            var        isNew      = clientId.Equals(0);

            if (!isNew)
            {
                authClient          = new AuthClientService(rockContext).Get(clientId);
                lTitle.Text         = ActionTitle.Edit("Client").FormatAsHtmlTitle();
                tbClientSecret.Text = CLIENT_SECRET_PLACE_HOLDER;
            }
            else
            {
                lTitle.Text         = ActionTitle.Add("Client").FormatAsHtmlTitle();
                tbClientSecret.Text = string.Empty;
            }

            if (authClient == null)
            {
                if (!isNew)
                {
                    DisplayErrorMessage("The Auth Client with the specified Id was found.");
                    return;
                }

                authClient = new AuthClient {
                    Id = 0, IsActive = true
                };
            }

            hfRestUserId.Value = authClient.Id.ToString();

            tbName.Text                  = authClient.Name;
            cbActive.Checked             = authClient.IsActive;
            tbClientId.Text              = authClient.ClientId;
            tbRedirectUri.Text           = authClient.RedirectUri;
            tbPostLogoutRedirectUri.Text = authClient.PostLogoutRedirectUri;

            SetClaimsCheckboxValues(authClient.AllowedClaims.FromJsonOrNull <List <string> >());
            var editAllowed = authClient.IsAuthorized(Authorization.EDIT, CurrentPerson);

            lbSave.Visible = editAllowed;
        }
        /// <summary>
        /// Shows the detail.
        /// </summary>
        public void ShowDetail(int linkageId)
        {
            pnlDetails.Visible = true;

            EventItemOccurrenceGroupMap linkage = null;

            var rockContext = new RockContext();

            if (!linkageId.Equals(0))
            {
                linkage           = new EventItemOccurrenceGroupMapService(rockContext).Get(linkageId);
                lActionTitle.Text = ActionTitle.Edit("Linkage").FormatAsHtmlTitle();
            }

            if (linkage == null)
            {
                linkage = new EventItemOccurrenceGroupMap {
                    Id = 0
                };
                lActionTitle.Text = ActionTitle.Add("Linkage").FormatAsHtmlTitle();
            }

            hfLinkageId.Value = linkage.Id.ToString();

            if (linkage.EventItemOccurrence != null)
            {
                hfLinkageEventItemOccurrenceId.Value       = linkage.EventItemOccurrence.Id.ToString();
                lLinkageEventItemOccurrence.Text           = linkage.EventItemOccurrence.ToString();
                lbLinkageEventItemOccurrenceAdd.Visible    = false;
                lbLinkageEventItemOccurrenceRemove.Visible = true;
            }
            else
            {
                hfLinkageEventItemOccurrenceId.Value       = string.Empty;
                lLinkageEventItemOccurrence.Text           = string.Empty;
                lbLinkageEventItemOccurrenceAdd.Visible    = true;
                lbLinkageEventItemOccurrenceRemove.Visible = false;
            }

            gpLinkageGroup.SetValue(linkage.Group);
            gpLinkageGroup_SelectItem(null, null);

            tbLinkagePublicName.Text = linkage.PublicName;
            tbLinkageUrlSlug.Text    = linkage.UrlSlug;
        }
예제 #11
0
        /// <summary>
        /// Shows the edit details.
        /// </summary>
        /// <param name="definedType">Type of the defined.</param>
        private void ShowEditDetails(DefinedType definedType)
        {
            if (definedType.Id > 0)
            {
                lActionTitle.Text = ActionTitle.Edit(DefinedType.FriendlyTypeName);
            }
            else
            {
                lActionTitle.Text = ActionTitle.Add(DefinedType.FriendlyTypeName);
            }

            SetEditMode(true);

            tbTypeName.Text        = definedType.Name;
            tbTypeCategory.Text    = definedType.Category;
            tbTypeDescription.Text = definedType.Description;
            ddlTypeFieldType.SetValue(definedType.FieldTypeId);
        }
예제 #12
0
        /// <summary>
        /// Shows the edit details.
        /// </summary>
        /// <param name="period">The residency period.</param>
        private void ShowEditDetails(Period period)
        {
            if (period.Id > 0)
            {
                lActionTitle.Text = ActionTitle.Edit(Period.FriendlyTypeName);
            }
            else
            {
                lActionTitle.Text = ActionTitle.Add(Period.FriendlyTypeName);
            }

            SetEditMode(true);

            tbName.Text              = period.Name;
            tbDescription.Text       = period.Description;
            dpStartDate.SelectedDate = period.StartDate;
            dpEndDate.SelectedDate   = period.EndDate;
        }
예제 #13
0
        /// <summary>
        /// Shows the edit details.
        /// </summary>
        /// <param name="definedType">Type of the defined.</param>
        private void ShowEditDetails(DefinedType definedType)
        {
            if (definedType.Id > 0)
            {
                lTitle.Text = ActionTitle.Edit(DefinedType.FriendlyTypeName).FormatAsHtmlTitle();
            }
            else
            {
                lTitle.Text = ActionTitle.Add(DefinedType.FriendlyTypeName).FormatAsHtmlTitle();
            }

            SetEditMode(true);

            tbTypeName.Text = definedType.Name;
            cpCategory.SetValue(definedType.CategoryId);
            tbTypeDescription.Text = definedType.Description;
            tbHelpText.Text        = definedType.HelpText;
        }
예제 #14
0
        /// <summary>
        /// Shows the detail.
        /// </summary>
        /// <param name="binaryFileId">The binary file identifier.</param>
        /// <param name="binaryFileTypeId">The binary file type id.</param>
        public void ShowDetail(int binaryFileId, int?binaryFileTypeId)
        {
            var        rockContext       = new RockContext();
            var        binaryFileService = new BinaryFileService(rockContext);
            BinaryFile binaryFile        = null;

            if (!binaryFileId.Equals(0))
            {
                binaryFile = binaryFileService.Get(binaryFileId);
            }

            if (binaryFile == null)
            {
                BinaryFileType binaryFileType = null;
                if (binaryFileTypeId.HasValue)
                {
                    binaryFileType = new BinaryFileTypeService(rockContext).Get(binaryFileTypeId.Value);
                }

                if (binaryFileType != null)
                {
                    binaryFile = new BinaryFile {
                        Id = 0, IsSystem = false, BinaryFileTypeId = binaryFileTypeId
                    };
                    lActionTitle.Text = ActionTitle.Add(binaryFileType.Name).FormatAsHtmlTitle();
                }
                else
                {
                    pnlDetails.Visible = false;
                    return;
                }
            }
            else
            {
                lActionTitle.Text = ActionTitle.Edit(binaryFile.BinaryFileType.Name).FormatAsHtmlTitle();
            }

            binaryFile.LoadAttributes(rockContext);

            // initialize the fileUploader BinaryFileId to whatever file we are editing/viewing
            fsFile.BinaryFileId = binaryFile.Id;

            ShowBinaryFileDetail(binaryFile);
        }
예제 #15
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Load" /> event.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs" /> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!Page.IsPostBack)
            {
                lActionTitle.Text = ActionTitle.Add(PersonBadge.FriendlyTypeName).FormatAsHtmlTitle();

                PersonBadgeId = PageParameter("PersonBadgeId").AsInteger();
                if (PersonBadgeId != 0)
                {
                    var personBadge = new PersonBadgeService(new RockContext()).Get(PersonBadgeId);
                    if (personBadge != null)
                    {
                        lActionTitle.Text = ActionTitle.Edit(personBadge.Name).FormatAsHtmlTitle();

                        tbName.Text        = personBadge.Name;
                        tbDescription.Text = personBadge.Description;
                        if (personBadge.EntityTypeId.HasValue)
                        {
                            var badgeType = EntityTypeCache.Read(personBadge.EntityTypeId.Value);
                            compBadgeType.SelectedValue = badgeType.Guid.ToString().ToUpper();
                        }

                        BuildEditControls(personBadge, true);
                    }
                }
            }
            else
            {
                if (!string.IsNullOrWhiteSpace(compBadgeType.SelectedValue))
                {
                    var badgeType = EntityTypeCache.Read(compBadgeType.SelectedValue.AsGuid());
                    if (badgeType != null)
                    {
                        var personBadge = new PersonBadge {
                            EntityTypeId = badgeType.Id
                        };
                        BuildEditControls(personBadge, false);
                    }
                }
            }
        }
예제 #16
0
        private void ShowAttributeValueEdit(int valueId, bool setValues)
        {
            var          definedType = DefinedTypeCache.Read(hfDefinedTypeId.ValueAsInt());
            DefinedValue definedValue;

            modalValue.SubTitle = String.Format("Id: {0}", valueId);

            if (!valueId.Equals(0))
            {
                definedValue = new DefinedValueService(new RockContext()).Get(valueId);
                if (definedType != null)
                {
                    lActionTitleDefinedValue.Text = ActionTitle.Edit("defined value for " + definedType.Name);
                }
            }
            else
            {
                definedValue = new DefinedValue {
                    Id = 0
                };
                definedValue.DefinedTypeId = hfDefinedTypeId.ValueAsInt();
                if (definedType != null)
                {
                    lActionTitleDefinedValue.Text = ActionTitle.Add("defined value for " + definedType.Name);
                }
            }

            if (setValues)
            {
                hfDefinedValueId.SetValue(definedValue.Id);
                tbValueName.Text        = definedValue.Value;
                tbValueDescription.Text = definedValue.Description;
            }

            definedValue.LoadAttributes();
            phDefinedValueAttributes.Controls.Clear();
            Rock.Attribute.Helper.AddEditControls(definedValue, phDefinedValueAttributes, setValues, BlockValidationGroup);

            SetValidationGroup(phDefinedValueAttributes.Controls, modalValue.ValidationGroup);

            modalValue.Show();
        }
예제 #17
0
        /// <summary>
        /// Shows the edit.
        /// </summary>
        /// <param name="emailTemplateId">The email template id.</param>
        protected void ShowEdit(int emailTemplateId)
        {
            var    globalAttributes = GlobalAttributesCache.Read();
            string globalFrom       = globalAttributes.GetValue("OrganizationEmail");

            tbFrom.Help = string.Format("If a From value is not entered the 'Organization Email' Global Attribute value of '{0}' will be used when this template is sent.", globalFrom);

            pnlList.Visible    = false;
            pnlDetails.Visible = true;

            EmailTemplateService emailTemplateService = new EmailTemplateService();
            EmailTemplate        emailTemplate        = emailTemplateService.Get(emailTemplateId);

            if (emailTemplate != null)
            {
                lActionTitle.Text       = ActionTitle.Edit(EmailTemplate.FriendlyTypeName).FormatAsHtmlTitle();
                hfEmailTemplateId.Value = emailTemplate.Id.ToString();

                tbCategory.Text = emailTemplate.Category;
                tbTitle.Text    = emailTemplate.Title;
                tbFrom.Text     = emailTemplate.From;
                tbTo.Text       = emailTemplate.To;
                tbCc.Text       = emailTemplate.Cc;
                tbBcc.Text      = emailTemplate.Bcc;
                tbSubject.Text  = emailTemplate.Subject;
                tbBody.Text     = emailTemplate.Body;
            }
            else
            {
                lActionTitle.Text       = ActionTitle.Add(EmailTemplate.FriendlyTypeName).FormatAsHtmlTitle();
                hfEmailTemplateId.Value = 0.ToString();

                tbCategory.Text = string.Empty;
                tbTitle.Text    = string.Empty;
                tbFrom.Text     = string.Empty;
                tbTo.Text       = string.Empty;
                tbCc.Text       = string.Empty;
                tbBcc.Text      = string.Empty;
                tbSubject.Text  = string.Empty;
                tbBody.Text     = string.Empty;
            }
        }
예제 #18
0
        /// <summary>
        /// Gs the marketing campaign ad attribute type_ show edit.
        /// </summary>
        /// <param name="attributeId">The attribute id.</param>
        protected void gMarketingCampaignAdAttributeType_ShowEdit(Guid attributeGuid)
        {
            pnlDetails.Visible         = false;
            pnlAdTypeAttribute.Visible = true;

            Attribute attribute;

            if (attributeGuid.Equals(Guid.Empty))
            {
                attribute = new Attribute();
                edtAdTypeAttributes.ActionTitle = ActionTitle.Add("attribute for ad type " + tbName.Text);
            }
            else
            {
                attribute = AttributesState.First(a => a.Guid.Equals(attributeGuid));
                edtAdTypeAttributes.ActionTitle = ActionTitle.Edit("attribute for ad type " + tbName.Text);
            }

            edtAdTypeAttributes.SetAttributeProperties(attribute, typeof(MarketingCampaignAd));
        }
예제 #19
0
        /// <summary>
        /// Gs the group member attributes_ show edit.
        /// </summary>
        /// <param name="attributeGuid">The attribute GUID.</param>
        protected void gGroupMemberAttributes_ShowEdit(Guid attributeGuid)
        {
            pnlDetails.Visible = false;
            pnlGroupMemberAttribute.Visible = true;

            Attribute attribute;

            if (attributeGuid.Equals(Guid.Empty))
            {
                attribute = new Attribute();
                edtGroupMemberAttributes.ActionTitle = ActionTitle.Add("attribute for group members of " + tbName.Text);
            }
            else
            {
                attribute = GroupMemberAttributesState.First(a => a.Guid.Equals(attributeGuid));
                edtGroupMemberAttributes.ActionTitle = ActionTitle.Edit("attribute for group members of " + tbName.Text);
            }

            edtGroupMemberAttributes.SetAttributeProperties(attribute, typeof(GroupMember));
        }
예제 #20
0
        /// <summary>
        /// Shows the edit details.
        /// </summary>
        /// <param name="project">The residency project.</param>
        private void ShowEditDetails(Project project)
        {
            if (project.Id > 0)
            {
                lActionTitle.Text = ActionTitle.Edit(Project.FriendlyTypeName);
            }
            else
            {
                lActionTitle.Text = ActionTitle.Add(Project.FriendlyTypeName);
            }

            SetEditMode(true);

            tbName.Text        = project.Name;
            tbDescription.Text = project.Description;
            lblPeriod.Text     = project.Competency.Track.Period.Name;
            lblTrack.Text      = project.Competency.Track.Name;
            lblCompetency.Text = project.Competency.Name;
            tbMinAssessmentCountDefault.Text = project.MinAssessmentCountDefault.ToString();
        }
예제 #21
0
        /// <summary>
        /// Gs the binary file attributes_ show edit.
        /// </summary>
        /// <param name="attributeGuid">The attribute GUID.</param>
        protected void gBinaryFileAttributes_ShowEdit(Guid attributeGuid)
        {
            pnlDetails.Visible             = false;
            pnlBinaryFileAttribute.Visible = true;

            Attribute attribute;

            if (attributeGuid.Equals(Guid.Empty))
            {
                attribute = new Attribute();
                edtBinaryFileAttributes.ActionTitle = ActionTitle.Add("attribute for binary files of type " + tbName.Text);
            }
            else
            {
                attribute = BinaryFileAttributesState.First(a => a.Guid.Equals(attributeGuid));
                edtBinaryFileAttributes.ActionTitle = ActionTitle.Edit("attribute for binary files of type " + tbName.Text);
            }

            edtBinaryFileAttributes.SetAttributeProperties(attribute, typeof(BinaryFile));
        }
예제 #22
0
        /// <summary>
        /// Shows the edit.
        /// </summary>
        /// <param name="pageRouteId">The page route id.</param>
        protected void ShowEdit(int pageRouteId)
        {
            pnlList.Visible    = false;
            pnlDetails.Visible = true;

            PageRouteService pageRouteService = new PageRouteService();
            PageRoute        pageRoute        = pageRouteService.Get(pageRouteId);
            bool             readOnly;

            if (pageRoute != null)
            {
                hfPageRouteId.Value = pageRoute.Id.ToString();
                ddlPageName.SetValue(pageRoute.PageId);
                tbRoute.Text = pageRoute.Route;
                readOnly     = pageRoute.IsSystem;

                if (pageRoute.IsSystem)
                {
                    lActionTitle.Text = ActionTitle.View(PageRoute.FriendlyTypeName);
                    btnCancel.Text    = "Close";
                }
                else
                {
                    lActionTitle.Text = ActionTitle.Edit(PageRoute.FriendlyTypeName);
                    btnCancel.Text    = "Cancel";
                }
            }
            else
            {
                lActionTitle.Text   = ActionTitle.Add(PageRoute.FriendlyTypeName);
                hfPageRouteId.Value = 0.ToString();
                ddlPageName.SetValue(string.Empty);
                tbRoute.Text = string.Empty;
                readOnly     = false;
            }

            iconIsSystem.Visible = readOnly;
            ddlPageName.Enabled  = !readOnly;
            tbRoute.ReadOnly     = readOnly;
            btnSave.Visible      = !readOnly;
        }
예제 #23
0
        /// <summary>
        /// Shows the edit details.
        /// </summary>
        /// <param name="signatureDocumentTemplate">Type of the defined.</param>
        private void ShowEditDetails(SignatureDocumentTemplate signatureDocumentTemplate)
        {
            if (signatureDocumentTemplate.Id > 0)
            {
                lTitle.Text = ActionTitle.Edit(SignatureDocumentTemplate.FriendlyTypeName).FormatAsHtmlTitle();
            }
            else
            {
                lTitle.Text = ActionTitle.Add(SignatureDocumentTemplate.FriendlyTypeName).FormatAsHtmlTitle();
            }

            SetEditMode(true);

            tbTypeName.Text        = signatureDocumentTemplate.Name;
            tbTypeDescription.Text = signatureDocumentTemplate.Description;
            bftpFileType.SetValue(signatureDocumentTemplate.BinaryFileTypeId);
            cpProvider.SetValue(signatureDocumentTemplate.ProviderEntityType != null ? signatureDocumentTemplate.ProviderEntityType.Guid.ToString().ToUpper() : string.Empty);
            SetTemplates();
            ddlTemplate.SetValue(signatureDocumentTemplate.ProviderTemplateKey);
            ddlSystemEmail.SetValue(signatureDocumentTemplate.InviteSystemEmailId);
        }
예제 #24
0
        /// <summary>
        /// Shows the edit.
        /// </summary>
        /// <param name="campusId">The campus id.</param>
        protected void ShowEdit(int campusId)
        {
            pnlList.Visible    = false;
            pnlDetails.Visible = true;

            CampusService campusService = new CampusService();
            Campus        campus        = campusService.Get(campusId);

            if (campus != null)
            {
                lActionTitle.Text = ActionTitle.Edit(Campus.FriendlyTypeName);
                hfCampusId.Value  = campus.Id.ToString();
                tbCampusName.Text = campus.Name;
            }
            else
            {
                lActionTitle.Text = ActionTitle.Add(Campus.FriendlyTypeName);
                hfCampusId.Value  = 0.ToString();
                tbCampusName.Text = string.Empty;
            }
        }
예제 #25
0
        /// <summary>
        /// Shows the detail.
        /// </summary>
        /// <param name="itemKey">The item key.</param>
        /// <param name="itemKeyValue">The item key value.</param>
        /// <param name="binaryFileTypeId">The binary file type id.</param>
        public void ShowDetail(string itemKey, int itemKeyValue, int?binaryFileTypeId)
        {
            if (!itemKey.Equals("BinaryFileId"))
            {
                return;
            }

            var        binaryFileService = new BinaryFileService();
            BinaryFile BinaryFile        = null;

            if (!itemKeyValue.Equals(0))
            {
                BinaryFile = binaryFileService.Get(itemKeyValue);
            }

            if (BinaryFile != null)
            {
                lActionTitle.Text = ActionTitle.Edit(BinaryFile.BinaryFileType.Name);
            }
            else
            {
                BinaryFile = new BinaryFile {
                    Id = 0, IsSystem = false, BinaryFileTypeId = binaryFileTypeId
                };

                string friendlyName = BinaryFile.FriendlyTypeName;
                if (binaryFileTypeId.HasValue)
                {
                    var binaryFileType = new BinaryFileTypeService().Get(binaryFileTypeId.Value);
                    if (binaryFileType != null)
                    {
                        friendlyName = binaryFileType.Name;
                    }
                }

                lActionTitle.Text = ActionTitle.Add(friendlyName);
            }

            ShowDetail(BinaryFile);
        }
        /// <summary>
        /// Gs the marketing campaign ad attribute type_ show edit.
        /// </summary>
        /// <param name="attributeId">The attribute id.</param>
        protected void gItemAttributes_ShowEdit(Guid attributeGuid)
        {
            Attribute attribute;

            if (attributeGuid.Equals(Guid.Empty))
            {
                attribute                     = new Attribute();
                attribute.FieldTypeId         = FieldTypeCache.Read(Rock.SystemGuid.FieldType.TEXT).Id;
                edtItemAttributes.ActionTitle = ActionTitle.Add(tbName.Text + " Item Attribute");
            }
            else
            {
                attribute = ItemAttributesState.First(a => a.Guid.Equals(attributeGuid));
                edtItemAttributes.ActionTitle = ActionTitle.Edit(tbName.Text + " Item Attribute");
            }

            edtItemAttributes.ReservedKeyNames = ItemAttributesState.Where(a => !a.Guid.Equals(attributeGuid)).Select(a => a.Key).ToList();

            edtItemAttributes.SetAttributeProperties(attribute, typeof(ContentChannelItem));

            ShowDialog("ItemAttributes", true);
        }
예제 #27
0
        /// <summary>
        /// Gs the workflow type attributes_ show edit.
        /// </summary>
        /// <param name="attributeGuid">The attribute GUID.</param>
        protected void gWorkflowTypeAttributes_ShowEdit(Guid attributeGuid)
        {
            pnlDetails.Visible = false;
            pnlWorkflowTypeAttributes.Visible = true;

            Attribute attribute;

            if (attributeGuid.Equals(Guid.Empty))
            {
                attribute             = new Attribute();
                attribute.FieldTypeId = FieldTypeCache.Read(Rock.SystemGuid.FieldType.TEXT).Id;
                edtWorkflowTypeAttributes.ActionTitle = ActionTitle.Add("attribute for workflow type " + tbName.Text);
            }
            else
            {
                AttributeService attributeService = new AttributeService();
                attribute = attributeService.Get(attributeGuid);
                edtWorkflowTypeAttributes.ActionTitle = ActionTitle.Edit("attribute for workflow type " + tbName.Text);
            }

            edtWorkflowTypeAttributes.SetAttributeProperties(attribute, typeof(Workflow));
        }
예제 #28
0
        /// <summary>
        /// Gs the defined type attributes_ show edit.
        /// </summary>
        /// <param name="attributeGuid">The attribute GUID.</param>
        protected void gDefinedTypeAttributes_ShowEdit(Guid attributeGuid)
        {
            pnlDetails.Visible = false;
            vsDetails.Enabled  = false;
            pnlDefinedTypeAttributes.Visible = true;

            Attribute attribute;

            if (attributeGuid.Equals(Guid.Empty))
            {
                attribute = new Attribute();
                edtDefinedTypeAttributes.ActionTitle = ActionTitle.Add("attribute for defined type " + tbTypeName.Text);
            }
            else
            {
                AttributeService attributeService = new AttributeService();
                attribute = attributeService.Get(attributeGuid);
                edtDefinedTypeAttributes.ActionTitle = ActionTitle.Edit("attribute for defined type " + tbTypeName.Text);
            }

            edtDefinedTypeAttributes.SetAttributeProperties(attribute, typeof(DefinedValue));
        }
예제 #29
0
        /// <summary>
        /// Gs the group type attributes_ show edit.
        /// </summary>
        /// <param name="attributeGuid">The attribute GUID.</param>
        protected void gGroupTypeAttributes_ShowEdit(Guid attributeGuid)
        {
            pnlDetails.Visible            = false;
            pnlGroupTypeAttribute.Visible = true;

            edtGroupTypeAttributes.AttributeEntityTypeId = Rock.Web.Cache.EntityTypeCache.Read(typeof(GroupType)).Id;

            Attribute attribute;

            if (attributeGuid.Equals(Guid.Empty))
            {
                attribute = new Attribute();
                edtGroupTypeAttributes.ActionTitle = ActionTitle.Add("attribute for group type " + tbName.Text);
            }
            else
            {
                attribute = GroupTypeAttributesState.First(a => a.Guid.Equals(attributeGuid));
                edtGroupTypeAttributes.ActionTitle = ActionTitle.Edit("attribute for group type " + tbName.Text);
            }

            edtGroupTypeAttributes.SetAttributeProperties(attribute, typeof(GroupType));
        }
예제 #30
0
        /// <summary>
        /// Gs the workflow type attributes_ show edit.
        /// </summary>
        /// <param name="attributeGuid">The attribute GUID.</param>
        protected void gWorkflowTypeAttributes_ShowEdit(Guid attributeGuid)
        {
            pnlDetails.Visible = false;
            vsDetails.Enabled  = false;
            pnlWorkflowTypeAttributes.Visible = true;

            Attribute attribute;

            if (attributeGuid.Equals(Guid.Empty))
            {
                attribute = new Attribute();
                edtWorkflowTypeAttributes.ActionTitle = ActionTitle.Add("attribute for workflow type " + tbName.Text);
            }
            else
            {
                AttributeService attributeService = new AttributeService();
                attribute = attributeService.Get(attributeGuid);
                edtWorkflowTypeAttributes.ActionTitle = ActionTitle.Edit("attribute for workflow type " + tbName.Text);
            }

            edtWorkflowTypeAttributes.SetAttributeProperties(attribute);
        }