Exemplo n.º 1
0
        protected void EditForm_ItemUpdated_Generic(object sender, DetailsViewUpdatedEventArgs e)
        {
            if (e == null)
            {
                return;
            }

            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                e.KeepInEditMode   = true;

                MagicForm form = (sender as MagicForm);
                if (form != null)
                {
                    HtmlGenericControl errorDiv = form.FindControl(form.ID + "ErrorPanel") as HtmlGenericControl;
                    if (errorDiv != null)
                    {
                        errorDiv.InnerHtml = e.Exception.GetBaseException().Message;
                        errorDiv.Visible   = true;
                    }
                }
            }
            else
            {
                this.BackToDetailMenu();
            }
        }
Exemplo n.º 2
0
        protected void FormRuleView_DataBound(object sender, EventArgs e)
        {
            ClientDataSet.RuleRow row = FormRoleView.DataItem as ClientDataSet.RuleRow;
            Label LabelUserName       = FormRoleView.FindControl("LabelUserName") as Label;
            Label LabelUserDate       = FormRoleView.FindControl("LabelUserDate") as Label;

            if (row != null && LabelUserName != null && LabelUserDate != null)
            {
                if (!row.IsLastUsedUserNull())
                {
                    LabelUserName.Text = RuleEngineProvider.GetDisplayUserName(row.LastUsedUser, row.OrganizationId);
                }
                if (!row.IsLastUsedDateNull())
                {
                    LabelUserDate.Text = row.LastUsedDate.ToString("g", CultureInfo.CurrentCulture);
                }
            }
        }
Exemplo n.º 3
0
        protected void UserActiveDataSource_Updating(object sender, ObjectDataSourceMethodEventArgs e)
        {
            if (e == null)
            {
                return;
            }

            e.InputParameters["organizationId"] = UserContext.Current.OrganizationId;

            CheckBoxList instanceList = EditUserActiveForm.FindControl("InstanceList") as CheckBoxList;

            if (instanceList != null)
            {
                e.InputParameters["instanceIdListWhereUserIsActive"] = instanceList.SelectedValue;
            }
        }
Exemplo n.º 4
0
        protected void UserGroupsDataSource_Updating(object sender, ObjectDataSourceMethodEventArgs e)
        {
            if (e == null)
            {
                return;
            }

            TreeView appGroupTreeView = EditUserGroupsForm.FindControl("AppGroupTreeView") as TreeView;

            if (appGroupTreeView != null)
            {
                string groupId = string.Empty;
                foreach (var node in appGroupTreeView.CheckedNodes)
                {
                    if (groupId.Length > 0)
                    {
                        groupId += ",";
                    }

                    groupId += node.Value;
                }
                e.InputParameters["groupId"] = groupId;
            }
        }