public FormRegisterPurchase(CartDetailPurchase cartDetailPurchase)
 {
     InitializeComponent();
     this.dgvDPurchase.AutoGenerateColumns = false;
     this.cartDetailPurchase = cartDetailPurchase;
     this.LoadForm();
 }
        private void btnDeleteDPu_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.dgvDPurchase.SelectedRows.Count == 0)
                {
                    throw new ArgumentException("Debe seleccionar una fila para eliminar.");
                }

                DialogResult    result          = new DialogResult();
                FormInformation formInformation = new FormInformation("¿ESTAS SEGURO DE ELIMINAR EL REGISTRO?");
                result = formInformation.ShowDialog();
                if (result == DialogResult.OK)
                {
                    CartDetailPurchase detailProduct = this.dgvDPurchase.CurrentRow.DataBoundItem as CartDetailPurchase;
                    int index = this.dgvDPurchase.CurrentRow.Index;
                    this.cartDetailPurchase.DeleteCartDetailPurchaseItem(index);
                    this.sourceList.ResetBindings();
                    this.UpdateTotalAndSimilars(Convert.ToDecimal(this.cartDetailPurchase.total));

                    FormSuccess.ConfirmationForm("ELIMINADO");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 3
0
 public HomeForm()
 {
     InitializeComponent();
     this.cartDetailSale     = new CartDetailSale();
     this.cartDetailPurchase = new CartDetailPurchase();
     this.InitialConfigurationDesign();
     this.OpenJarAPI();
 }