コード例 #1
0
 private void SeutpShadows()
 {
     InfoButton.AddShadow();
     OrdersButton.AddShadow();
     FavoritesButton.AddShadow();
     SecurityButton.AddShadow();
 }
コード例 #2
0
ファイル: CDR_Page.xaml.cs プロジェクト: CH-Aric/CRMDesktop
        public void populateResults(string result)
        {
            this.PurgeCells();
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result), true);

            if (dictionary.Count > 1)
            {
                for (int i = 0; i < dictionary["uniqueid"].Count; i++)
                {
                    string         text       = dictionary["calldate"][i] + " : " + FormatFunctions.PrettyPhone(dictionary["cnam"][i]);
                    SecurityButton dataButton = new SecurityButton(int.Parse(Regex.Replace(dictionary["uniqueid"][i], "^[^.]+.", "")), new string[] { "Manager" })
                    {
                        Content = text
                    };
                    dataButton.Click  += onClicked;
                    dataButton.String  = dictionary["calldate"][i];
                    dataButton.String2 = dictionary["recordingfile"][i];
                    List <UIElement> list = new List <UIElement>
                    {
                        dataButton
                    };
                    GridFiller.rapidFillPremadeObjects(list, TSection, new bool[] { true });
                }
            }
        }
コード例 #3
0
        public void populateList(string result)
        {
            Dictionary <string, List <string> > dictionary  = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));
            Dictionary <string, SecurityButton> dictionary2 = new Dictionary <string, SecurityButton>();

            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["Name"].Count; i++)
                {
                    if (!dictionary2.ContainsKey(dictionary["IDKey"][i]))
                    {
                        string         text       = FormatFunctions.PrettyDate(dictionary["Name"][i]) + " ," + FormatFunctions.PrettyDate(dictionary["Value"][i]);
                        SecurityButton dataButton = new SecurityButton(int.Parse(dictionary["IDKey"][i]), new string[] { "Employee" })
                        {
                            Content = text,
                            Width   = ClientData.sideFrame.Width * 0.925
                        };
                        dataButton.Click   += this.onClicked;
                        dataButton.Integer2 = int.Parse(dictionary["Stage"][i]);
                        List <UIElement> list = new List <UIElement>()
                        {
                            dataButton
                        };
                        bool[] box = new bool[] { false };
                        GridFiller.rapidFillPremadeObjectsStandardHeight(list, dataGrid, box, 25);
                        dictionary2.Add(dictionary["IDKey"][i], dataButton);
                    }
                    else
                    {
                        SecurityButton dataButton2 = dictionary2[dictionary["IDKey"][i]];
                        dataButton2.Content = dataButton2.Content + " ," + dictionary["Value"][i];
                    }
                }
            }
        }
コード例 #4
0
        public void onClicked(object sender, EventArgs e)
        {
            SecurityButton dataButton = (SecurityButton)sender;
            TaskEdit_Page  page       = new TaskEdit_Page(dataButton.Integer);

            ClientData.mainFrame.Navigate(page);
        }
コード例 #5
0
        public void onClicked(object sender, RoutedEventArgs e)
        {
            SecurityButton dataButton = (SecurityButton)sender;
            Evolving_Page  page       = new Evolving_Page(dataButton.Integer);

            ClientData.mainFrame.Navigate(page);
        }
コード例 #6
0
ファイル: CDR_Page.xaml.cs プロジェクト: CH-Aric/CRM-Mobile
 public async void onClicked(object sender, EventArgs e)
 {
     SecurityButton dataButton = (SecurityButton)sender;
     TaskCallback   call       = new TaskCallback(this.openFile);
     string         loadedfile = DatabaseFunctions.getCallFile(dataButton.String, dataButton.String2, call);
     await PopupNavigation.Instance.PushAsync(new Audio_Popup(loadedfile), true);
 }
