private void button1_Click(object sender, EventArgs e) { dynamic ww = new Withdraw(); this.Visible = false; ww.ShowDialog(); this.Visible = true; }
private void authorize_Click(object sender, RoutedEventArgs e) { string user = userNameText.Text; string pass = passlog.Password.ToString(); bool flag = _withdrawPresenter.GetUserAdmin(user, pass); if (flag) { this.Close(); Withdraw retiro = new Withdraw(_totalEfectivo, false); retiro.ShowDialog(); } else { MessageBox.Show("Contraseña incorrecta", "", MessageBoxButton.OK); } }
private void UserControl_KeyDown(object sender, KeyEventArgs e) { switch (e.Key) { case Key.Escape: SalesTabControl.SelectedIndex = 0; cortePagoList = new BindingList <CortePagos>(); impuestoList = new BindingList <VentaImpuestos>(); tasaList = new BindingList <TasaImpuesto>(); returnList = new BindingList <TasaImpuesto>(); break; case Key.F3: globalEfectivo = _salesPresenter.GetTotalEfectivo(App._userApplication.idUsuario); Withdraw retiroStart = new Withdraw(globalEfectivo, true); retiroStart.ShowDialog(); break; case Key.F9: endCashClose(); SalesTabControl.SelectedIndex = 1; break; case Key.F2: CheckPrices checkPrice = new CheckPrices(); checkPrice.ShowDialog(); if ((bool)checkPrice.DialogResult) { ProductSale productExtractToDB = _salesPresenter.GetProductByPLU(checkPrice.productoPLU); addProductToSale(productExtractToDB, 1); } break; case Key.F12: if (products.Count > 0) { Ventas venta = new Ventas { cambio = 0, estatus = 'A', fecha = DateTime.Now, folioVenta = 0, idUsuario = App._userApplication.idUsuario, impuestos = 0, pagado = products.Sum(x => x.Price * x.Quantity), productos = (from productos in products select new AddProductSale { cantidad = productos.Quantity, idProducto = productos.idProducto, monto = productos.Total }).ToList(), total = products.Sum(x => x.Price * x.Quantity), pagos = new List <VentaPagos> { new VentaPagos { cantidad = products.Sum(x => x.Price * x.Quantity), idTipoPago = 1 } }, subtotal = products.Sum(x => x.Price * x.Quantity), utilidad = 0, impuesto = impuestosResumen }; EndSale endsale = new EndSale(venta, products); endsale.ShowDialog(); if ((bool)endsale.DialogResult) { venta.cambio = endsale.cambio; venta.pagado = endsale.pagado; venta = endsale.ventaFin; venta.impuestos = (float)Math.Round(venta.impuesto.Sum(x => x.cantidad), 2); SaleResult addVenta = _salesPresenter.AddVenta(venta).Result; auxVenta = addVenta.venta; //TO DO if (addVenta.totalEfectivo >= 1000) { WithdrawAlert retiros = new WithdrawAlert(addVenta.totalEfectivo, false); retiros.ShowDialog(); } products.Clear(); PrintMethod(); } } break; case Key.F11: PrintCashClose(); break; } }
private void btnWithdraw_Click(object sender, EventArgs e) { Withdraw withdraw = new Withdraw(); withdraw.ShowDialog(); }