Ejemplo n.º 1
0
        private void test(object sender, MouseButtonEventArgs e)
        {
            if (sender is TreeViewItem)
            {
                if (!((TreeViewItem)sender).IsSelected)
                {
                    return;
                }
            }
            DependencyObject obj  = e.OriginalSource as DependencyObject;
            TreeViewItem     item = GetDependencyObjectFromVisualTree(obj, typeof(TreeViewItem)) as TreeViewItem;

            if (((item.Header).GetType().Equals(typeof(AssetNode))))
            {
                Int32 ID = ((AssetNode)(item.Header)).ID;

                EquipmentWindow EW = new EquipmentWindow(false, ID);
                EW.Owner = this;
                EW.ShowDialog();

//                ((AssetNode)(item.Header)).Label = "CSE-11-111";
            }
            else
            if (((item.Header).GetType().Equals(typeof(TreeCustomer))))
            {
                MessageBox.Show(((TreeCustomer)(item.Header)).Name.ToString());
            }
        }
Ejemplo n.º 2
0
        private void ButtonAddEquipment_Click(object sender, RoutedEventArgs e)
        {
            this.edit = false;
            EquipmentWindow equipmentWindow = new EquipmentWindow(edit, selRow);

            equipmentWindow.ShowDialog();

            clsEquipos obj_e = new clsEquipos();

            dt_equipos = obj_e.CargarEquipos();

            dt_equipos.Columns[0].ColumnName = "SERIAL NUMBER";
            dt_equipos.Columns[1].ColumnName = "DESCRIPTION";
            dt_equipos.Columns[2].ColumnName = "UNIT";
            dt_equipos.Columns[3].ColumnName = "VALUE";

            EquipmentDataGrid.ItemsSource = dt_equipos.DefaultView;
        }
Ejemplo n.º 3
0
        private void ButtonEditEquipment_Click(object sender, RoutedEventArgs e)
        {
            if (EquipmentDataGrid.SelectedItem != null)
            {
                edit   = true;
                selRow = EquipmentDataGrid.SelectedIndex;
                EquipmentWindow equipmentWindow = new EquipmentWindow(edit, selRow);
                equipmentWindow.ShowDialog();

                clsEquipos obj_e = new clsEquipos();
                dt_equipos = obj_e.CargarEquipos();

                dt_equipos.Columns[0].ColumnName = "SERIAL NUMBER";
                dt_equipos.Columns[1].ColumnName = "DESCRIPTION";
                dt_equipos.Columns[2].ColumnName = "UNIT";
                dt_equipos.Columns[3].ColumnName = "VALUE";

                EquipmentDataGrid.ItemsSource = dt_equipos.DefaultView;
            }
        }
Ejemplo n.º 4
0
        public AdministratorMainWindow()
        {
            InitializeComponent();
            Title += " v" + Settings.version + ". Пользователь " + Auth.getInstance().Full_name + ". Режим администратора.";

            try
            {
                int updateTime = int.Parse(CRMSettingViewModel.instance().getByMashineName("bid_update_time").Setting_value) * 1000;
                if (updateTime != 0)
                {
                    Classes.UpdateTask.Start(Dispatcher,
                                             new Action(() => { BidViewModel.instance().reload(); }),
                                             updateTime,
                                             new Action(() => { updateNotification.Visibility = Visibility.Hidden; }),
                                             new Action(() => { updateNotification.Visibility = Visibility.Visible; }));
                }
            }
            catch {}

            menuOpenEquipmentWindow.Click += delegate
            {
                EquipmentWindow window = new EquipmentWindow();
                window.ShowDialog();
            };

            menuOpenComplectationItemWindow.Click += delegate
            {
                ComplectationItemWindow window = new ComplectationItemWindow();
                window.ShowDialog();
            };

            menuOpenBuyerWindow.Click += delegate
            {
                BuyerWindow window = new BuyerWindow();
                window.ShowDialog();
            };

            menuOpenSellerWindow.Click += delegate
            {
                SellerWindow window = new SellerWindow();
                window.ShowDialog();
            };

            menuOpenBidStatusWindow.Click += delegate
            {
                BidStatusWindow window = new BidStatusWindow();
                window.ShowDialog();
            };

            menuOpenPaymentStatusWindow.Click += delegate
            {
                PaymentStatusWindow window = new PaymentStatusWindow();
                window.ShowDialog();
            };

            menuOpenManagerWindow.Click += delegate
            {
                ManagerWindow window = new ManagerWindow();
                window.ShowDialog();
            };

            menuOpenTransportCompanyWindow.Click += delegate
            {
                TransportCompanyWindow window = new TransportCompanyWindow();
                window.ShowDialog();
            };

            menuOpenMessageTemplatesWindow.Click += delegate
            {
                MessageTemplatesWindow window = new MessageTemplatesWindow();
                window.ShowDialog();
            };

            tiCRMSetting.Content = new MainControlCRMSetting();
            tiBid.Content        = new MainControlBid();
        }