Example #1
0
        private void btnNewCustomer_MouseDown(object sender, EventArgs e)
        {
            entity.Brillo.Security Sec = new entity.Brillo.Security(entity.App.Names.Contact);

            if (Sec.create)
            {
                popCrud.IsOpen     = true;
                popCrud.Visibility = Visibility.Visible;

                //Add CRUD Panel into View.
                cntrl.Curd.contact ContactCURD = new cntrl.Curd.contact();
                ContactCURD.IsCustomer = true;
                stackCustomer.Children.Add(ContactCURD);
            }
        }
Example #2
0
        public cntrl.applicationIcon get_AppIcon(DataRow app)
        {
            string _namespace   = app["namespace"].ToString();
            string _app         = app["app"].ToString();
            string _name        = app["name"].ToString();
            string _img         = app["img"].ToString();
            string _description = "desc_" + app["name"].ToString();
            string _HasReport   = app["HasReport"].ToString();

            cntrl.applicationIcon appIcon = new cntrl.applicationIcon();

            //Checks if App has Inbuilt Report to show ReportIcon. This Helps save space.
            appIcon.HasReport = _HasReport == "1" ? true : false;

            ///AssemblyCheck. If reporting exists, don't add Cognitivo.
            appIcon.Tag = "Cognitivo." + _app;
            appIcon.Uid = _name;
            ///Security Check.
            try
            {
                entity.Brillo.Security security = new entity.Brillo.Security((entity.App.Names)Enum.Parse(typeof(entity.App.Names), _name, true));
                if (security.view == false)
                {
                    appIcon.IsEnabled = false;
                }
            }
            catch
            {
                appIcon.IsEnabled = false;
            }

            var appLocApplicationName = new LocTextExtension("Cognitivo:local:" + _name + "").SetBinding(appIcon, cntrl.applicationIcon.ApplicationNameProperty);

            //Incase img is not set, set it to DefaultIcon
            if (_img == "")
            {
                _img = "DefaultIcon";
            }

            _img = "../Images/Application/128/" + _img + ".png";
            appIcon.imgSource = new BitmapImage(new Uri(_img, UriKind.Relative));

            return(appIcon);
        }