コード例 #7
0
ファイル: CDR_Page.xaml.cs プロジェクト: CH-Aric/CRM-Mobile
        public void populateResults(string result)
        {
            this.PurgeCells();
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result), true);

            if (dictionary.Count > 1)
            {
                for (int i = 0; i < dictionary["uniqueid"].Count; i++)
                {
                    string         text       = dictionary["calldate"][i] + " : " + FormatFunctions.PrettyPhone(dictionary["cnam"][i]);
                    SecurityButton dataButton = new SecurityButton(int.Parse(Regex.Replace(dictionary["uniqueid"][i], "^[^.]+.", "")), new string[] { "Manager" })
                    {
                        Text              = text,
                        FontSize          = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                        VerticalOptions   = LayoutOptions.CenterAndExpand,
                        HorizontalOptions = LayoutOptions.EndAndExpand
                    };
                    dataButton.Clicked += onClicked;
                    dataButton.String   = dictionary["calldate"][i];
                    dataButton.String2  = dictionary["recordingfile"][i];
                    List <View> list = new List <View>
                    {
                        dataButton
                    };
                    GridFiller.rapidFillPremadeObjects(list, TSection, new bool[] { true });
                }
            }
        }
コード例 #8
0
        public void populateList(string result)
        {
            //DatabaseFunctions.SendToDebug("Beginning populating daily tasks");
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 1)
            {
                for (int i = 0; i < dictionary["Name"].Count; i++)
                {
                    string         text       = dictionary["Name"][i] ?? "";
                    SecurityButton dataButton = new SecurityButton(int.Parse(dictionary["IDKey"][i]), new string[] { "Employee" })
                    {
                        Text              = text,
                        FontSize          = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                        VerticalOptions   = LayoutOptions.CenterAndExpand,
                        HorizontalOptions = LayoutOptions.FillAndExpand
                    };
                    dataButton.Clicked += this.onClicked;
                    List <View> list = new List <View>();
                    list.Add(dataButton);
                    GridFiller.rapidFillPremadeObjects(list, tasksList, new bool[] { true, true });
                }
            }
            //DatabaseFunctions.SendToDebug("Finsihed populating daily tasks");
        }
コード例 #9
0
        public void onClicked(object sender, EventArgs e)
        {
            SecurityButton dataButton = (SecurityButton)sender;

            App.MDP.Detail.Navigation.PushAsync(new TaskEdit_Page(dataButton.Integer));
            App.MDP.IsPresented = false;
        }
コード例 #10
0
        public void onClicked(object sender, EventArgs e)
        {
            SecurityButton db  = (SecurityButton)sender;
            string         sql = "UPDATE jobindex SET Stage='" + db.GetInt() + "' WHERE IDKey='" + customer + "'";

            DatabaseFunctions.SendToPhp(sql);
            if (db.GetInt() == 4)
            {
                string sql2 = "UPDATE jobfields SET jobfields.Index='INVOICEFIELD' WHERE jobfields.Index='QUOTEFIELD' AND CusID='" + customer + "' AND TaskID='" + QuotePicker.SelectedIndex + "'";
                DatabaseFunctions.SendToPhp(sql2);
            }
            onCreateStageSpecificData(customer, db.GetInt());
        }
コード例 #11
0
        public void OpenPage(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));
            string sqlj = "INSERT INTO jobindex (Stage,CusID) VALUES ('" + (NewPicker.SelectedIndex + 1) + "','" + dictionary["IDKey"][0] + "')";
            string sqlf = "INSERT INTO cusfields (CusID,cusfields.Index,cusfields.Value) VALUES ('" + dictionary["IDKey"][0] + "','Phone',''),('" + dictionary["IDKey"][0] + "','Address',''),('" + dictionary["IDKey"][0] + "','Email',''),('" + dictionary["IDKey"][0] + "','Created On',''),('" + dictionary["IDKey"][0] + "','Region','Ottawa'),('" + dictionary["IDKey"][0] + "','Notes',''),('" + dictionary["IDKey"][0] + "','Modified On',''),('" + dictionary["IDKey"][0] + "','Source',''),('" + dictionary["IDKey"][0] + "','Last Contact','2020/03/01 00<00<00')";

            DatabaseFunctions.SendToPhp(sqlj);
            DatabaseFunctions.SendToPhp(sqlf);
            SecurityButton x = new SecurityButton(int.Parse(dictionary["IDKey"][0]), new string[] { "Employee" })
            {
                Integer2 = int.Parse(dictionary["Stage"][0])
            };
            RoutedEventArgs y = new RoutedEventArgs();

            onClicked(x, y);
        }
