private void ShowBlockError(NotificationBox notificationControl, string message)
 {
     ShowBlockNotification(notificationControl, message, NotificationBoxType.Danger);
 }
Exemplo n.º 2
0
        private void BuildMemberCards()
        {
            phMembers.Controls.Clear();
            if (CurrentCheckInState == null)
            {
                NavigateToPreviousPage();
                return;
            }
            var family = CurrentCheckInState.CheckIn.Families.Where(f => f.Selected).FirstOrDefault();

            if (family == null || !family.People.Where(p => p.GroupTypes.Where(gt => gt.Groups.Any()).Any()).Any())
            {
                DisplayNoEligibleMembers();
                return;
            }
            foreach (var person in family.People.Where(p => p.GroupTypes.Where(gt => gt.Groups.Any()).Any()))
            {
                var card = new Panel();
                card.CssClass = "well col-md-3 col-sm-4 col-xs-12";
                phMembers.Controls.Add(card);

                PlaceHolder phNotes = new PlaceHolder();
                card.Controls.Add(phNotes);

                Panel pnlCheckbox = new Panel();
                pnlCheckbox.CssClass = "col-sm-6 col-xs-12";
                card.Controls.Add(pnlCheckbox);

                var btnCheckbox = new BootstrapButton();
                if (person.Selected)
                {
                    btnCheckbox.CssClass = "btn btn-success btn-lg btn-block";
                    btnCheckbox.Text     = "<i class='fa fa-check-square-o fa-5x'></i><br>" + person.Person.NickName;
                    if (person.Person.Age < 18)
                    {
                        btnCheckbox.Text += "<br>" + person.Person.FormatAge();
                    }
                    btnCheckbox.DataLoadingText = "<i class='fa fa-check-square-o fa-5x'></i><br>Loading...";
                }
                else
                {
                    btnCheckbox.CssClass = "btn btn-default btn-lg  btn-block";
                    btnCheckbox.Text     = "<i class='fa fa-square-o fa-5x'></i><br>" + person.Person.NickName;
                    if (person.Person.Age < 18)
                    {
                        btnCheckbox.Text += "<br>" + person.Person.FormatAge();
                    }
                    btnCheckbox.DataLoadingText = "<i class='fa fa-square-o fa-5x'></i><br>Loading...";
                }
                btnCheckbox.Click += (s, e) => { SelectPerson(person); };
                btnCheckbox.ID     = "btn" + person.Person.Id.ToString();
                pnlCheckbox.Controls.Add(btnCheckbox);

                Panel pnlImage = new Panel();
                pnlImage.CssClass = "col-sm-6 col-xs-12";
                card.Controls.Add(pnlImage);
                Image imgPhoto = new Image();
                imgPhoto.CssClass = "thumbnail";
                if (person.Person.ConnectionStatusValueId != _memberConnectionStatusId && person.Person.GetAttributeValue("Employer") != "Southeast Christian Church")
                {
                    imgPhoto.Style.Add("border", "solid blue 3px");
                }
                imgPhoto.ImageUrl = person.Person.PhotoUrl;
                imgPhoto.Style.Add("width", "100%");
                pnlImage.Controls.Add(imgPhoto);

                Literal ltName = new Literal();
                ltName.Text = "<h1 class='col-xs-12'>" + person.Person.FullNameFormal + "</h1>";
                card.Controls.Add(ltName);

                foreach (var gt in person.GroupTypes)
                {
                    foreach (var g in gt.Groups)
                    {
                        List <Note> notes = GetGroupMemberNotes(person, g.Group);
                        foreach (var note in notes)
                        {
                            NotificationBox nbNote = new NotificationBox();
                            if (note.IsAlert == true)
                            {
                                nbNote.NotificationBoxType = NotificationBoxType.Danger;
                            }
                            else
                            {
                                nbNote.NotificationBoxType = NotificationBoxType.Info;
                            }
                            nbNote.Text = nbNote.Text = note.Text;
                            phNotes.Controls.Add(nbNote);
                        }

                        Literal ltGroup = new Literal();
                        ltGroup.Text = "<b>" + g.Group.Name + "</b><br>";
                        card.Controls.Add(ltGroup);
                        foreach (var l in g.Locations)
                        {
                            BootstrapButton btnLocation = new BootstrapButton();
                            if (l.Selected)
                            {
                                btnLocation.CssClass = "btn btn-success";
                                btnLocation.Text     = "<i class='fa fa-check-square-o'></i>";
                            }
                            else
                            {
                                btnLocation.CssClass = "btn btn-default";
                                btnLocation.Text     = "<i class='fa fa-square-o'></i>";
                            }
                            btnLocation.ID     = "c" + person.Person.Id.ToString() + g.Group.Guid + l.Location.Id.ToString();
                            btnLocation.Click += (s, e) => { SelectLocation(person, gt, g, l); };
                            card.Controls.Add(btnLocation);
                            Literal ltLocation = new Literal();
                            ltLocation.Text = " " + l.Location.Name + "<br>";
                            card.Controls.Add(ltLocation);
                        }
                    }
                }
            }
        }
 /// <summary>
 /// Show a notification message for the block.
 /// </summary>
 /// <param name="notificationControl"></param>
 /// <param name="message"></param>
 /// <param name="notificationType"></param>
 private void ShowBlockNotification(NotificationBox notificationControl, string message, NotificationBoxType notificationType = NotificationBoxType.Info)
 {
     notificationControl.Text = message;
     notificationControl.NotificationBoxType = notificationType;
 }
