public void CreateGrid() { clsOperaciones colOperaciones = new clsOperaciones(); DataTable dtResultado = colOperaciones.ReporteKardex(); gridKardex.DataSource = dtResultado; gridKardex.DataBind(); }
public void CreateGrid() { clsOperaciones colOperaciones = new clsOperaciones(); IEnumerable<object> lstResultado = colOperaciones.ReporteTotalProveedor(); gridTotales.DataSource = lstResultado; gridTotales.DataBind(); }
public void CreateGrid() { int nCliCod = 0; clsOperaciones colOperaciones = new clsOperaciones(); if (cboxCliente.SelectedIndex != -1) nCliCod = int.Parse(cboxCliente.SelectedValue); DataTable dtResultado = colOperaciones.RepVentasXComprar(nCliCod); gridVentasxCobrar.DataSource = dtResultado; gridVentasxCobrar.DataBind(); }
public clsOperacionesBL(clsPersona objPersona) { clsOperaciones operaciones = new clsOperaciones(); this.Borrar = operaciones.Borrar(objPersona.Id); this.Insertar = operaciones.Create(objPersona); this.Editar = operaciones.Edit(objPersona); //clsListadoPersonasDAL listadoPersonas = new clsListadoPersonasDAL(); //this.ListaPersonas = listadoPersonas.ListadoCompletoPersonas(); clsListadoPersonasFiltradoPorNombre listadoFiltrado = new clsListadoPersonasFiltradoPorNombre(); this.ListadoPersonasFiltrado = listadoFiltrado.ListadoPersonasFiltradoPorNombre(objPersona); }
public void CreateGrid() { clsOperaciones colOperaciones = new clsOperaciones(); DataTable dtResultado; dtResultado = colOperaciones.RepResumenCliente(); if (dtResultado.Rows.Count > 0) { SetEstado("PRO"); gridVentasxCobrar.DataSource = dtResultado; gridVentasxCobrar.DataBind(); AgregarVariableSession("dtRepClientes", dtResultado); AgregarVariableSession("nTipCam", txtTipCam.Text); } else SetEstado("ERR"); }
public void CreateGrid() { int ArtCod = 0; int PrvCod = 0; clsOperaciones colOperaciones = new clsOperaciones(); if (cboxProveedores.SelectedIndex != -1) PrvCod = int.Parse(cboxProveedores.SelectedValue); if (cboxArticulos.SelectedIndex != -1) ArtCod = int.Parse(cboxArticulos.SelectedValue); IEnumerable<Object> dtResultado = colOperaciones.ReporteTotalProveedor(PrvCod, ArtCod); gridKardex.DataSource = dtResultado; gridKardex.DataBind(); }
protected void btnProcesar_Click(object sender, EventArgs e) { string cMensaje = ""; DataTable dtResultado = null; clsOperaciones lstOperaciones = new clsOperaciones(); DateTime dFecIni = DateTime.Today; DateTime dFecFin = DateTime.Today; int prvCod = 0; try { if (ValidarDatos(ref cMensaje)) { if (txtCliente.Text != "") prvCod = int.Parse(ddlClientes.SelectedValue); else prvCod = 9999; if (chkPorFecha.Checked) { dFecIni = DateTime.Parse(txtFecIni.Text); dFecFin = DateTime.Parse(txtFecFin.Text); } dtResultado = lstOperaciones.RepVentasXComprar(prvCod, chkPorFecha.Checked, dFecIni, dFecFin); if (dtResultado.Rows.Count > 0) { SetEstado("PRO"); gridVentasxCobrar.DataSource = dtResultado; gridVentasxCobrar.DataBind(); AgregarVariableSession("dtRepClientes", dtResultado); AgregarVariableSession("nTipCam", txtTipCam.Text); } else SetEstado("ERR"); } else { MessageBox(cMensaje); } } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message); } }
protected void CargarListaOpeVenta(int _nNroReg) { clsOperaciones lstOperaciones = new clsOperaciones(); DataTable dtOpeVenta; string cEstado = ""; int nCliCod = 0; DateTime dFecIni = DateTime.Today; DateTime dFecFin = DateTime.Today; try { if (chkPorEstado.Checked) cEstado = ddlEstados.SelectedValue; if (chkPorFecha.Checked) { dFecIni = DateTime.Parse(txtFecIni.Text); dFecFin = DateTime.Parse(txtFecFin.Text); } if (chkPorCliente.Checked) nCliCod = int.Parse(ddlClienteFiltro.SelectedValue); dtOpeVenta = lstOperaciones.GetListOperaciones(gcOpeTipo, chkPorFecha.Checked, dFecIni, dFecFin, cEstado, 0, nCliCod); if (dtOpeVenta.Rows.Count == 0) dtOpeVenta = CreatDTListaOpeVenta(); RellenarGrilla(ref dgvListOperVentas, dtOpeVenta, _nNroReg); } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message); } lstOperaciones = null; }
protected void btnProcesar_Click(object sender, EventArgs e) { string cMensaje = ""; clsOperaciones lstOperaciones = new clsOperaciones(); long ndopCod = 0; int ntcmCod = 0; try { if (ValidarDatos("OPE", ref cMensaje)) { if (lblProceso.Value == "NEW") { txtFleteTra.Text = Math.Round(GetNumero(txtSubTotal.Text) / 100, 2).ToString(); txtFlete.Text = SetFormatNum(Math.Round(GetNumero(txtSubTotal.Text) / 100, 2)); long nOpeCod = lstOperaciones.MaxOpeCod() + 1; lblNroPedido.Text = nOpeCod.ToString().PadLeft(10, '0'); txtDesEspec.Text = "0.0"; } lstOperaciones.Procesar(this, gcOpeTipo, ref ndopCod, ref ntcmCod); lbldopCod.Value = ndopCod.ToString(); lbltcmCod.Value = ntcmCod.ToString(); lblOpeEstado.Value = "P"; GuardarDtCabeceraDocumento(); MessageBox("La Operacion fue Procesada con Exito, Ahora puede imprimir."); lblProceso.Value = "EDIT"; SetBotones(lblProceso.Value); } else { MessageBox(cMensaje); } } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message); } }
protected void btnEditar_Click(object sender, EventArgs e) { oThread = new Thread(delegate() { Esperar(1000); }); oThread.Start(); clsOperaciones lstOperaciones = new clsOperaciones(); clsDetOperacion lstDetOperacion = new clsDetOperacion(); Operaciones Operacion = new Operaciones(); DocumenOperacion DocumenOpe = new DocumenOperacion(); DataTable dtDetOperacion; int nOpeCod = 0; int nDopCod = 0; string cDopDescri = ""; try { HabilitarCampos(true); CargarCombos(); CargarClientes(); CargarTransportistas(); CargarVendedores(); txtDireccion.Enabled = false; txtDocCli.Enabled = false; txtTelefono.Enabled = false; nOpeCod = int.Parse(dgvListOperVentas.Rows[dgvListOperVentas.SelectedIndex].Cells[2].Text); SetPanelDocumento(nOpeCod); nDopCod = int.Parse(dgvDocumentos.Rows[0].Cells[1].Text); cDopDescri = dgvDocumentos.Rows[0].Cells[2].Text; CargarCamposOperacion(nOpeCod); CargarCamposDocumento(nDopCod, cDopDescri); ddlClientes_SelectedIndexChanged(sender, e); dtDetOperacion = lstDetOperacion.GetListDetOperacion(nOpeCod); g_dtDetOperacion = dtDetOperacion; RellenarGrilla(ref dgvDetalleVenta, dtDetOperacion, nNroDetPed); lblProceso.Value = lblOpeEstado.Value == "C" ? "CLOSE" : "EDIT"; SetBotones(lblProceso.Value); GuardarDtCabeceraDocumento(); oThread.Join(); } catch (Exception ex) { oThread.Abort(); MessageBox("Error Interno: " + ex.Message); } }
protected void btnCerrar_Click(object sender, EventArgs e) { string cMensaje = ""; clsOperaciones lstOperaciones = new clsOperaciones(); try { if (ValidarDatos("OPE", ref cMensaje)) { lstOperaciones.Cerrar(this); lblOpeEstado.Value = "C"; GuardarDtCabeceraDocumento(); MessageBox("La Operacion fue Cerrada."); lblProceso.Value = "CLOSE"; SetBotones(lblProceso.Value); } else { MessageBox(cMensaje); } } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message); } }
protected void btnAnular_Click(object sender, EventArgs e) { oThread = new Thread(delegate() { Esperar(1000); }); oThread.Start(); clsOperaciones lstOperaciones = new clsOperaciones(); int nOpeCod = 0; try { nOpeCod = int.Parse(dgvListOperVentas.Rows[dgvListOperVentas.SelectedIndex].Cells[2].Text); if (lstOperaciones.ValidarAnulacion(nOpeCod)) { lstOperaciones.Anular(nOpeCod); CargarListaOpeVenta(nNroDetPed); SetBotones("ANULAR"); oThread.Join(); MessageBox("La Operacion Fue Anulada Correctamente."); } else { MessageBox("Esta vente no se puede ANULAR."); } } catch (Exception ex) { oThread.Abort(); MessageBox("Error Interno: " + ex.Message); } }
private void CargarCamposOperacion(int _OpeCod) { clsOperaciones lstOperaciones = new clsOperaciones(); Operaciones Operacion = new Operaciones(); try { Operacion = lstOperaciones.GetOperacion(_OpeCod); //DATOS DE LA NUEVA OPERACION lbltcmCod.Value = Operacion.tcmCod.ToString(); lblTipCambio.Value = Operacion.TipoCambios.tcmCambio.ToString(); txtTipCambio.Text = lblTipCambio.Value; g_nTipoCambio = (Double)Operacion.TipoCambios.tcmCambio; lblNroPedido.Text = Operacion.OpeCod.ToString(); txtFecha.Text = ((DateTime)Operacion.OpeFecEmision).ToString("yyyy-MM-dd"); ddlZonas.SelectedValue = Operacion.ZonCod.ToString().Trim(); if (Operacion.PerCod != null) { ddlVendedores.SelectedValue = Operacion.PerCod.ToString(); ddlListaVendedores.SelectedValue = Operacion.PerCod.ToString(); } if (Operacion.TraCod != null) ddlTransportistas.SelectedValue = Operacion.TraCod.ToString(); ddlClientes.SelectedValue = Operacion.CliCod.ToString(); ddlMoneda.SelectedValue = Operacion.OpeMoneda.ToString().Trim(); ddlTipoVenta.SelectedValue = Operacion.OpeTipPago.ToString().Trim(); txtValorVenta.Text = SetFormatNum((double)Operacion.OpeSubTotal); txtDescuento.Text = SetFormatNum((double)Operacion.OpeDscto); txtFlete.Text = SetFormatNum((double)Operacion.OpeFlete); txtSubTotal.Text = SetFormatNum((double)(Operacion.OpeTotal - Operacion.OpeImpuesto)); txtIgv.Text = SetFormatNum((double)Operacion.OpeImpuesto); txtTotal.Text = SetFormatNum((double)Operacion.OpeTotal); lblOpeEstado.Value = Operacion.OpeEstado.ToString(); txtDesEspec.Text = SetFormatNum(0.0); } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message); } }
protected void btnGuardarPrecio_Click(object sender, EventArgs e) { DataTable dtDetalleCompra; string cMensaje = ""; long ndopCod = 0; int ntcmCod = 0; clsDetOperacion colDetOper = new clsDetOperacion(); clsOperaciones colOper = new clsOperaciones(); try { if (ValidarDatos("ART", ref cMensaje)) { //AGREGAMOS ARTICULO A LISTA DE ARTICULOS dtDetalleCompra = g_dtDetOperacion; if (dtDetalleCompra.Rows.Count > 0) { for (int i = 0; i < dtDetalleCompra.Rows.Count; i++) { if (dtDetalleCompra.Rows[i]["ArtCod"].ToString() == txtArtCod.Text) { dtDetalleCompra.Rows[i]["dtpPrecioVen"] = txtArtPreUnitario.Text; dtDetalleCompra.Rows[i]["dtpDscto"] = txtArtDescuento.Text; dtDetalleCompra.Rows[i]["dtpSubTotal"] = txtImpTotal.Text; break; } } } CalcularPago(dtDetalleCompra); g_dtDetOperacion = dtDetalleCompra; RellenarGrilla(ref dgvDetalleVenta, dtDetalleCompra, this.nNroDetPed); colDetOper.UpdatePrecio(this.nOpeCod, int.Parse(txtArtCod.Text), decimal.Parse(txtArtPreUnitario.Text)); colOper.Guardar(this, gcOpeTipo, ref ndopCod, ref ntcmCod); //GUARDAR OPERACION lbldopCod.Value = ndopCod.ToString(); lbltcmCod.Value = ntcmCod.ToString(); } else { ModalPopupAgregar.Show(); MessageBox(cMensaje); } } catch (Exception ex) { MessageBox(ex.Message); } }
protected void btnProcesar_Click(object sender, EventArgs e) { string cMensaje = ""; DataTable dtResultado = null; clsOperaciones lstOperaciones = new clsOperaciones(); DateTime dFecIni = DateTime.Today; DateTime dFecFin = DateTime.Today; int prvCod = 0; try { if (ValidarDatos(ref cMensaje)) { prvCod = int.Parse(ddlProveedor.SelectedValue); switch (ddlReportes.SelectedValue) { case ("PG"): if (chkPorFecha.Checked) { dFecIni = DateTime.Parse(txtFecIni.Text); dFecFin = DateTime.Parse(txtFecFin.Text); } dtResultado = lstOperaciones.RepComprasProveedorGeneral(prvCod, chkPorFecha.Checked, dFecIni, dFecFin); break; case ("CPM"): if (chkPorMes.Checked) { dFecIni = DateTime.Parse(ddlMeses.SelectedValue); } dtResultado = lstOperaciones.RepComprasProveedorXMes(prvCod, chkPorMes.Checked, dFecIni); break; } if (dtResultado.Rows.Count > 0) { SetEstado("PRO"); string cMes = "TODOS"; if (chkPorMes.Checked) cMes = ddlMeses.SelectedItem.Text; AgregarVariableSession("dtRepProveedores", dtResultado); AgregarVariableSession("nTipCam", txtTipCam.Text); AgregarVariableSession("cMes", cMes); } else SetEstado("ERR"); } else { MessageBox(cMensaje); } } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message); } }
protected void btnProcesar_Click(object sender, EventArgs e) { clsOperaciones colOperaciones = new clsOperaciones(); try { CreateGrid(); } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message); } }
protected void btnGuardarDocu_Click(object sender, EventArgs e) { oThread = new Thread(delegate() { Esperar(1000); }); oThread.Start(); long ndopCod = 0; int ntcmCod = 0; clsOperaciones lstOperaciones = new clsOperaciones(); try { txtDescuento.Text = txtDesEspec.Text; lstOperaciones.Guardar(this, gcOpeTipo, ref ndopCod, ref ntcmCod); //GUARDAR OPERACION lbldopCod.Value = ndopCod.ToString(); lbltcmCod.Value = ntcmCod.ToString(); HabilitarBtn(btnProcesar, true); oThread.Join(); if (sender != btnProcesar) { MessageBox("La Operacion de Venta se Guardo con Exito "); } lblProceso.Value = "EDIT"; SetPanelDocumento((int)nOpeCod); pnDocumentos.Visible = true; } catch (Exception ex) { oThread.Abort(); MessageBox("Error Interno: " + ex.Message); } }
protected void btnGuardar_Click(object sender, EventArgs e) { string cMensaje = ""; try { if (ValidarDatos("OPE", ref cMensaje)) { txtFleteTra.Text = Math.Round(GetNumero(txtSubTotal.Text) / 100, 2).ToString(); txtFlete.Text = SetFormatNum(Math.Round(GetNumero(txtSubTotal.Text) / 100, 2)); if (lblProceso.Value == "NEW") { clsOperaciones lstOperaciones = new clsOperaciones(); long nOpeCod = lstOperaciones.MaxOpeCod() + 1; lblNroPedido.Text = nOpeCod.ToString().PadLeft(10, '0'); if (ddlTransportistas.Items.Count == 2) { ddlTransportistas.SelectedIndex = 1; ddlTransportistas_SelectedIndexChanged(sender, e); } txtDesEspec.Text = "0.0"; ddlVendedores.SelectedValue = ddlListaVendedores.SelectedValue; ddlVendedores.Enabled = false; ModalPopupGirarCompra.Show(); } else if (lblProceso.Value == "EDIT") { btnGuardarDocu_Click(sender, e); } } else { MessageBox(cMensaje); } } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message); } }
protected void btnProcesar_Click(object sender, EventArgs e) { string cMensaje = ""; clsOperaciones lstOperaciones = new clsOperaciones(); long ndopCod = 0; int ntcmCod = 0; try { if (ValidarDatos("OPE", ref cMensaje,"PROC")) { if (lblProceso.Value == "NEW") { txtFleteTra.Text = Math.Round(GetNumero(txtSubTotal.Text) / 100, 2).ToString(); txtFlete.Text = SetFormatNum(Math.Round(GetNumero(txtSubTotal.Text) / 100, 2)); long nOpeCod = lstOperaciones.MaxOpeCod() + 1; lblNroPedido.Text = nOpeCod.ToString().PadLeft(10, '0'); txtDesEspec.Text = "0.0"; } lstOperaciones.Procesar(this, gcOpeTipo, ref ndopCod, ref ntcmCod); lbldopCod.Value = ndopCod.ToString(); lbltcmCod.Value = ntcmCod.ToString(); lblOpeEstado.Value = "P"; bDetallesChanged = 0; GuardarDtCabeceraDocumento(); MessageBox("La Operacion fue Procesada con Exito, Ahora puede imprimir."); //NUEVO: asigna funcion a botón IMPRIMIR AsignarFuncionBotonImprimir(); lblProceso.Value = "EDIT"; SetBotones(lblProceso.Value); ConfigurarDocumento(); /*generacion automatica de la letra*/ string valor = lblTipoDoc.Value; if (valor == "3" && ddlTipCiclo.SelectedValue == "D" && chkletra.Checked == true) { int cuotas = 1; int icodigo, idetcodigo; Double monto_total = Double.Parse(txtTotal.Text.ToString().Substring(3)); Double monto_nota = 0.00; String moneda; try { clsLetra _Letra = new clsLetra(); letra obj = new letra(); icodigo = Convert.ToInt32(_Letra.MaxOpeCod() + 1); obj.icodigo = icodigo; moneda = ddlMoneda.SelectedValue; obj.icodigo = icodigo; obj.itotcuota = cuotas; obj.nmontocuota = Convert.ToDecimal(monto_total); obj.cmoneda = moneda; obj.nintpag = Convert.ToDecimal(0.00); obj.iestado = "1"; obj.dfeccreacion = DateTime.Today; obj.dfecmod = DateTime.Today; obj.ctippago = "D"; obj.nmntnota = Convert.ToDecimal(monto_nota); _Letra.fnletraInsertar(obj); clsdetletra _detletra = new clsdetletra(); det_letra _detobj = new det_letra(); _detobj.icodletra = icodigo; _detobj.inumletra = 1; _detobj.cnumletra = "-"; _detobj.ccodletra = "-"; _detobj.nmonto = Convert.ToDecimal(monto_total); _detobj.cestado = "1"; _detobj.ninteres = Convert.ToDecimal(0.00); _detobj.dfecvenc = Convert.ToDateTime(txtFecha.Text).AddDays(Convert.ToInt16(this.txtCiclo.Text)); _detobj.dfecmod = DateTime.Today; idetcodigo = Convert.ToInt32(_detletra.Maxdetletra_cod()) + 1; _detobj.idetletra = idetcodigo; _detletra.fndet_letraInsertar(_detobj); clsDocumenOperacion _docobj = new clsDocumenOperacion(); DocumenOperacion _docope = new DocumenOperacion(); _docope = _docobj.GetDocumenOperaciona(dopcod_letra); _docope.icodletra = icodigo; _docobj.fnDocOpeUpdate(_docope); } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message); } } } else { MessageBox(cMensaje); } } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message + ex.InnerException.Message); } }