コード例 #12
0
 public void populateFileList()
 {
     string[] customerFileList = DatabaseFunctions.getCustomerFileList(nameLabel.Text);
     foreach (string text in customerFileList)
     {
         if ((text != "." || text != "..") && customerFileList.Length > 1)
         {
             SecurityButton dataButton = new SecurityButton(nameLabel.Text + "/" + text, new string[] { "Employee" })
             {
                 Content = text
             };
             dataButton.Click += onFileButton;
             StackPanel stackLayout = new StackPanel();
             stackLayout.Children.Add(dataButton);
             TSection.Children.Add(stackLayout);
         }
     }
 }
コード例 #13
0
 public void populateFileList()
 {
     string[] customerFileList = DatabaseFunctions.getCustomerFileList(this.NameDisplay.Content.ToString());
     foreach (string text in customerFileList)
     {
         if ((text != "." || text != "..") && customerFileList.Length > 1)
         {
             SecurityButton dataButton = new SecurityButton(this.NameDisplay.Content + "/" + text, new string[] { "Employee" })
             {
                 Content = text
             };
             dataButton.Click += this.onFileButton;
             GridFiller.rapidFillPremadeObjects(new List <UIElement>()
             {
                 dataButton
             }, mainGrid, new bool[] { false });
         }
     }
 }
コード例 #14
0
 public void populateList(string result)
 {
     string[] input = FormatFunctions.SplitToPairs(result);
     this.dict  = FormatFunctions.createValuePairs(input);
     this.views = new List <ViewCell>();
     if (this.dict.Count > 1)
     {
         this.buttonDict = new Dictionary <string, SecurityButton>();
         this.switchDict = new List <DataSwitch>();
         for (int i = 0; i < this.dict["Name"].Count; i++)
         {
             if (!this.buttonDict.ContainsKey(this.dict["IDKey"][i]))
             {
                 string         text       = this.dict["Name"][i] ?? "";
                 SecurityButton dataButton = new SecurityButton(int.Parse(this.dict["IDKey"][i]), new string[] { "Employee" })
                 {
                     Text              = text,
                     FontSize          = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                     VerticalOptions   = LayoutOptions.CenterAndExpand,
                     HorizontalOptions = LayoutOptions.FillAndExpand
                 };
                 DataSwitch item = new DataSwitch(int.Parse(this.dict["IDKey"][i]))
                 {
                     VerticalOptions   = LayoutOptions.CenterAndExpand,
                     HorizontalOptions = LayoutOptions.StartAndExpand
                 };
                 dataButton.Clicked += this.onClicked;
                 buttonDict.Add(this.dict["IDKey"][i], dataButton);
                 switchDict.Add(item);
                 List <View> list = new List <View>();
                 list.Add(dataButton);
                 list.Add(item);
                 GridFiller.rapidFillPremadeObjects(list, TSection, new bool[] { true, true });
             }
             else
             {
                 SecurityButton dataButton2 = buttonDict[dict["IDKey"][i]];
                 dataButton2.Text = dataButton2.Text + ", " + dict["Value"][i];
             }
         }
     }
 }
