private void openContactCRUD(object sender, MouseButtonEventArgs e)
        {
            entity.Brillo.Security Sec = new entity.Brillo.Security(entity.App.Names.Contact);

            if (Sec.create)
            {
                cntrl.Curd.contact contactCURD = new Curd.contact();

                if (Get_Customers)
                {
                    contactCURD.IsCustomer = true;
                }
                else if (Get_Suppliers)
                {
                    contactCURD.IsSupplier = true;
                }
                else if (Get_Employees)
                {
                    contactCURD.IsEmployee = true;
                }

                contactCURD.btnSave_Click += popCrud_Closed;

                popCrud.IsOpen = true;
                stackCRUD.Children.Add(contactCURD);
            }
        }
Exemple #2
0
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     if (!DesignerProperties.GetIsInDesignMode(this))
     {
         entity.Brillo.Security security = new entity.Brillo.Security(appName);
         get_Icons(toolBarIcons.Basic.ToString(), ref security);
     }
 }
Exemple #3
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            if (!DesignerProperties.GetIsInDesignMode(this) && HasLoaded == false)
            {
                entity.Brillo.Security security = new entity.Brillo.Security(appName);
                get_Icons(toolBarIcons.Basic.ToString(), ref security);

                ///Loaded prevents the Parent Tab Controls from rendering the code twice.
                ///The enclosing If function checks for this to be True to Skip.
                HasLoaded = true;
            }
        }
Exemple #4
0
        public object Convert(Privilage.Privilages value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            //Privilage.Privilages Privilage = (Privilage.Privilages)value;
            if (value != null)
            {
                entity.Brillo.Security Security = new entity.Brillo.Security(App.Names.SalesInvoice);
                return(Security.SpecialSecurity_ReturnsBoolean(value));
            }

            //If no value found, return true. this way software doesn't stop working.
            return(true);
        }
Exemple #5
0
 private void Add_PreviewMouseUp(object sender, MouseButtonEventArgs e)
 {
     entity.Brillo.Security Sec = new entity.Brillo.Security(entity.App.Names.Items);
     if (Sec.create)
     {
         cntrl.Curd.item item = new Curd.item();
         item.itemobject    = new entity.item();
         popCrud.IsOpen     = true;
         popCrud.Visibility = System.Windows.Visibility.Visible;
         ContactPopUp.Children.Add(item);
     }
 }
Exemple #6
0
        private void get_Icons(string mod_name, ref entity.Brillo.Security security)
        {
            toolBarData t = new toolBarData();

            foreach (DataRow row in t.dtIconList_property.Select("modIcon = '" + mod_name + "'"))
            {
                toolIcon_Mini ico = new toolIcon_Mini();

                string _toolTip            = row["tooltip"].ToString();
                var    appLocTextExtension = new LocTextExtension("COGNITIVO:local:" + _toolTip + "").SetBinding(ico, toolIcon_Mini.icoNameProperty);
                ico.imgSource = row["img"].ToString();
                ico.Cursor    = Cursors.Hand;
                ico.btnColor  = Brushes.AliceBlue;
                ico.iColor    = Brushes.RoyalBlue;
                ico           = check_Icons(ico, _toolTip, ref security);

                if (ico != null && row["placement"].ToString() == "m")
                {
                    if (_toolTip == "Delete")
                    {
                        ico.btnColor = Brushes.Silver;
                        ico.iColor   = Brushes.Black;
                        System.Windows.Shapes.Rectangle rect;
                        rect        = new System.Windows.Shapes.Rectangle();
                        rect.Fill   = new SolidColorBrush(Colors.Gainsboro);
                        rect.Width  = 0.5;
                        rect.Margin = new Thickness(4);
                        stackMain.Children.Add(rect);
                        stackMain.Children.Add(ico);
                    }
                    else
                    {
                        stackMain.Children.Add(ico);
                    }
                }
                else if (ico != null && row["placement"].ToString() == "s")
                { //Then Secondary Stack
                    if (_toolTip == "Annul")
                    {
                        ico.btnColor = Brushes.Pink;
                        ico.iColor   = Brushes.Crimson;
                    }
                    else if (_toolTip == "Approve")
                    {
                        ico.btnColor = Brushes.PaleGreen;
                        ico.iColor   = Brushes.Green;
                    }
                    stackSide.Children.Add(ico);
                }
            }
        }
Exemple #7
0
 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
 {
     // entity.App.Names appname = (entity.App.Names)value;
     entity.Brillo.Security      security   = new entity.Brillo.Security(0);
     entity.Privilage.Privilages Privilages = (entity.Privilage.Privilages)value;
     if (security.SpecialSecurity_ReturnsBoolean(Privilages))
     {
         return(false);
     }
     else
     {
         return(true);
     }
     //throw new NotImplementedException();
 }
