示例#1
0
        private void btnGetBack_Click(object sender, EventArgs e)
        {
            if (cmbDeletedData.SelectedIndex == 0)
            {
                if (categorybll.GetBack(categorydetail))
                {
                    MessageBox.Show("The category has been recovered");
                    dto = bll.Select(true);
                    dataGridView1.DataSource = dto.Categories;
                }
            }
            else if (cmbDeletedData.SelectedIndex == 1)
            {
                if (customerbll.GetBack(customerdetail))
                {
                    MessageBox.Show("The customer has been recovered");
                    dto = bll.Select(true);
                    dataGridView1.DataSource = dto.Customers;
                }
            }
            else if (cmbDeletedData.SelectedIndex == 2)
            {
                if (productdetail.isCategoryDeleted)
                {
                    MessageBox.Show("Category was deleted, you must get it back");
                }

                else if (productbll.GetBack(productdetail))
                {
                    MessageBox.Show("The product has been recovered");
                    dto = bll.Select(true);
                    dataGridView1.DataSource = dto.Products;
                }
            }
            else
            {
                if (salesdetail.isCategoryDeleted || salesdetail.isCustomerDeleted || salesdetail.isProductDeleted)
                {
                    if (salesdetail.isCategoryDeleted)
                    {
                        MessageBox.Show("Category was deleted, you must get it back");
                    }
                    if (salesdetail.isCustomerDeleted)
                    {
                        MessageBox.Show("Customer was deleted, you must get it back");
                    }
                    if (salesdetail.isProductDeleted)
                    {
                        MessageBox.Show("Product was deleted, you must get it back");
                    }
                }
                else if (salesbll.GetBack(salesdetail))
                {
                    MessageBox.Show("The sale has been recovered");
                    dto = bll.Select(true);
                    dataGridView1.DataSource = dto.Sales;
                }
            }
        }
示例#2
0
 private void btnGetBack_Click(object sender, EventArgs e)
 {
     if (cmbDeletedData.SelectedIndex == 0)
     {
         if (categoryBLL.GetBack(categorydetail))
         {
             MessageBox.Show("Category was Get back");
             dto = bll.Select(true);
             dataGridView1.DataSource = dto.Categories;
         }
     }
     else if (cmbDeletedData.SelectedIndex == 1)
     {
         if (customerBLL.GetBack(customerdetail))
         {
             MessageBox.Show("Customer was Get back");
             dto = bll.Select(true);
             dataGridView1.DataSource = dto.Customers;
         }
     }
     else if (cmbDeletedData.SelectedIndex == 2)
     {
         if (productdetail.isCategoryDeleted)
         {
             MessageBox.Show("Category was deleted first get back category");
         }
         else if (productBLL.GetBack(productdetail))
         {
             MessageBox.Show("Product was Get back");
             dto = bll.Select(true);
             dataGridView1.DataSource = dto.Products;
         }
     }
     else
     {
         if (salesdetail.isCategoryDeleted || salesdetail.isCustomerDeleted || salesdetail.isProductDeleted)
         {
             if (salesdetail.isCategoryDeleted)
             {
                 MessageBox.Show("Category was deleted first get back category");
             }
             else if (salesdetail.isCustomerDeleted)
             {
                 MessageBox.Show("customer was deleted first get back category");
             }
             else if (salesdetail.isProductDeleted)
             {
                 MessageBox.Show("Product was deleted first get back category");
             }
         }
         else if (salesBLL.GetBack(salesdetail))
         {
             MessageBox.Show("Sales was Get back");
             dto = bll.Select(true);
             dataGridView1.DataSource = dto.Sales;
         }
     }
 }