コード例 #15
0
 public void populateFileList()
 {
     string[] customerFileList = DatabaseFunctions.getCustomerFileList(nameLabel.Text);
     foreach (string text in customerFileList)
     {
         if ((text != "." || text != "..") && customerFileList.Length > 1)
         {
             SecurityButton dataButton = new SecurityButton(nameLabel.Text + "/" + text, new string[] { "Sales" })
             {
                 Content = text
             };
             dataButton.Click += onFileButton;
             List <UIElement> list = new List <UIElement>()
             {
                 dataButton
             };
             GridFiller.rapidFillPremadeObjects(list, fileGrid, new bool[] { true, true });
         }
     }
 }
コード例 #16
0
 public void populateFileList()
 {
     string[] customerFileList = DatabaseFunctions.getCustomerFileList(this.NameDisplay.Text);
     foreach (string text in customerFileList)
     {
         if ((text != "." || text != "..") && customerFileList.Length > 1)
         {
             SecurityButton dataButton = new SecurityButton(this.NameDisplay.Text + "/" + text, new string[] { "Employee" })
             {
                 Text              = text,
                 FontSize          = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                 VerticalOptions   = LayoutOptions.CenterAndExpand,
                 HorizontalOptions = LayoutOptions.CenterAndExpand
             };
             dataButton.Clicked += this.onFileButton;
             GridFiller.rapidFillPremadeObjects(new List <View>()
             {
                 dataButton
             }, mainGrid, new bool[] { false });
         }
     }
 }
コード例 #17
0
        public void populateList(string result)
        {
            Dictionary <string, List <string> > dictionary  = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));
            Dictionary <string, SecurityButton> dictionary2 = new Dictionary <string, SecurityButton>();

            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["Name"].Count; i++)
                {
                    if (!dictionary2.ContainsKey(dictionary["IDKey"][i]))
                    {
                        string         text       = dictionary["Name"][i] + " ," + dictionary["Value"][i];
                        SecurityButton dataButton = new SecurityButton(int.Parse(dictionary["IDKey"][i]), new string[] { "Employee" })
                        {
                            Text              = text,
                            FontSize          = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                            VerticalOptions   = LayoutOptions.CenterAndExpand,
                            HorizontalOptions = LayoutOptions.FillAndExpand
                        };
                        dataButton.Clicked += this.onClicked;
                        dataButton.Integer2 = int.Parse(dictionary["Stage"][i]);
                        List <View> list = new List <View>()
                        {
                            dataButton
                        };
                        bool[] box = new bool[] { false };
                        GridFiller.rapidFillPremadeObjectsStandardHeight(list, dataGrid, box, 50);
                        dictionary2.Add(dictionary["IDKey"][i], dataButton);
                    }
                    else
                    {
                        SecurityButton dataButton2 = dictionary2[dictionary["IDKey"][i]];
                        dataButton2.Text = dataButton2.Text + " ," + dictionary["Value"][i];
                    }
                }
            }
        }
コード例 #18
0
 public void populateList(string result)
 {
     string[] input = FormatFunctions.SplitToPairs(result);
     this.dict = FormatFunctions.createValuePairs(input);
     if (this.dict.Count > 1)
     {
         this.buttonDict = new Dictionary <string, SecurityButton>();
         this.switchDict = new List <DataSwitch>();
         for (int i = 0; i < this.dict["Name"].Count; i++)
         {
             if (!this.buttonDict.ContainsKey(this.dict["IDKey"][i]))
             {
                 string         text       = this.dict["Name"][i] ?? "";
                 SecurityButton dataButton = new SecurityButton(int.Parse(this.dict["IDKey"][i]), new string[] { "Employee" })
                 {
                     Content = text,
                 };
                 DataSwitch item = new DataSwitch(int.Parse(this.dict["IDKey"][i]))
                 {
                 };
                 dataButton.Click += this.onClicked;
                 buttonDict.Add(this.dict["IDKey"][i], dataButton);
                 switchDict.Add(item);
                 List <UIElement> list = new List <UIElement>();
                 list.Add(dataButton);
                 list.Add(item);
                 GridFiller.rapidFillPremadeObjects(list, TSection, new bool[] { true, true });
             }
             else
             {
                 SecurityButton dataButton2 = buttonDict[dict["IDKey"][i]];
                 dataButton2.Content = dataButton2.Content + ", " + dict["Value"][i];
             }
         }
     }
 }