Exemple #8
0
 private toolIcon check_Icons(toolIcon toolIcon, string iconName, ref entity.Brillo.Security security)
 {
     //Check if Icon should be shown, bind, and rout events.
     if (btnNew_Click != null & iconName == "New" && security.create)
     {
         toolIcon.Click += btnNew_MouseUp;
     }
     else if (btnDelete_Click != null & iconName == "Delete" && security.delete)
     {
         toolIcon.Click += btnDelete_MouseUp;
         toolIcon        = bind_toolIcon(toolIcon, "Delete_IsEnabled", false);
     }
     else if (btnEdit_Click != null & iconName == "Edit" && security.edit)
     {
         toolIcon.Click += btnEdit_MouseUp;
         toolIcon        = bind_toolIcon(toolIcon, "Edit_IsEnabled", false);
     }
     else if (btnSave_Click != null & iconName == "Save")
     {
         toolIcon.Click += btnSave_MouseUp;
         toolIcon        = bind_toolIcon(toolIcon, "IsEditable", false);
     }
     else if (btnCancel_Click != null & iconName == "Cancel")
     {
         toolIcon.Click += btnCancel_MouseUp;
         toolIcon        = bind_toolIcon(toolIcon, "IsEditable", false);
     }
     else if (btnApprove_Click != null & iconName == "Approve" && security.approve)
     {
         toolIcon.Click += btnApprove_MouseUp;
         toolIcon        = bind_toolIcon(toolIcon, "Approve_IsEnabled", false);
     }
     else if (btnAnull_Click != null & iconName == "Annul" && security.annul)
     {
         toolIcon.Click += btnAnull_MouseUp;
         toolIcon        = bind_toolIcon(toolIcon, "Annul_IsEnabled", false);
     }
     else
     {
         toolIcon.Foreground = Brushes.Gainsboro;
         return(null);
     }
     return(toolIcon);
 }
Exemple #9
0
        private void btnRecivePayment_PreviewMouseUp(object sender, MouseButtonEventArgs e)
        {
            sales_invoice sales_invoice = sales_invoiceDataGrid.SelectedItem as sales_invoice;

            if (sales_invoice != null)
            {
                entity.Brillo.Security Security = new entity.Brillo.Security(entity.App.Names.AccountsReceivable);
                if (Security.create)
                {
                    crud_modal.Visibility = System.Windows.Visibility.Visible;
                    cntrl.Curd.receive_payment recive_payment = new cntrl.Curd.receive_payment();
                    recive_payment.sales_invoice = sales_invoice;
                    crud_modal.Children.Add(recive_payment);
                }
                else
                {
                    toolBar.msgWarning("Access Denied. Please contact your Administrator.");
                }
            }
        }
        private void config_MouseUp(object sender, EventArgs e)
        {
            //Get the clicked Icon.
            TextBlock tbxConfig  = (TextBlock)sender;
            string    configName = tbxConfig.Tag.ToString();

            try
            {
                ///Check existance of Security. If existance is not there, will go into Catch.
                ///If it goes into catch, we will need to update the Tag of the Icon in XAML to be the same as the Enum.

                entity.Brillo.Security security = new entity.Brillo.Security((entity.App.Names)Enum.Parse(typeof(entity.App.Names), configName, true));
                if (security.view == true)
                {
                    //Start Thread to open the Page under same frame.
                    dynamic taskAuth = Task.Factory.StartNew(() => load_Thread(configName));
                }
            }
            catch
            {
                //MessageBox.Show(configName);
                dynamic taskAuth = Task.Factory.StartNew(() => load_Thread(configName));
            }
        }
Exemple #11
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            project_task_dimensionViewSource = ((CollectionViewSource)(FindResource("project_task_dimensionViewSource")));

            project_taskViewSource = ((CollectionViewSource)(FindResource("project_taskViewSource")));
            projectViewSource      = ((CollectionViewSource)(FindResource("projectViewSource")));

            ProjectTaskDB.projects.Where(a => a.is_active == true && a.id_company == CurrentSession.Id_Company).Load();//.Include(x => x.project_task).Load();
            projectViewSource.Source = ProjectTaskDB.projects.Local;

            //Bad Code. Will bring too many items into view.
            ProjectTaskDB.project_task_dimension.Where(a => a.id_company == CurrentSession.Id_Company).Load();
            project_task_dimensionViewSource.Source = ProjectTaskDB.project_task_dimension.Local;

            CollectionViewSource app_dimensionViewSource = ((CollectionViewSource)(FindResource("app_dimensionViewSource")));

            ProjectTaskDB.app_dimension.Where(a => a.id_company == CurrentSession.Id_Company).Load();
            app_dimensionViewSource.Source = ProjectTaskDB.app_dimension.Local;

            CollectionViewSource app_propertyViewSource = ((CollectionViewSource)(FindResource("app_propertyViewSource")));

            ProjectTaskDB.app_property.Load();
            app_propertyViewSource.Source = ProjectTaskDB.app_property.Local;

            CollectionViewSource app_measurementViewSource = ((CollectionViewSource)(FindResource("app_measurementViewSource")));

            ProjectTaskDB.app_measurement.Where(a => a.id_company == CurrentSession.Id_Company).Load();
            app_measurementViewSource.Source = ProjectTaskDB.app_measurement.Local;

            cbxItemType.ItemsSource = Enum.GetValues(typeof(item.item_type));

            //Filter to remove all items that are not top level.
            filter_task();

            entity.Brillo.Security security = new entity.Brillo.Security(entity.App.Names.ActivityPlan);

            if (security.approve)
            {
                btnapprove.IsEnabled = true;
            }
            else
            {
                btnapprove.IsEnabled = false;
            }

            if (security.annul)
            {
                btnanull.IsEnabled = true;
            }
            else
            {
                btnanull.IsEnabled = false;
            }

            if (ToggleQuantity.IsChecked == true)
            {
                stpexcustion.Visibility = System.Windows.Visibility.Visible;
                stpestimate.Visibility  = System.Windows.Visibility.Collapsed;
            }
            else
            {
                stpestimate.Visibility  = System.Windows.Visibility.Visible;
                stpexcustion.Visibility = System.Windows.Visibility.Collapsed;
            }
        }