public void exportarAExcel() { try { SaveFileDialog fichero = new SaveFileDialog(); fichero.Filter = "Excel (*.xls)|*.xls"; fichero.FileName = "Venta Numero " + txtCodigo.Text + "- " + DateTime.Now.ToString("dd-MM-yyyy"); if (fichero.ShowDialog() == DialogResult.OK) { Microsoft.Office.Interop.Excel.Application aplicacion; Microsoft.Office.Interop.Excel.Workbook libros_trabajo; Microsoft.Office.Interop.Excel.Worksheet hoja_trabajo; aplicacion = new Microsoft.Office.Interop.Excel.Application(); libros_trabajo = aplicacion.Workbooks.Add(); hoja_trabajo = (Microsoft.Office.Interop.Excel.Worksheet)libros_trabajo.ActiveSheet; //hoja_trabajo.Cells.Font.Bold = true; hoja_trabajo.Cells.Rows[1].Font.Bold = true; hoja_trabajo.Cells.Rows[1].Font.Size = 15; hoja_trabajo.Cells[1, 1] = "Venta Nº : " + txtCodigo.Text + " - Fecha " + txtFechaVenta.Text; hoja_trabajo.Range[hoja_trabajo.Cells[1, 1], hoja_trabajo.Cells[1, 10]].Merge(); // rango.Merge(true); //Recorremos el DataGridView rellenando la hoja de trabajo for (int i = 0; i < dataLista.Columns.Count; i++) { hoja_trabajo.Cells[2, i + 1] = dataLista.Columns[i].Name; } for (int i = 0; i < dataLista.Rows.Count; i++) { for (int j = 0; j < dataLista.Columns.Count; j++) { //se coloca 3 porque la primera celda pertenece al nombre de la columna y luego los datos hoja_trabajo.Cells[i + 3, j + 1] = dataLista.Rows[i].Cells[j].Value.ToString(); } } //ajustar el tamaño de las celdas deacuerdo al tamaño de las columnas agregadas hoja_trabajo.Cells.Columns.AutoFit(); //guardo el archivo con la ruta del archivo libros_trabajo.SaveAs(fichero.FileName, Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal); libros_trabajo.Close(true); aplicacion.Quit(); if (MessageBox.Show("Desea abrir el Excel ?", "Abrir Excel" , MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes) { Process.Start(fichero.FileName); } } } catch (Exception ex) { UtilityFrm.mensajeError("Error: " + ex.Message); } }
private void btnBuscar_Click(object sender, EventArgs e) { try { FolderBrowserDialog browser = new FolderBrowserDialog(); browser.RootFolder = Environment.SpecialFolder.MyComputer; string tempPath = ""; if (browser.ShowDialog() == DialogResult.OK) { tempPath = browser.SelectedPath; txtRuta.Text = tempPath; // prints path if (File.Exists(tempPath + "\\backup.bak")) { sincronizarBackup(tempPath + "\\backup.bak"); } else { lblSincronizacion.Visible = true; lblSincronizacion.Text = "Nunca"; } } else { txtRuta.Text = ""; } } catch (Exception ex) { UtilityFrm.mensajeError("Error al intentar sincronizar: " + ex.Message + " " + ex.StackTrace); } }
private void btnGuardar_Click(object sender, EventArgs e) { try { if (txtUtilidad.Text == "0" || txtUtilidad.Text.Length == 0) { //en el caso de que la utilidad sea 0 y esté activado modificar por utilidad UtilityFrm.mensajeError("No se a podido guardar,verifique el campo utilidad si no se encuentra vacio o con valor 0"); } else { //this.dgvProductosSeleccionados.Columns["precioCompra"].DefaultCellStyle.Format = String.Format("###,##0.00"); DataTable tablaArticulos = GrillaADataTable(dgvProductosSeleccionados); string respuesta = NegocioArticulo.editarPrecioMasivo(tablaArticulos); if (respuesta.Equals("ok")) { UtilityFrm.mensajeConfirm("Se ha modificado Correctamente"); this.Close(); } else { UtilityFrm.mensajeError("Ocurrió un error :" + respuesta); } } } catch (Exception ex) { UtilityFrm.mensajeError("No se a podido guardar :" + ex.Message); } }
//guarda el precio actualizado public void guardarPrecio() { try { decimal precioVenta = Convert.ToDecimal(txtPrecioVenta.Text); decimal precioCompra = Convert.ToDecimal(txtPrecioCompra.Text); if (precioVenta > 0 && idArticulo != 0 && precioCompra > 0) { this.precioVenta = precioVenta; this.utilidad = Convert.ToInt32(txtUtilidad.Text); NegocioArticulo.editarPrecio(this.idArticulo, precioVenta, precioCompra, this.utilidad); this.Close(); UtilityFrm.mensajeConfirm("La edición se realizó Correctamente"); } else { UtilityFrm.mensajeError("No se a podido guardar "); } } catch (Exception ex) { UtilityFrm.mensajeError("No se a podido guardar :" + ex.Message); } }
/*Metodos propios*/ public void buscarPorFecha() { dataLista.Rows.Clear(); try { DataTable dt = NegocioVenta.BuscarFechas(dtpFechaIni.Value.ToString("dd/MM/yyyy") + " 00:00:00", dtpFechaFin.Value.ToString("dd/MM/yyyy") + " 23:59:59", ChkFactura.Checked == true ? 'P' : 'F', Chkcaja.Checked == true ? false : true, rdBPresupuesto.Checked == true ? "PRESUPUESTO" : "NOTA DE VENTA"); foreach (DataRow venta in dt.Rows) { string estado = venta["estado"].ToString(); if (estado.Equals("F")) { estado = "FACTURADO"; } else if (estado.Equals("P")) { estado = "PENDIENTE"; } else if (estado.Equals("N")) { estado = "NOTA DE CREDITO"; } else { estado = "PRESUPUESTADO"; } dataLista.Rows.Add(venta["idventa"], venta["razon_social"], venta["fecha"], venta["tipo_comprobante"], venta["total"], estado, venta ["caja"], venta ["idcliente"], venta ["cuit"], venta["Nrocomprobante"], venta["factura"], venta["Neto21"], venta["Totaliva21"], venta["Total_Neto105"], venta["Totaliva105"], venta["CAE"], venta["CAE_Fechavencimiento"]); } } catch (Exception ex) { UtilityFrm.mensajeError("Error Con Base de Datos :" + ex.Message); } }
private void xuiSuperButton1_Click(object sender, EventArgs e) { FrmBusquedaAvaCliente cliente = new FrmBusquedaAvaCliente(); cliente.ShowDialog(); //si el usuario cierra la ventana isCerro es true, sino si selecciono algun articulo isCerro try { if (cliente.IsCerro) { txtIdCliente.Focus(); } else { TxtCuitBeneficio.Text = cliente.Cuit.ToString(); TxtRazonsocialBen.Text = cliente.RazonSocial.ToString(); cuitBeneficiario = cliente.Cuit.ToString(); rivabeneficiaria = cliente.Riva.ToString(); domicilioBeneficiario = cliente.Domicilio.ToString(); idclientebeneficiaria = cliente.IdCliente; TxtEmpresabeneficiaria.Text = ""; } } catch (Exception ex) { UtilityFrm.mensajeError("Error al seleccionar un cliente. Causa:" + ex.Message + "cadena:" + ex.StackTrace); UtilityFrm.limpiarTextbox(TxtEmpresabeneficiaria, TxtRazonsocialBen, TxtCuitBeneficio); xuiSuperButton1.Focus(); } }
private void txtBuscar_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { try { if (rdbRazonSocial.Checked == true) { this.dataLista.DataSource = NegocioCliente.buscar(this.txtBuscar.Text); } if (rdbCuit.Checked == true) { this.dataLista.DataSource = NegocioCliente.buscarCodigoCliente(this.txtBuscar.Text, 7); } if (rdbCodigo.Checked == true) { this.dataLista.DataSource = NegocioCliente.buscarCodigoCliente(this.txtBuscar.Text); } } catch (Exception ex) { UtilityFrm.mensajeError("Error Con Base de Datos :" + ex.Message); } } }
private void Frmimpventicket_Load(object sender, EventArgs e) { // ReportDocument reportprint = new ReportDocument(); //PrinterSettings ps = new PrinterSettings (); //ps.PrinterName = "Generic / Text Only (Copiar 2)"; //Boolean impresoravalida = ps.IsValid; //PageSettings pg = new PageSettings (); // ps.Copies = 1; // VentasTicket1.Load (Application.StartupPath.Replace("D:\\PROYECTO SOFTINTEGRAL\\Sistema de ventas (Ultimo)\\Sistema de ventas\\Capa_Presentacion\\Reportes","VentasTicket.rpt")); // reportprint.SetDataSource ( VentasTicket1); //reportprint.PrintToPrinter(ps, pg, false); try { // VentasTicket1.SetParameterValue("@idventa", codventa); if ("directo" == NegocioConfigEmpresa.confsistema("modoimpventa")) { // PrintDocument imprimirdirecto = new PrintDocument(); // VentasTicket1.PrintOptions.PrinterName = NegocioConfigEmpresa.impticket != "" ? NegocioConfigEmpresa.impticket : UtilityFrm.GetImpresoraDefecto(); //VentasTicket1.PrintToPrinter(1, false, 0, 0); this.Close(); } else if (NegocioConfigEmpresa.confsistema("modoimpventa") == "vista") { // crystalReportViewer1.ReportSource = VentasTicket1; } } catch (Exception ex) { UtilityFrm.mensajeError(ex.Message); } }
private void BtnCambiar_Click(object sender, EventArgs e) { if (DGVenta.Rows.Count != 0) { foreach (DataGridViewRow row in DGVenta.Rows) { if (cbcampoamodificar.Text != "" && txtPorcentaje.Text != "") { if (cbcampoamodificar.Text == "Precio_compra") { row.Cells[3].Value = UtilityFrm.formateodecimal(UtilityFrm.calcularventa(Convert.ToDecimal(row.Cells[3].Value), Convert.ToDecimal(txtPorcentaje.Text)), 2); } if (cbcampoamodificar.Text == "Utilidad") { row.Cells[4].Value = UtilityFrm.formateodecimal(Convert.ToDecimal(txtPorcentaje.Text), 2); } if (cbcampoamodificar.Text == "Flete") { row.Cells[5].Value = UtilityFrm.formateodecimal(Convert.ToDecimal(txtPorcentaje.Text), 2); } if (cbcampoamodificar.Text == "Precio_venta") { row.Cells[6].Value = UtilityFrm.formateodecimal(UtilityFrm.calcularpreciocosto(Convert.ToDecimal(row.Cells[6].Value), Convert.ToDecimal(txtPorcentaje.Text)), 2); } } } } refrescar(); }
private void CBEquipo_SelectedValueChanged(object sender, EventArgs e) { if (CBMar.ValueMember != "" && CBEquipo.ValueMember != "") { UtilityFrm.completarcombobox(CBMod, "idmodelo", "modelo", Negocioserviciotecnico.buscarmodelo(Convert.ToInt32(CBMar.SelectedValue), Convert.ToInt32(CBEquipo.SelectedValue))); } }
private void dataLista_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (flag == false) { FrmCambiarPrecio precio = new FrmCambiarPrecio(Convert.ToInt32(this.dataLista.CurrentRow.Cells["codigo"].Value), Convert.ToString(this.dataLista.CurrentRow.Cells["producto"].Value), Convert.ToDecimal(this.dataLista.CurrentRow.Cells["precio"].Value)); precio.ShowDialog(); //una vez que se modifica el precio se actualiza la grilla this.mostrar(); } else { idarticulo = Convert.ToInt32(this.dataLista.CurrentRow.Cells["codigo"].Value); this.Close(); } } catch (Exception ex) { UtilityFrm.mensajeError("error :" + ex); } }
private void dataLista_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Right) { //pasa al texto el foco txtProducto.Focus(); } if (e.KeyCode == Keys.Left) { //pasa al texto el foco txtProducto.Focus(); } if (e.KeyCode == Keys.Enter) { if (dataLista.Rows.Count > 0) { try { productoSeleccionado(); } catch (Exception ex) { UtilityFrm.mensajeError("Error: " + ex.Message); } } } }
private void dataLista_CellContentClick_1(object sender, DataGridViewCellEventArgs e) { try { //se produce un evento cuando hago click en la columna 0 que es eliminar de la lista //se comparan el indice de columna de la lista =0 y el indice de la columna del evento=0 if (e.ColumnIndex == dataLista.Columns[0].Index && e.RowIndex >= 0) { //creo una datagridviewrow para guarda los datos de la fila actual DataGridViewRow fila = dataLista.Rows[e.RowIndex]; //creo un checkboxcell para obtener el checkbox seleccionado DataGridViewCheckBoxCell tildado = (DataGridViewCheckBoxCell)fila.Cells[0]; if (Convert.ToBoolean(tildado.Value) == true) { //si el valor de tildado es null es true y se desactiva tildado.Value = CheckState.Unchecked; } else { //caso contrario se activa tildado.Value = CheckState.Checked; } } } catch (Exception ex) { UtilityFrm.mensajeError("Has seleccionado una Opcion Incorrecta, el Origen es: " + ex.Message); } }
private void btnNuevo_Click(object sender, EventArgs e) { //limpio textbox UtilityFrm.limpiarTextbox(txtDireccion, txtRazonSocial, txtNombre, txtCodigo, txtCuit, txtDocumento); UtilityFrm.limpiarTextbox(txtTelefono, txtEmail); habilitarbotones(false, true, false, true); cbrespiva.SelectedIndex = 2; //habilitar botones //this.btnGuardar.Enabled = true; //this.btnEditar.Enabled = false; //this.btnCancelar.Enabled = true; //this.btnNuevo.Enabled = false; ////habilitar textbox //this.txtDireccion.Enabled = true; //this.txtRazonSocial.Enabled = true; //this.txtNombre.Enabled = true; //this.txtCodigo.Enabled = true; //this.txtCuit.Enabled = true; //this.txtDocumento.Enabled = true; //this.txtTelefono.Enabled = true; //this.txtEmail.Enabled = true; //this.dtimeFechaNacimiento.Enabled = true; this.txtRazonSocial.Focus(); //isEditar = false; //isNuevo = true; }
public void btnGenerarEtiqueta_Click(object sender, EventArgs e) { string nombreArt = string.Empty; int cantidad = Convert.ToInt32(cbxCantidad.SelectedItem); txtCodigoBarra.Text = Convert.ToString(this.dataListaCodigoBarra.CurrentRow.Cells[1].Value); nombreArt = Convert.ToString(this.dataListaCodigoBarra.CurrentRow.Cells[2].Value); idarticulo = Convert.ToInt32(this.dataListaCodigoBarra.CurrentRow.Cells[0].Value); if (txtCodigoBarra.Text == string.Empty) { UtilityFrm.mensajeError("No se ha podido Imprimir, porque no existe Codigo de Barra en este producto : " + Convert.ToString(this.dataListaCodigoBarra.CurrentRow.Cells[2].Value)); } else { //GENERA CODIGO DE BARRA EN EL PANEL CODIGOBARRA //Barcode codigoDeBarra = new Barcode(); ////mostrar el texto de codigo //codigoDeBarra.IncludeLabel = true; //pnCodigoBarra.BackgroundImage = codigoDeBarra.Encode(TYPE.CODE128, txtCodigoBarra.Text, Color.Black, Color.White, 425, 137); //FrmReporteEtiqueta reporte = new FrmReporteEtiqueta(txtCodigoBarra.Text); //reporte.ShowDialog(); FrmImpEtiquetas etiqueta = new FrmImpEtiquetas(nombreArt, txtCodigoBarra.Text, cantidad, idarticulo); etiqueta.ShowDialog(); } }
private void textBox1_KeyDown(object sender, KeyEventArgs e) { DataTable midatatable = new DataTable(); if (e.KeyCode == Keys.Enter) { if (CBBuscarportipo.Text == "ADJUDICACION") { midatatable = NegocioRetirodeMercaderia.buscarconcatenacion(0, "", "", DateTime.Now.ToString("dd/MM/yyyy"), DateTime.Now.ToString("dd/MM/yyyy"), false, false, false, false, 0, true, Convert.ToInt32(textBox1.Text)); } if (CBBuscarportipo.Text == "VENTA") { midatatable = NegocioRetirodeMercaderia.buscarconcatenacion(0, "", "", DateTime.Now.ToString("dd/MM/yyyy"), DateTime.Now.ToString("dd/MM/yyyy"), false, false, false, false, 0, false, 0, true, Convert.ToInt32(textBox1.Text)); } if (midatatable.Rows.Count != 0) { DataRow row = midatatable.Rows[0]; LblNorden.Text = row["Orden"].ToString(); LblRazonsocial.Text = row["NombreBeneficiado"].ToString(); LblCuit.Text = row["cuit"].ToString(); LblEstado.Text = row["estado"].ToString(); LblTipo.Text = row["Tipo"].ToString(); LblCodcliente.Text = row["CodEmpresaB"].ToString(); LblEmpresa.Text = row["Tipo"].ToString() == "VENTA" ? NegocioConfigEmpresa.emrazonsocial : row["razon_social"].ToString(); idempresa = row["Tipo"].ToString() == "VENTA" ? 1 : Convert.ToInt32(row["codcliente"].ToString()); cargardetalleretiro(Convert.ToInt32(row["Orden"].ToString())); Txtitems.Focus(); } else { UtilityFrm.mensajeError("La orden que ingreso es inexistente"); textBox1.SelectAll(); } } }
private void txtUtilidad_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { decimal precioCompra, utilidad, precioVenta; if (txtPrecioCompra.Text == "0" || txtPrecioCompra.Text == "0,00") { //si entra desde el formulario FrmPrecio entrará por acá precioCompra = Convert.ToDecimal(txtPrecioCompra.Text); utilidad = Convert.ToDecimal(txtUtilidad.Text); precioVenta = (utilidad * precioCompra) / 100; precioVenta = precioVenta + precioCompra; txtPrecioVenta.Text = Convert.ToString(precioVenta); btnGuardar.Focus(); } else { precioCompra = Convert.ToDecimal(txtPrecioCompra.Text); utilidad = Convert.ToDecimal(txtUtilidad.Text); precioVenta = (utilidad * precioCompra) / 100; precioVenta = precioVenta + precioCompra; txtPrecioVenta.Text = Convert.ToString(precioVenta); btnGuardar.Focus(); } e.Handled = false; e.SuppressKeyPress = true; } } catch (Exception ex) { UtilityFrm.mensajeError("Has introducido algun valor incorrecto"); } }
public void mostrarRanking5Producto() { try { DataTable dt = NegocioVenta.MostrarRanking5Productos(); if (dt.Rows.Count > 0) { chartRankingVentas.Series["Ventas"].Points.Clear(); foreach (DataRow row in dt.Rows) { chartRankingVentas.Series["Ventas"].Points.AddXY(row["nombre"], row["cantidad"]); } //ejemplo: chartRankingVentas.Series["Ventas"].Points.AddXY("Producto2", 50); //chartRankingVentas.Series["Ventas"].Points.AddXY("Producto3", 20); //chartRankingVentas.Series["Ventas"].Points.AddXY("Producto4", 70); //chartRankingVentas.Series["Ventas"].Points.AddXY("Producto5", 1000); chartRankingVentas.Visible = true; } else { UtilityFrm.mensajeError("No existen ventas en este momento"); chartRankingVentas.Visible = true; } } catch (Exception ex) { UtilityFrm.mensajeError("Error: " + ex.Message); } }
private void CRVVenta_Load(object sender, EventArgs e) { try { //SqlDataAdapter adaptador = new SqlDataAdapter() ; //dt = new DataTable(); //dt.Columns.Add("nombre", typeof(String)); //dt.Columns.Add("cantidad", typeof(Int32)); //dt.Columns.Add("precio", typeof(decimal)); //dt.Columns.Add("idventa", typeof(Int32)); //dt.Columns.Add("idcliente", typeof(Int32)); //dt.Columns.Add("tipo_comprobante", typeof(String)); //dt.Columns.Add("serie", typeof(Int32)); //dt.Columns.Add("correlativo", typeof(Int32)); //dt.TableName = "venta"; // dt.Rows.Add( 12,1,"ticket",1234,23); //devuelve la ultima venta realizada dt = NegocioVenta.NotaDeVenta(); // String hola=dt.Columns[1].ToString(); NotaDeVenta1.SetDataSource(dt); NotaDeVenta1.SetParameterValue("total", totalAPagar); } catch (Exception ex) { UtilityFrm.mensajeError("error " + ex.Message); } }
private void btnAplicar_Click(object sender, EventArgs e) { try { if (DGVenta.Rows.Count != 0) { foreach (DataGridViewRow row in DGVenta.Rows) { row.Cells[6].Value = UtilityFrm.formateodecimal(UtilityFrm.calcularventa(Convert.ToDecimal(row.Cells[3].Value), Convert.ToDecimal(row.Cells[4].Value), Convert.ToDecimal(row.Cells[5].Value), Convert.ToDecimal(row.Cells[6].Value)), 2); } if (UtilityFrm.mensajeopcionsiono("Desea aplicar los cambios?") == true) { DataTable tablaArticulos = GrillaADataTable(DGVenta); string respuesta = NegocioArticulo.editarPrecioMasivo(tablaArticulos); UtilityFrm.mensajeConfirm("La actualizacion se realizo con exito"); DGVenta.Rows.Clear(); } } } catch (Exception s) { UtilityFrm.mensajeError(s.Message); } }
private void BtnBuscarcliente_Click(object sender, EventArgs e) { // Frmimpventicket miform = new Frmimpventicket(); // miform.Codventa = 1080; // miform.Show(); FrmBusquedaAvaCliente cliente = new FrmBusquedaAvaCliente(); cliente.ShowDialog(); //si el usuario cierra la ventana isCerro es true, sino si selecciono algun articulo isCerro try { if (cliente.IsCerro) { txtIdCliente.Focus(); } else { TxtCuit.Text = cliente.Cuit.ToString(); TxtRazonsocial.Text = cliente.RazonSocial.ToString(); cuit = cliente.Cuit.ToString(); riva = cliente.Riva.ToString(); domicilio = cliente.Domicilio.ToString(); idcliente = cliente.IdCliente; txtIdCliente.Text = ""; } } catch (Exception ex) { UtilityFrm.mensajeError("Error al seleccionar un cliente. Causa:" + ex.Message + "cadena:" + ex.StackTrace); UtilityFrm.limpiarTextbox(txtIdCliente, TxtRazonsocial, TxtCuit); BtnBuscarcliente.Focus(); } }
private void BtnGuardar_Click(object sender, EventArgs e) { try { if (controlarguardado() == true) { DataTable dt = new DataTable(); dt.Columns.Add("Codigo", typeof(string)); dt.Columns.Add("Cantidadtotal", typeof(decimal)); dt.Columns.Add("Detalle", typeof(string)); dt.Columns.Add("Cantidadparcial", typeof(string)); foreach (DataGridViewRow fila in DGDetalleitems.Rows) { dt.Rows.Add(fila.Cells["CCodigo"].Value, fila.Cells["CCantidad"].Value, fila.Cells["CDetalle"].Value, 0); } NegocioRetirodeMercaderia.insertar(DateTime.Now, idcliente, NegocioConfigEmpresa.idusuario, CbTipopedido.Text, "PENDIENTE", "", dt, idclientebeneficiaria, Convert.ToInt32(CbTipopedido.SelectedValue)); UtilityFrm.mensajeConfirm("Se guardo correctamente"); limpiarformulario(); } else { UtilityFrm.mensajeError("Tiene algunos campos en blanco, no puede continuar"); } } catch (Exception err) { UtilityFrm.mensajeError(err.Message); } }
private void Frmserviciotecnico_Load(object sender, EventArgs e) { UtilityFrm.completarcombobox(CBCliente, "idcliente", "razon_social", NegocioCliente.mostrar(), true); UtilityFrm.completarcombobox(CBMar, "idmarca", "marca", Negocioserviciotecnico.buscarmarca()); UtilityFrm.completarcombobox(CBEquipo, "idequipo", "equipo", Negociogeneral.selecciondeconsultasinfiltro("ordenservicio_equipo")); Estadoservicio = "INI"; formulariosegunestado(); }
private void FrmStockRetirodeMercaderia_Load(object sender, EventArgs e) { CBBuscarportipo.Text = "VENTA"; CBEstado.Text = "PENDIENTE"; UtilityFrm.completarcombobox(CbTipopedido, "NroTipo", "Nombre", NegocioRetirodeMercaderia.buscartiporetiro(), true); //textBox1.Text = "Introdusca el numero de registro a buscar"; //textBox1.ForeColor = Color.Gray; }
private void txtNombre_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { this.BuscarNombre(); UtilityFrm.limpiarTextbox(txtDireccion, txtRazonSocial, txtCodigo, txtCuit, txtDocumento); UtilityFrm.limpiarTextbox(txtTelefono, txtEmail); } }
private void btnCierreZ_Click(object sender, EventArgs e) { try { } catch (Exception ex) { UtilityFrm.mensajeError("Error de impresión, Causa:" + ex); } }
private void BtnZ_Click(object sender, EventArgs e) { Negociocomprobantes objcomprobante = new Negociocomprobantes(); string msg = objcomprobante.imprimirxz("Z", NegocioConfigEmpresa.marcafiscal); if (msg != "ok") { UtilityFrm.mensajeError(msg); } }
private void refrescar() { if (DGVenta.Rows.Count != 0) { foreach (DataGridViewRow row in DGVenta.Rows) { row.Cells[6].Value = UtilityFrm.formateodecimal(UtilityFrm.calcularventa(Convert.ToDecimal(row.Cells[3].Value), Convert.ToDecimal(row.Cells[4].Value), Convert.ToDecimal(row.Cells[5].Value), Convert.ToDecimal(row.Cells[6].Value)), 2); } } }
private void dataLista_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { } catch (Exception ex) { UtilityFrm.mensajeError("error :" + ex); } }
public void Buscar_Cliente(int codCliente, string Datagridopcion = "DGCliente") { try { if (codCliente > 0) { DataTable dt = NegocioCliente.buscarCodigoCliente(codCliente.ToString()); if (dt.Rows.Count != 0) { DataRow row = dt.Rows[0]; if (Datagridopcion == "DGCliente") { string cliente = row["razon_social"].ToString(); cuit = row["cuit"].ToString(); riva = row["responsabilidadiva"].ToString(); domicilio = row["direccion"].ToString(); idcliente = Convert.ToInt32(row["idcliente"].ToString()); TxtRazonsocial.Text = cliente; TxtCuit.Text = cuit; txtIdCliente.Text = ""; } else { string cliente = row["razon_social"].ToString(); cuitBeneficiario = row["cuit"].ToString(); rivabeneficiaria = row["responsabilidadiva"].ToString(); domicilioBeneficiario = row["direccion"].ToString(); idclientebeneficiaria = Convert.ToInt32(row["idcliente"].ToString()); TxtEmpresabeneficiaria.Text = ""; TxtRazonsocialBen.Text = cliente; TxtCuitBeneficio.Text = cuitBeneficiario; } // UtilityFrm.mensajeConfirm("Se encontro el Cliente " + cliente); } else { UtilityFrm.mensajeError("Error No se ha encontrado el Cliente"); //clienteIncorrecto(); // btnCliente.Focus(); } } else { UtilityFrm.mensajeError("Error No se ha encontrado el Cliente"); // clienteIncorrecto(); // btnCliente.Focus(); } } catch (Exception) { throw; } }