コード例 #19
0
        public void populateAssessment(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));
            List <UIElement> list = new List <UIElement>();
            int Stage             = int.Parse(dictionary["Stage"][0]);

            if (Stage < 2)
            {
                SecurityButton l = new SecurityButton(2, new string[] { "Employee" })
                {
                    Content = "Booking"
                };
                l.Click += onClicked;
                Buttons.Add(l);
                list.Add(l);
            }
            if (Stage < 3)
            {
                SecurityButton l = new SecurityButton(3, new string[] { "Employee" })
                {
                    Content = "Quote"
                };
                l.Click += onClicked;
                Buttons.Add(l);
                list.Add(l);
            }
            if (Stage < 4)
            {
                SecurityButton l = new SecurityButton(4, new string[] { "Employee" })
                {
                    Content = "Sale"
                };
                l.Click += onClicked;
                Buttons.Add(l);
                list.Add(l);
                List <string> options = new List <string>()
                {
                    "1", "2", "3", "4", "5"
                };
                QuotePicker.ItemsSource = options;
            }
            if (Stage < 5)
            {
                SecurityButton l = new SecurityButton(5, new string[] { "Employee" })
                {
                    Content = "Install"
                };
                l.Click += onClicked;
                Buttons.Add(l);
                list.Add(l);
            }
            if (Stage < 6)
            {
                SecurityButton l = new SecurityButton(6, new string[] { "Employee" })
                {
                    Content = "Installing"
                };
                l.Click += onClicked;
                Buttons.Add(l);
                list.Add(l);
            }
            if (Stage < 7)
            {
                SecurityButton l = new SecurityButton(7, new string[] { "Employee" })
                {
                    Content = "Quality Assurance"
                };
                l.Click += onClicked;
                Buttons.Add(l);
                list.Add(l);
            }
            if (Stage < 8)
            {
                SecurityButton l = new SecurityButton(8, new string[] { "Employee" })
                {
                    Content = "Clients"
                };
                l.Click += onClicked;
                Buttons.Add(l);
                list.Add(l);
            }
            if (Stage < 9)
            {
                SecurityButton l = new SecurityButton(9, new string[] { "Employee" })
                {
                    Content = "Archive"
                };
                l.Click += onClicked;
                Buttons.Add(l);
                list.Add(l);
            }
            if (Stage < 10)
            {
                SecurityButton l = new SecurityButton(10, new string[] { "Employee" })
                {
                    Content = "Service Lead"
                };
                l.Click += onClicked;
                Buttons.Add(l);
                list.Add(l);
            }
            if (Stage < 11)
            {
                SecurityButton l = new SecurityButton(11, new string[] { "Employee" })
                {
                    Content = "Service Appointment"
                };
                l.Click += onClicked;
                Buttons.Add(l);
                list.Add(l);
            }
            if (Stage < 12)
            {
                SecurityButton l = new SecurityButton(12, new string[] { "Employee" })
                {
                    Content = "Serviced"
                };
                l.Click += onClicked;
                Buttons.Add(l);
                list.Add(l);
            }
            if (Stage < 13)
            {
                SecurityButton l = new SecurityButton(13, new string[] { "Employee" })
                {
                    Content = "Maintenance Appointment"
                };
                l.Click += onClicked;
                Buttons.Add(l);
                list.Add(l);
            }
            if (Stage < 14)
            {
                SecurityButton l = new SecurityButton(14, new string[] { "Employee" })
                {
                    Content = "Maintenance"
                };
                l.Click += onClicked;
                Buttons.Add(l);
                list.Add(l);
            }
            bool[] b = new bool[list.Count];
            GridFiller.rapidVertFillPremadeObjects(list, grid, b);
        }
