protected void dgvDocumentos_SelectedIndexChanged(object sender, EventArgs e) { long ndopCod = 0; if (lblOpeEstado.Value.Trim() == "R") { clsDocumenOperacion lstDocumenOpe = new clsDocumenOperacion(); lstDocumenOpe.Guardar(this, ref ndopCod); lbldopCod.Value = ndopCod.ToString(); } int nDopCod = int.Parse(dgvDocumentos.Rows[dgvDocumentos.SelectedIndex].Cells[1].Text); string cDopDescri = dgvDocumentos.Rows[dgvDocumentos.SelectedIndex].Cells[2].Text; CargarCamposDocumento(nDopCod, cDopDescri); }
protected void btnAceptarNuevoDoc_Click(object sender, EventArgs e) { try { if (txtNroDocu.Text != "") { lblTipoDoc.Value = ddlTipoDocu.SelectedValue; lblDescriDocumento.Text = ddlTipoDocu.SelectedItem.Text; lblNroDocumento.Text = txtNroSerie.Text + " - " + txtNroDocu.Text; if (lblProceso.Value == "NEW") { HabilitarCampos(true); g_dtDetOperacion.Rows.Clear(); RellenarGrilla(ref dgvDetalleVenta, g_dtDetOperacion, this.nNroDetPed); CargarCombos(); CargarClientes(); txtDireccion.Enabled = false; txtDocCli.Enabled = false; txtTelefono.Enabled = false; txtSubTotal.Text = "0.00"; txtDescuento.Text = "0.00"; txtFlete.Text = "0.00"; txtIgv.Text = "0.00"; txtTotal.Text = "0.00"; txtFecha.Text = DateTime.Today.ToString("yyyy-MM-dd"); SetBotones(lblProceso.Value); } else if (lblProceso.Value == "NEWDOC") { clsDocumenOperacion lstDocumenOpe = new clsDocumenOperacion(); long ndopCod = 0; int OpeCod = int.Parse(lblNroPedido.Text); lstDocumenOpe.Guardar(this, ref ndopCod); lbldopCod.Value = ndopCod.ToString(); SetPanelDocumento(OpeCod); lblProceso.Value = "EDIT"; } } else { MessageBox("Debe poner un Numero de Documento"); } } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message); } }
protected void btnAceptarNuevoDoc_Click(object sender, EventArgs e) { try { clsDocumenOperacion colDocumenOpe = new clsDocumenOperacion(); if (colDocumenOpe.ValidarDocumento(txtNroSerie.Text, txtNroDocu.Text)) { MessageBox("Este Nro de Documento Ya se Registro"); ModalPopupNuevoDocumento.Show(); return; } if (txtNroDocu.Text != "") { lblTipoDoc.Value = ddlTipoDocu.SelectedValue; //GUARDA EL TIPO DE DOC EN VARIABLE SESSION this.AgregarVariableSession("lblTipoDoc", lblTipoDoc.Value ); lblDescriDocumento.Text = ddlTipoDocu.SelectedItem.Text; lblNroDocumento.Text = txtNroSerie.Text + " - " + txtNroDocu.Text; if (lblProceso.Value == "NEW") { HabilitarCampos(true); g_dtDetOperacion.Rows.Clear(); RellenarGrilla(ref dgvDetalleVenta, g_dtDetOperacion, this.nNroDetPed); CargarCombos(); CargarClientes(); txtDireccion.Enabled = false; txtDocCli.Enabled = false; txtTelefono.Enabled = false; txtSubTotal.Text = "0.00"; txtDescuento.Text = "0.00"; txtFlete.Text = "0.00"; txtIgv.Text = "0.00"; txtTotal.Text = "0.00"; bDetallesChanged = 0; txtFecha.Text = DateTime.Today.ToString("yyyy-MM-dd"); SetBotones(lblProceso.Value); ConfigurarDocumento(); } else if (lblProceso.Value == "NEWDOC") { long ndopCod = 0; int OpeCod = int.Parse(lblNroPedido.Text); colDocumenOpe.Guardar(this, ref ndopCod); lbldopCod.Value = ndopCod.ToString(); SetPanelDocumento(OpeCod); lblProceso.Value = "EDIT"; dgvDocumentos_SelectedIndexChanged(sender, e); } } else { MessageBox("Debe poner un Numero de Documento"); } } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message); } }