private void sbrModifCampoLineas(string vCampo, string vValor) { cPedidosVenta.LinVenta linp = (cPedidosVenta.LinVenta)bS2.Current; if (linp.aCampoModif != "") { vCampo = linp.aCampoModif; } if (linp.aValor != "") { vValor = linp.aValor; } if (!linp.fncGrabaCampo(vCampo, vValor)) { if ((linp.aError != "") & (linp.aError != null)) { MessageBox.Show(linp.aError); } bS2.CancelEdit(); } if (vCampo == "Producto") { sbrActuProd(vValor); } }
private void grPrep_CellValidated(object sender, DataGridViewCellEventArgs e) { string vVal = "0"; try { vVal = grPrep.Rows[e.RowIndex].Cells["Prioridad"].Value.ToString(); } catch { } cPedidosVenta.LinVenta oLinventa = new cPedidosVenta.LinVenta(); oLinventa.Id = Convert.ToInt32(txID.Text); oLinventa.ValAnt = txPrio.Text; if (oLinventa.fncGrabaCampo("Prioridad", vVal)) { } }
private void btCambiar_Click(object sender, EventArgs e) { string vMen = "Se cambiara la prioridad de la lina selecionada.Esta seguro?"; string vTit = "Prioridades"; if (MessageBox.Show(vMen, vTit, MessageBoxButtons.YesNo) == DialogResult.No) { return; } cPedidosVenta.LinVenta oLinventa = new cPedidosVenta.LinVenta(); oLinventa.Id = Convert.ToInt32(txID.Text); oLinventa.ValAnt = txPrio.Text; if (oLinventa.fncGrabaCampo("Prioridad", upPrio.Value.ToString())) { sbrCargar(); } }
private void btGrabar_Click(object sender, EventArgs e) { if (lbSitu.Text == "Modificación") { if (txCanSer.Text != "") { decimal vCanSer = Convert.ToDecimal(txCanSer.Text); decimal vCan = Convert.ToDecimal(txCan.Text); if (vCan < vCanSer) { MessageBox.Show("La cantidad no puede ser menor que la cantidad servida"); return; } } cPedidosVenta.LinVenta cLinVenta = new cPedidosVenta.LinVenta(); DataGridViewRow dr = grLinPed.CurrentRow; int vId = Convert.ToInt32(dr.Cells["Id"].Value.ToString()); cLinVenta.Id = vId; string vCT = txProd.Tag.ToString(); string vTx = txProd.Text; string vVal = dr.Cells[vCT].Value.ToString(); if (vTx != vVal) { cLinVenta.fncGrabaCampo(vCT, vTx); } vCT = txDesProd.Tag.ToString(); vTx = txDesProd.Text; vVal = dr.Cells[vCT].Value.ToString(); if (vTx != vVal) { cLinVenta.fncGrabaCampo(vCT, vTx); } vCT = txPrecio.Tag.ToString(); vTx = txPrecio.Text; vVal = dr.Cells[vCT].Value.ToString(); if (vTx != vVal) { cLinVenta.fncGrabaCampo(vCT, vTx); } vCT = txIva.Tag.ToString(); vTx = txIva.Text; vVal = dr.Cells[vCT].Value.ToString(); if (vTx != vVal) { cLinVenta.fncGrabaCampo(vCT, vTx); } vCT = txCan.Tag.ToString(); vTx = txCan.Text; vVal = dr.Cells[vCT].Value.ToString(); if (vTx != vVal) { cLinVenta.fncGrabaCampo(vCT, vTx); } vCT = dTEntrega.Tag.ToString(); vTx = dTEntrega.Text; vVal = dr.Cells[vCT].Value.ToString(); if (vTx != vVal) { cLinVenta.fncGrabaCampo(vCT, vTx); } vCT = txLote.Tag.ToString(); vTx = txLote.Text; vVal = dr.Cells[vCT].Value.ToString(); if (vTx != vVal) { cLinVenta.fncGrabaCampo(vCT, vTx); } sbrCargaLineas(txPed.Text); sbrLimpiaEnt(); txProd.Focus(); } if (lbSitu.Text == "Alta") { if (txProd.Text == "") { MessageBox.Show("El Producto NO esta informado"); txProd.Focus(); return; } if ((txCan.Text == "") | (txCan.Text == "0")) { MessageBox.Show("La cantidad NO esta informada"); txCan.Focus(); return; } if (fncAltaLinea()) { sbrCargaLineas(txPed.Text); sbrLimpiaEnt(); txProd.Focus(); } } }