コード例 #20
0
        /// <summary>
        /// Adds the admin controls.
        /// </summary>
        /// <param name="block">The block.</param>
        /// <param name="pnlLayoutItem">The PNL layout item.</param>
        private void AddAdminControls(BlockCache block, PlaceHolder pnlLayoutItem)
        {
            Panel pnlAdminButtons = new Panel {
                ID = "pnlBlockConfigButtons", CssClass = "pull-right actions"
            };

            // Block Properties
            var btnBlockProperties = new Literal
            {
                Text = string.Format(@"<a title='Block Properties' class='btn btn-sm btn-default btn-square properties' href='javascript: Rock.controls.modal.show($(this), ""/BlockProperties/{0}?t=Block Properties"")' height='500px'><i class='fa fa-cog'></i></a>", block.Id)
            };

            pnlAdminButtons.Controls.Add(btnBlockProperties);

            // Block Security
            int entityTypeBlockId = EntityTypeCache.Get <Rock.Model.Block>().Id;
            var btnBlockSecurity  = new SecurityButton
            {
                ID           = "btnBlockSecurity",
                EntityTypeId = entityTypeBlockId,
                EntityId     = block.Id,
                Title        = "Edit Security"
            };

            btnBlockSecurity.AddCssClass("btn btn-sm btn-square btn-security");
            pnlAdminButtons.Controls.Add(btnBlockSecurity);

            // Delete Block
            LinkButton btnDeleteBlock = new LinkButton
            {
                ID              = string.Format("btnDeleteBlock_{0}", block.Id),
                CommandName     = "Delete",
                CommandArgument = block.Id.ToString(),
                CssClass        = "btn btn-sm btn-square btn-danger",
                Text            = "<i class='fa fa-times'></i>",
                ToolTip         = "Delete Block"
            };

            btnDeleteBlock.Attributes["onclick"] = string.Format("javascript: return Rock.dialogs.confirmDelete(event, '{0}');", Block.FriendlyTypeName);

            pnlAdminButtons.Controls.Add(btnDeleteBlock);

            pnlLayoutItem.Controls.Add(pnlAdminButtons);

            RockBlock blockControl = null;
            IEnumerable <WebControl> customAdminControls = new List <WebControl>();

            try
            {
                if (!string.IsNullOrWhiteSpace(block.BlockType.Path))
                {
                    blockControl = TemplateControl.LoadControl(block.BlockType.Path) as RockBlock;
                }
                else if (block.BlockType.EntityTypeId.HasValue)
                {
                    var blockEntity = Activator.CreateInstance(block.BlockType.EntityType.GetEntityType());

                    var wrapper = new RockBlockTypeWrapper
                    {
                        Page  = RockPage,
                        Block = (Rock.Blocks.IRockBlockType)blockEntity
                    };

                    wrapper.InitializeAsUserControl(RockPage);
                    wrapper.AppRelativeTemplateSourceDirectory = "~";

                    blockControl = wrapper;
                }

                blockControl.SetBlock(block.Page, block, true, true);
                var      adminControls           = blockControl.GetAdministrateControls(true, true);
                string[] baseAdminControlClasses = new string[4] {
                    "properties", "security", "block-move", "block-delete"
                };
                customAdminControls = adminControls.OfType <WebControl>().Where(a => !baseAdminControlClasses.Any(b => a.CssClass.Contains(b)));
            }
            catch (Exception ex)
            {
                // if the block doesn't compile, just ignore it since we are just trying to get the admin controls
                Literal lblBlockError = new Literal();
                lblBlockError.Text = string.Format("<span class='label label-danger'>ERROR: {0}</span>", ex.Message);
                pnlLayoutItem.Controls.Add(lblBlockError);
            }

            foreach (var customAdminControl in customAdminControls)
            {
                if (customAdminControl is LinkButton)
                {
                    LinkButton btn = customAdminControl as LinkButton;
                    if (btn != null)
                    {
                        // ensure custom link button looks like a button
                        btn.AddCssClass("btn");
                        btn.AddCssClass("btn-sm");
                        btn.AddCssClass("btn-default");
                        btn.AddCssClass("btn-square");

                        // some admincontrols will toggle the BlockConfig bar, but this isn't a block config bar, so remove the javascript
                        if (btn.Attributes["onclick"] != null)
                        {
                            btn.Attributes["onclick"] = btn.Attributes["onclick"].Replace("Rock.admin.pageAdmin.showBlockConfig()", string.Empty);
                        }
                    }
                }

                pnlLayoutItem.Controls.Add(customAdminControl);
            }

            if (customAdminControls.Any() && blockControl != null)
            {
                pnlBlocksHolder.Controls.Add(blockControl);
            }
        }
