Beispiel #1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            User us = _userController.getOne(MethodsTable.getCellValueRowSelectedIdInt(gridViewUsers));

            if (us.FlagAdmin)
            {
                MessageBox.Show("Este é o usuário administrador, não pode ser apagado..!");
            }
            else if (us.FlagLogado)
            {
                MessageBox.Show("Não pode apagar este usuário porque está logado..!");
            }
            else
            {
                if (_userController.deletar(us) == 0)
                {
                    MethodsTable.messageJaOperou();
                }
                else
                {
                    Methods.playSuccess();
                    updateGrid();
                }
            }
        }
Beispiel #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            int customerID = MethodsTable.getCellValueRowSelectedIdInt(gridView1);

            if (customerID != 1)
            {
                new FrmFornecedorSave(this, customerID).ShowDialog();
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("\"Cunsumidor Funal\" é um cliente Padrão, Não pode ser editado..!");
            }
        }
        private void btnDelete_Click(object sender, EventArgs e)
        {
            Provider provider = _providerController.getOne(MethodsTable.getCellValueRowSelectedIdInt(gridView1));

            if (provider != null && MethodsTable.messageDelete())
            {
                if (_providerController.delete(provider) == 0)
                {
                    MethodsTable.messageJaOperou();
                    _providerController.Dispose();
                    _providerController = new ProviderController();
                }
                else
                {
                    Methods.playSuccess();
                    toGvdProviderControl();
                }
            }
        }
Beispiel #4
0
        public void initialize()
        {
            _stockController    = new StockController();
            _providerController = new ProviderController();
            _storageController  = new StorageController();
            _productEntry       = new ProductEntryController();

            searchLookUpProvider.Properties.DataSource = _providerController.view3("");

            _storageController.List().ForEach(item => cmbStorage.Properties.Items.Add(item.Armazem));
            if (cmbStorage.Properties.Items.Count > 0)
            {
                cmbStorage.SelectedIndex = 0;
            }

            _paymentController.ListALL().ForEach(item => MethodsTable.combosAdd(cmbPayment, item.Descricao));
            MethodsTable.itensCombosMaiorZeroSelect(cmbPayment);
            _currentAccountController.ListALL().ForEach(item => MethodsTable.combosAdd(cmbAccount, item.Descricao + " - " + item.NumeroConta));
            MethodsTable.itensCombosMaiorZeroSelect(cmbAccount);
            toGridEntryProducts();
        }
        private void bunifuThinButton21_Click(object sender, EventArgs e)
        {
            position = gridView1.GetSelectedRows()[0];
            string cell = gridView1.GetRowCellValue(position, gridView1.Columns["Id"]).ToString();

            if (cell != null || cell != string.Empty)
            {
                if (position >= 0)
                {
                    bool       venda     = bool.Parse(gridView1.GetFocusedRowCellValue("Venda").ToString());
                    bool       stock     = bool.Parse(gridView1.GetFocusedRowCellValue("Stock").ToString());
                    Permission pemission = _permissionController.listForId(MethodsTable.getCellValueRowSelectedIdInt(gridView1));
                    pemission.Venda = venda;
                    pemission.Stock = stock;
                    _permissionController.update(pemission);
                    MessageBox.Show("Salvo com sucesso");
                }
                else
                {
                    MessageBox.Show("Selecione uma linha");
                }
            }
        }
Beispiel #6
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            Customer customer = _customerController.getOne(MethodsTable.getCellValueRowSelectedIdInt(gridView1));

            if (customer != null && MethodsTable.messageDelete())
            {
                if (customer.Nif == "999999999" && customer.Cliente.Contains("Final"))
                {
                    System.Windows.Forms.MessageBox.Show("Consumidor final, não pode ser apagado..!");
                }
                else if (_customerController.delete(customer) == 0)
                {
                    MethodsTable.messageJaOperou();
                    _customerController.Dispose();
                    _customerController = new CustomerController();
                }

                else
                {
                    Methods.playSuccess();
                    toGridControlCustomers();
                }
            }
        }