Example #1
0
        private void buttonCancelSale_Click(object sender, EventArgs e)
        {
            int id;

            if (txtNumericSale.Text != "")
            {
                var result = MessageBox.Show("¿Desea anular Venta?", "Confirmación", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    id = Convert.ToInt32(txtNumericSale.Text);
                    WorkSales.updateStateSale(id);
                    grdSales.DataSource = WorkSales.getAllSalesSP();
                    txtNumericSale.Text = "";
                }
            }
            else
            {
                if (grdSales.SelectedRows.Count > 0)
                {
                    var result = MessageBox.Show("¿Desea anular Venta?", "Confirmación", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (result == DialogResult.Yes)
                    {
                        id = Convert.ToInt32(grdSales.CurrentRow.Cells["Id de la Venta"].Value.ToString());
                        WorkSales.updateStateSale(id);
                        grdSales.DataSource = WorkSales.getAllSalesSP();
                    }
                }
                else
                {
                    MessageBox.Show("Seleccione una fila!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Example #2
0
 private void btnSeeAllSales_Click(object sender, EventArgs e)
 {
     grdSales.DataSource     = WorkSales.getAllSalesSP();
     comboBoxListSearch.Text = "Buscar por";
     btnSearch.Enabled       = false;
     //setAllItemsStatus();
     disableControlls();
     showSalesInfo();
 }
Example #3
0
        private void ListSalesForm_Load(object sender, EventArgs e)
        {
            DataRowCollection dataUser = WorkSales.getUsersByRol().Rows;

            foreach (DataRow row in dataUser)
            {
                cmbVendedor.Items.Add(row["usu_apellido_nombre"].ToString());
            }
            grdSales.DataSource = WorkSales.getAllSalesSP();
            SetDataTimePicker();
            comboBoxListSearch.Text = "Buscar por";

            setCmbCustomer();
            showSalesInfo();
            disableControlls();
        }