Exemplo n.º 4
0
        private void ShowWidgityTypes()
        {
            var widgityTypes = WidgityTypeCache.All()
                               .Where(wt => wt.EntityTypes.Select(e => e.Id).Contains(EntityTypeId)).ToList();

            if (!widgityTypes.Any())
            {
                NotificationBox notification = new NotificationBox
                {
                    NotificationBoxType = NotificationBoxType.Warning,
                    Text = "There are no widgity types for this entity type: " + EntityTypeCache.Get(EntityTypeId)?.FriendlyName
                };
                pnlMenu.Controls.Add(notification);
                return;
            }

            var categories = widgityTypes
                             .Where(wt => wt.Category != null)
                             .Select(wt => wt.Category)
                             .DistinctBy(c => c.Id)
                             .ToList();

            foreach (var category in categories)
            {
                PanelWidget panelWidget = new PanelWidget
                {
                    ID    = this.ID + "_pwCategory_" + category.Id.ToString(),
                    Title = category.Name
                };
                pnlMenu.Controls.Add(panelWidget);

                var dragContainer = new Panel
                {
                    ID       = this.ID + "_pnlWidgityContainer_" + category.Id.ToString(),
                    CssClass = "widgitySource"
                };
                panelWidget.Controls.Add(dragContainer);

                var categoryTypes = widgityTypes.Where(wt => wt.CategoryId == category.Id).ToList();

                foreach (var widgityType in categoryTypes)
                {
                    HtmlGenericContainer item = new HtmlGenericContainer("div");
                    item.InnerHtml = string.Format("<i class='{0}'></i><br />{1}",
                                                   widgityType.Icon,
                                                   widgityType.Name);
                    item.Attributes.Add("data-component-id", widgityType.Id.ToString());
                    item.CssClass = "btn btn-default btn-block";
                    dragContainer.Controls.Add(item);
                }
            }

            var noCategoryTypes = widgityTypes.Where(wt => wt.Category == null).ToList();

            if (noCategoryTypes.Any())
            {
                var dragContainerOther = new Panel
                {
                    ID       = this.ID + "_pnlWidgityContainer_other",
                    CssClass = "widgitySource"
                };

                if (categories.Any())
                {
                    PanelWidget panelWidgetOther = new PanelWidget
                    {
                        ID    = this.ID + "_pwCategory_Other",
                        Title = "Other"
                    };
                    pnlMenu.Controls.Add(panelWidgetOther);
                    panelWidgetOther.Controls.Add(dragContainerOther);
                }
                else
                {
                    pnlMenu.Controls.Add(dragContainerOther);
                }

                foreach (var widgityType in noCategoryTypes)
                {
                    HtmlGenericContainer item = new HtmlGenericContainer("div")
                    {
                        InnerHtml = string.Format("<i class='{0}'></i><br />{1}",
                                                  widgityType.Icon,
                                                  widgityType.Name)
                    };
                    item.Attributes.Add("data-component-id", widgityType.Id.ToString());
                    dragContainerOther.Controls.Add(item);
                }
            }

            if (ShowPublishButtons)
            {
                HtmlGenericContainer hr = new HtmlGenericContainer("hr");
                pnlMenu.Controls.Add(hr);

                BootstrapButton btnSave = new BootstrapButton
                {
                    CssClass        = "btn btn-primary",
                    Text            = "Publish",
                    ID              = this.ID + "_btnSave",
                    ValidationGroup = this.ID + "ValidationGroup"
                };
                pnlMenu.Controls.Add(btnSave);
                btnSave.Click += BtnSave_Click;

                LinkButton btnCancel = new LinkButton
                {
                    ID       = this.ID + "_btnCancel",
                    Text     = "Cancel",
                    CssClass = "btn btn-link"
                };
                pnlMenu.Controls.Add(btnCancel);
                btnCancel.Click += BtnCancel_Click;
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Displays the notification.
 /// </summary>
 /// <param name="notificationBox">The notification box.</param>
 /// <param name="message">The message.</param>
 /// <param name="notificationBoxType">Type of the notification box.</param>
 protected void DisplayNotification(NotificationBox notificationBox, string message, NotificationBoxType notificationBoxType)
 {
     notificationBox.Text = message;
     notificationBox.NotificationBoxType = notificationBoxType;
     notificationBox.Visible             = true;
 }
Exemplo n.º 6
0
 public void leaveGameButton()
 {
     NotificationBox.drawNotificationBox(canvas.transform, "Do you really want to quit?", NotificationBox.Type.YES_NO, leaveGame);
 }
Exemplo n.º 7
0
 private static void LevelStats()
 {
     NotificationBox.Notification n = new NotificationBox.Notification($"{G.Sys.GameManager_.LevelName_}", $"{Timer.GetTime(true, 3)}", NotificationBox.NotificationType.Campaign, "WorldTraveller");
     NotificationBox.Show(n, false);
 }
Exemplo n.º 8
0
 public static void notifyThem(NotificationBox ntfbox,string msg,NotificationBox.Type ntype)
 {
     InvokeMe(ntfbox, () =>
     {
         ntfbox.Text = msg;
         ntfbox.NotificationType = ntype;
         ntfbox.Visible = true;
         ntfbox.Show();
         switch (ntype)
         {
             case NotificationBox.Type.Success:
                 ntfbox.Image = TestME.Properties.Resources.tick;
                 break;
             case NotificationBox.Type.Error:
                 ntfbox.Image = TestME.Properties.Resources.error;
                 break;
             case NotificationBox.Type.Warning:
                 ntfbox.Image = TestME.Properties.Resources.warning;
                 break;
             case NotificationBox.Type.Notice:
                 ntfbox.Image = TestME.Properties.Resources.notice;
                 break;
             case NotificationBox.Type.Other:
                 ntfbox.Image = TestME.Properties.Resources.star;
                 break;
         }
     });
 }
 /// <summary>
 /// Display custom notification message box with animation
 /// </summary>
 /// <param name="notification"></param>
 private void ShowNotificationMessageBox(string notifyMsg)
 {
     NotificationBox.ShowNotifyMessageBox(notifyMsg);
 }
Exemplo n.º 10
0
        private void Bootstrapper_DetectComplete(object sender, DetectCompleteEventArgs e)
        {
            Log(LogLevel.Standard, $"Detection complete. VersionStatus: {VersionStatus}");

            if (VersionStatus == VersionStatus.Current)
            {
                BurnInstallationState = BurnInstallationState.Failed;
                Log(LogLevel.Standard, "An attempt to reinstall the application was made.");

                if (!IsInteractive)
                {
                    if (Bootstrapper.Command.Action == LaunchAction.Uninstall)
                    {
                        PlanAction(Bootstrapper.Command.Action);
                        return;
                    }

                    ShutDownWithCancelCode();
                }
            }

            if (VersionStatus == VersionStatus.NewerAlreadyInstalled)
            {
                BurnInstallationState = BurnInstallationState.DetectedNewer;
                Log(LogLevel.Standard, "An attempt to downgrade the application was made.");

                if (IsInteractive)
                {
                    BootstrapperApp.BootstrapperDispatcher.Invoke((Action) delegate
                    {
                        NotificationBox.Show(string.Format(Resources.Common_NewerVersionInstalledTitle, Bootstrapper.BundleName),
                                             string.Format(Resources.Common_NewerVersionInstalledMessage, Bootstrapper.BundleName),
                                             MessageBoxButtons.OK);
                    });
                }

                ShutDownWithCancelCode();
            }
            else if (IsInteractive)
            {
                if (IsInstalled)
                {
                    if (BootstrapperUpdateState == UpdateState.Available)
                    {
                        // update page
                        NavigateToPage(PageType.InstallPage);
                    }
                    else
                    {
                        NavigateToPage(PageType.MaintenancePage);
                    }
                }
                else
                {
                    NavigateToPage(PageType.InstallPage);
                }
            }
            else
            {
                PlanAction(Bootstrapper.Command.Action);
            }
        }
Exemplo n.º 11
0
 private void Window_Activated(object sender, EventArgs e)
 {
     NotificationBox.CheckIfFileExist();
 }
Exemplo n.º 12
0
        private void Bootstrapper_Error(object sender, ErrorEventArgs e)
        {
            e.Result = Result.Restart;

            Log(LogLevel.Standard, $"Bootstrapper has called {nameof(this.Bootstrapper_Error)}");

            lock (this)
            {
                try
                {
                    Log(LogLevel.Error, $"Bootstrapper received error code {e.ErrorCode}: {e.ErrorMessage}");

                    if (ShouldCancel)
                    {
                        e.Result = Result.Cancel;
                        return;
                    }

                    if (BurnInstallationState == BurnInstallationState.Applying && e.ErrorCode == 1223)
                    {
                        return;
                    }

                    ErrorMessage = e.ErrorMessage;

                    if (!IsInteractive)
                    {
                        return;
                    }

                    var messageBoxButtonValue = e.UIHint & 0xF;

                    MessageBoxButtons messageBoxButton;

                    if (Enum.GetValues(typeof(MessageBoxButtons)).OfType <int>().Contains(messageBoxButtonValue))
                    {
                        messageBoxButton = (MessageBoxButtons)messageBoxButtonValue;
                    }
                    else
                    {
                        messageBoxButton = MessageBoxButtons.OK;
                    }

                    var result = DialogResult.None;

                    BootstrapperApp.BootstrapperDispatcher.Invoke(
                        (Action)
                        delegate
                    {
                        result = NotificationBox.Show(string.Format(Resources.Common_InstallErrorMessageTitle, Bootstrapper.BundleName),
                                                      e.ErrorMessage, messageBoxButton);
                    });

                    if (messageBoxButtonValue == (int)messageBoxButton)
                    {
                        e.Result = (Result)result;
                    }
                }
                finally
                {
                    Log(LogLevel.Error, $"Bootstrapper handled error {e.ErrorCode}: {e.ErrorMessage}");
                }
            }
        }
Exemplo n.º 13
0
        private void ShowEdit(int savedGroupMemberId = 0)
        {
            phGroups.Controls.Clear();
            var                groups             = GetGroups();
            RockContext        rockContext        = new RockContext();
            GroupMemberService groupMemberService = new GroupMemberService(rockContext);

            foreach (var group in groups)
            {
                Panel pnlGroup = new Panel();
                phGroups.Controls.Add(pnlGroup);

                Literal ltGroup = new Literal();
                ltGroup.Text = string.Format("<h4>{0}</h4>", group.Name);
                pnlGroup.Controls.Add(ltGroup);

                var groupMembers = groupMemberService.GetByGroupIdAndPersonId(group.Id, Person.Id);
                var unusedRoles  = group.GroupType.Roles.Where(r => !groupMembers.Select(gm => gm.GroupRoleId).Contains(r.Id));

                if (unusedRoles.Any())
                {
                    Panel pnlButtonGroup = new Panel();
                    pnlButtonGroup.CssClass = "input-group";
                    pnlGroup.Controls.Add(pnlButtonGroup);

                    RockDropDownList ddlRole = new RockDropDownList();
                    ddlRole.DataSource     = unusedRoles;
                    ddlRole.DataTextField  = "Name";
                    ddlRole.DataValueField = "Id";
                    ddlRole.CssClass       = "form-control";
                    ddlRole.ID             = "ddl" + group.Id.ToString();
                    ddlRole.DataBind();
                    pnlButtonGroup.Controls.Add(ddlRole);

                    Panel pnlInputGroupButton = new Panel();
                    pnlInputGroupButton.CssClass = "input-group-btn";
                    pnlButtonGroup.Controls.Add(pnlInputGroupButton);

                    BootstrapButton btnAdd = new BootstrapButton();
                    btnAdd.Text     = "Add To Group";
                    btnAdd.CssClass = "btn btn-primary";
                    btnAdd.ID       = "Add" + group.Id.ToString();
                    btnAdd.Click   += (s, e) => { AddGroupMember(group, ddlRole); };
                    pnlInputGroupButton.Controls.Add(btnAdd);
                }

                foreach (var groupMember in groupMembers)
                {
                    Panel pnlWell = new Panel();
                    pnlWell.CssClass = "well";
                    phGroups.Controls.Add(pnlWell);

                    Literal ltRole = new Literal();
                    ltRole.Text = string.Format("<b><em>Group Role: {0}</em></b> ", groupMember.GroupRole.Name);
                    pnlWell.Controls.Add(ltRole);

                    BootstrapButton btnRemove = new BootstrapButton();
                    btnRemove.Text     = "Remove";
                    btnRemove.CssClass = "btn btn-danger btn-xs pull-right";
                    btnRemove.ID       = groupMember.Id.ToString();
                    btnRemove.Click   += (s, e) => { ConfirmDelete(groupMember.Id); };
                    pnlWell.Controls.Add(btnRemove);

                    HtmlGenericContainer hr = new HtmlGenericContainer("hr");
                    pnlWell.Controls.Add(hr);

                    groupMember.LoadAttributes();
                    var attributeList = groupMember.Attributes.Select(d => d.Value)
                                        .OrderBy(a => a.Order).ThenBy(a => a.Name).ToList();
                    foreach (var attribute in attributeList)
                    {
                        string attributeValue = groupMember.GetAttributeValue(attribute.Key);
                        attribute.AddControl(pnlWell.Controls, attributeValue, "", true, true);
                    }

                    RockTextBox tbNotes = new RockTextBox();
                    tbNotes.TextMode = TextBoxMode.MultiLine;
                    tbNotes.ID       = "Note" + groupMember.Id.ToString();
                    tbNotes.Label    = "Notes";
                    tbNotes.Text     = groupMember.Note;
                    pnlWell.Controls.Add(tbNotes);

                    if (savedGroupMemberId == groupMember.Id)
                    {
                        NotificationBox nbSavedNote = new NotificationBox();
                        nbSavedNote.Text = "Group member information saved";
                        nbSavedNote.NotificationBoxType = NotificationBoxType.Success;
                        pnlWell.Controls.Add(nbSavedNote);
                    }

                    BootstrapButton btnSave = new BootstrapButton();
                    btnSave.ID       = "save" + groupMember.Id.ToString();
                    btnSave.Text     = "Save";
                    btnSave.CssClass = "btn btn-primary btn-xs";
                    btnSave.Click   += (s, e) => { SaveGroupMember(rockContext, groupMember, pnlWell, attributeList, tbNotes); };
                    pnlWell.Controls.Add(btnSave);
                }
            }

            HtmlGenericContainer hrDone = new HtmlGenericContainer("hr");

            phGroups.Controls.Add(hrDone);

            BootstrapButton btnDone = new BootstrapButton();

            btnDone.Text   = "Done";
            btnDone.ID     = "btnDone";
            btnDone.Click += (s, e) =>
            {
                hfEditMode.Value = "0";
                ShowView();
            };
            phGroups.Controls.Add(btnDone);
        }
Exemplo n.º 14
0
 public void creditsButton()
 {
     NotificationBox.drawNotificationBox(canvas.transform, "Coming soon :)");
 }
 private void ShowBlockSuccess(NotificationBox notificationControl, string message)
 {
     ShowBlockNotification(notificationControl, message, NotificationBoxType.Success);
 }
Exemplo n.º 16
0
 public void OnApplyButton()
 {
     applyChanges();
     NotificationBox.drawNotificationBox(canvasTranform, "Settings have been applied");
 }
Exemplo n.º 17
0
        private void GridPaymentOnUserHitCell(object sender, MouseEventArgs e, int rowIndex, FastColumn col)
        {
            var gridPayment = sender as FastGrid.FastGrid;

            if (gridPayment == null)
            {
                return;
            }
            if (e.Button != MouseButtons.Left)
            {
                return;
            }
            var transfer = (Transfer)gridPayment.rows[rowIndex].ValueObject;

            // показать подсказку по платежу - перевод на счет, платеж за услугу...
            // if (col.PropertyName == "Comment")
            if (col.PropertyName == transfer.Property(t => t.Comment))
            {
                // подписка?
                if (transfer.Subscription.HasValue)
                {
                    new ServiceDetailForm(transfer.Subscription.Value).ShowDialog();
                    return;
                }
                // перевод на торг. счет?
                // платеж в пользу кошелька?
                if (transfer.BalanceChange.HasValue || transfer.RefWallet.HasValue)
                {
                    BalanceChange bc = null;
                    PlatformUser  us = null;
                    try
                    {
                        TradeSharpWalletManager.Instance.proxy.GetTransferExtendedInfo(
                            CurrentProtectedContext.Instance.MakeProtectedContext(), transfer.Id, out bc, out us);
                    }
                    catch (Exception ex)
                    {
                        Logger.Error("GetTransferExtendedInfo()", ex);
                    }
                    if (bc == null && us == null)
                    {
                        return;
                    }
                    if (UserSettings.Instance.GetAccountEventAction(AccountEventCode.WalletModified) == AccountEventAction.DoNothing)
                    {
                        return;
                    }

                    var text = bc != null
                        ? string.Format("{0} счета {1}, {2} {3}",
                                        BalanceChange.GetSign(bc.ChangeType) > 0? "Пополнение" : "Списание со",
                                        bc.AccountID,
                                        bc.AmountDepo.ToStringUniformMoneyFormat(),
                                        walletCurrency /*bc.Currency*/)
                        : string.Format("Платеж на кошелек пользователя, {0}", us.MakeFullName());

                    bool repeatNotification;
                    NotificationBox.Show(text, "Операция выполнена", out repeatNotification);

                    if (!repeatNotification)
                    {
                        UserSettings.Instance.SwitchAccountEventAction(AccountEventCode.WalletModified);
                        UserSettings.Instance.SaveSettings();
                    }
                }
            }
        }
Exemplo n.º 18
0
 public NotificationBox CreateNotificationBox(NotificationBox NotificationBox)
 {
     _Context.NotificationBox.Add(NotificationBox);
     _Context.SaveChanges();
     return(NotificationBox);
 }