Exemplo n.º 1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int id = 0;

            int.TryParse(tbId.Text, out id);
            if (id != 0)
            {
                Invoice currentInvoice = BLInvoice.GetInvoiceById(APCContext, id);
                if (currentInvoice != null)
                {
                    APCContext.DeleteObject(currentInvoice);
                    APCContext.SaveChanges();

                    DeleteInvoicePO(currentInvoice);
                    deleteInvoice_Product(currentInvoice);

                    MessageBox.Show("Delete Successfully");
                    ClearContent();
                }
                else
                {
                    MessageBox.Show("Invoice Id not found");
                }
            }
            else
            {
                MessageBox.Show("Invoice Id not found");
            }
        }
Exemplo n.º 2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int id = 0;

            int.TryParse(tbId.Text, out id);
            if (id != 0)
            {
                PO currentPO = BLPO.GetPOById(APCContext, id);
                if (currentPO != null)
                {
                    APCContext.DeleteObject(currentPO);
                    APCContext.SaveChanges();
                    deletePO_Product(currentPO);

                    MessageBox.Show("Delete Successfully");
                    ClearContent();
                    SetComboToDefault();
                }
                else
                {
                    MessageBox.Show("PO Id not found");
                }
            }
            else
            {
                MessageBox.Show("PO Id not found");
            }
        }
Exemplo n.º 3
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int id = 0;

            int.TryParse(tbId.Text, out id);
            if (id != 0)
            {
                Category currentCategory = BLCategory.GetCategoryById(APCContext, id);
                if (currentCategory != null)
                {
                    APCContext.DeleteObject(currentCategory);
                    APCContext.SaveChanges();
                    MessageBox.Show("Delete Successfully");
                    ClearContent();
                }
                else
                {
                    MessageBox.Show("Category Id not found");
                }
            }
            else
            {
                MessageBox.Show("Category Id not found");
            }
        }
Exemplo n.º 4
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int id = 0;

            int.TryParse(tbId.Text, out id);
            if (id != 0)
            {
                Supplier currentSupplier = BLSupplier.GetSupplierById(APCContext, id);
                if (currentSupplier != null)
                {
                    APCContext.DeleteObject(currentSupplier);
                    APCContext.SaveChanges();
                    MessageBox.Show("Delete Successfully");
                    ClearContent();
                }
                else
                {
                    MessageBox.Show("Supplier Id not found");
                }
            }
            else
            {
                MessageBox.Show("Supplier Id not found");
            }
        }
Exemplo n.º 5
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int id = 0;

            int.TryParse(tbId.Text, out id);
            if (id != 0)
            {
                Project_Workers currentProject_Workers = BLProject_Workers.GetProject_WorkersById(APCContext, id);
                if (currentProject_Workers != null)
                {
                    APCContext.DeleteObject(currentProject_Workers);
                    APCContext.SaveChanges();
                    MessageBox.Show("Delete Successfully");
                    ClearContent();
                }
                else
                {
                    MessageBox.Show("Project_Workers Id not found");
                }
            }
            else
            {
                MessageBox.Show("Project_Workers Id not found");
            }
        }