コード例 #21
0
        public void onFileButton(object sender, EventArgs e)
        {
            SecurityButton sb = (SecurityButton)sender;

            App.MDP.Detail.Navigation.PushAsync(new FileDisplay(sb.Text, customer));
        }
コード例 #22
0
        /// <summary>
        /// Adds the admin controls.
        /// </summary>
        /// <param name="block">The block.</param>
        /// <param name="pnlLayoutItem">The PNL layout item.</param>
        private void AddAdminControls(BlockCache block, Panel pnlLayoutItem)
        {
            Panel pnlAdminButtons = new Panel {
                ID = "pnlBlockConfigButtons", CssClass = "pull-right actions"
            };

            // Block Properties
            Literal btnBlockProperties = new Literal();

            btnBlockProperties.Text = string.Format(@"<a title='Block Properties' class='btn btn-sm btn-default properties' id='aBlockProperties' href='javascript: Rock.controls.modal.show($(this), ""/BlockProperties/{0}?t=Block Properties"")' height='500px'><i class='fa fa-cog'></i></a>", block.Id);
            pnlAdminButtons.Controls.Add(btnBlockProperties);

            // Block Security
            int            entityTypeBlockId = EntityTypeCache.Read <Rock.Model.Block>().Id;
            SecurityButton btnBlockSecurity  = new SecurityButton {
                ID = "btnBlockSecurity", EntityTypeId = entityTypeBlockId, EntityId = block.Id, Title = block.Name
            };

            btnBlockSecurity.AddCssClass("btn btn-sm btn-security");
            pnlAdminButtons.Controls.Add(btnBlockSecurity);

            // Move Block
            LinkButton btnMoveBlock = new LinkButton();

            btnMoveBlock.ID              = string.Format("btnMoveBlock_{0}", block.Id);
            btnMoveBlock.CommandName     = "BlockId";
            btnMoveBlock.CommandArgument = block.Id.ToString();
            btnMoveBlock.CssClass        = "btn btn-sm btn-default fa fa-external-link";
            btnMoveBlock.ToolTip         = "Move Block";
            btnMoveBlock.Click          += btnMoveBlock_Click;
            pnlAdminButtons.Controls.Add(btnMoveBlock);

            // Delete Block
            LinkButton btnDeleteBlock = new LinkButton();

            btnDeleteBlock.ID                    = string.Format("btnDeleteBlock_{0}", block.Id);
            btnDeleteBlock.CommandName           = "BlockId";
            btnDeleteBlock.CommandArgument       = block.Id.ToString();
            btnDeleteBlock.CssClass              = "btn btn-xs btn-danger";
            btnDeleteBlock.Text                  = "<i class='fa fa-times'></i>";
            btnDeleteBlock.ToolTip               = "Delete Block";
            btnDeleteBlock.Click                += btnDeleteBlock_Click;
            btnDeleteBlock.Attributes["onclick"] = string.Format("javascript: return Rock.dialogs.confirmDelete(event, '{0}');", Block.FriendlyTypeName);

            pnlAdminButtons.Controls.Add(btnDeleteBlock);

            pnlLayoutItem.Controls.Add(pnlAdminButtons);

            RockBlock blockControl = null;
            IEnumerable <WebControl> customAdminControls = new List <WebControl>();

            try
            {
                blockControl = this.Page.TemplateControl.LoadControl(block.BlockType.Path) as RockBlock;
                blockControl.SetBlock(block.Page, block, true, true);
                var      adminControls           = blockControl.GetAdministrateControls(true, true);
                string[] baseAdminControlClasses = new string[4] {
                    "properties", "security", "block-move", "block-delete"
                };
                customAdminControls = adminControls.OfType <WebControl>().Where(a => !baseAdminControlClasses.Any(b => a.CssClass.Contains(b)));
            }
            catch (Exception ex)
            {
                // if the block doesn't compile, just ignore it since we are just trying to get the admin controls
                Literal lblBlockError = new Literal();
                lblBlockError.Text = string.Format("<span class='label label-danger'>ERROR: {0}</span>", ex.Message);
                pnlLayoutItem.Controls.Add(lblBlockError);
            }

            foreach (var customAdminControl in customAdminControls)
            {
                if (customAdminControl is LinkButton)
                {
                    LinkButton btn = customAdminControl as LinkButton;
                    if (btn != null)
                    {
                        // ensure custom link button looks like a button
                        btn.AddCssClass("btn");
                        btn.AddCssClass("btn-sm");
                        btn.AddCssClass("btn-default");

                        // some admincontrols will toggle the BlockConfig bar, but this isn't a block config bar, so remove the javascript
                        if (btn.Attributes["onclick"] != null)
                        {
                            btn.Attributes["onclick"] = btn.Attributes["onclick"].Replace("Rock.admin.pageAdmin.showBlockConfig()", string.Empty);
                        }
                    }
                }

                pnlLayoutItem.Controls.Add(customAdminControl);
            }

            if (customAdminControls.Any() && blockControl != null)
            {
                pnlBlocksHolder.Controls.Add(blockControl);
            }
        }
コード例 #23
0
        public void populateAssessment(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));
            ViewCell vc = new ViewCell();

            StackLayout sl = new StackLayout()
            {
                Orientation = StackOrientation.Vertical
            };
            int Stage = int.Parse(dictionary["Stage"][0]);

            if (Stage < 2)
            {
                SecurityButton l = new SecurityButton(2, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Booking"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            if (Stage < 3)
            {
                SecurityButton l = new SecurityButton(3, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Quote"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            if (Stage < 4)
            {
                SecurityButton l = new SecurityButton(4, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Sale"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
                List <string> options = new List <string>()
                {
                    "1", "2", "3", "4", "5"
                };
                QuotePicker.ItemsSource = options;
            }
            if (Stage < 5)
            {
                SecurityButton l = new SecurityButton(5, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Install"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            if (Stage < 6)
            {
                SecurityButton l = new SecurityButton(6, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Installing"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            if (Stage < 7)
            {
                SecurityButton l = new SecurityButton(7, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Quality Assurance"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            if (Stage < 8)
            {
                SecurityButton l = new SecurityButton(8, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Clients"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            if (Stage < 9)
            {
                SecurityButton l = new SecurityButton(9, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Archive"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            vc.View = sl;
            TSection.Add(vc);
        }
コード例 #24
0
ファイル: CDR_Page.xaml.cs プロジェクト: CH-Aric/CRMDesktop
 public async void onClicked(object sender, RoutedEventArgs e)
 {
     SecurityButton dataButton = (SecurityButton)sender;
     TaskCallback   call       = new TaskCallback(this.openFile);
     string         loadedfile = DatabaseFunctions.getFile(dataButton.String, dataButton.String2, call);
 }