private void dgvDetalle__CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { DataGridViewRow dRow = dgvDetalle_.Rows[e.RowIndex]; _drow = dRow.Index.ToString(); EIngresoDetalle obj = new EIngresoDetalle(); obj.IdIngreso = txtidIngreso.Text; string fecha = txtfecha.Value.Date.ToShortDateString(); obj.fecha = fecha; obj.Nu_Item = (dRow.Cells["Item"].Value == null) ? "" : dRow.Cells["Item"].Value.ToString(); obj.Nu_tf = (dRow.Cells["nu_tf"].Value == null) ? "" : dRow.Cells["nu_tf"].Value.ToString(); obj.Nu_op = (dRow.Cells["nu_op"].Value == null) ? "" : dRow.Cells["nu_op"].Value.ToString(); obj.Id_mercado = (dRow.Cells["_Id_mercado"].Value == null) ? "" : dRow.Cells["_Id_mercado"].Value.ToString(); obj.Id_tipTela = (dRow.Cells["_Id_TipTela"].Value == null) ? "" : dRow.Cells["_Id_TipTela"].Value.ToString(); obj.Id_Tipo = (dRow.Cells["id_tipo"].Value == null) ? "" : dRow.Cells["id_tipo"].Value.ToString(); obj.Id_TipIngreso = (dRow.Cells["tipo_ingreso"].Value == null) ? "" : dRow.Cells["tipo_ingreso"].Value.ToString(); obj.Id_clipro = (dRow.Cells["iDCliente"].Value == null) ? "" : dRow.Cells["iDCliente"].Value.ToString(); obj.ds_clipro = (dRow.Cells["nom_cliente"].Value == null) ? "" : dRow.Cells["nom_cliente"].Value.ToString(); obj.Id_producto = (dRow.Cells["iDProducto"].Value == null) ? "" : dRow.Cells["iDProducto"].Value.ToString(); obj.ds_producto = (dRow.Cells["dsProducto"].Value == null) ? "" : dRow.Cells["dsProducto"].Value.ToString(); obj.Id_color = (dRow.Cells["iDcolor"].Value == null) ? "" : dRow.Cells["iDcolor"].Value.ToString(); obj.ds_color = (dRow.Cells["dsColor"].Value == null) ? "" : dRow.Cells["dsColor"].Value.ToString(); obj.Qt_rollo = (dRow.Cells["qt_rollo"].Value == null) ? 0 : Convert.ToInt16(dRow.Cells["qt_rollo"].Value.ToString()); obj.Qt_peso_desp = (dRow.Cells["qt_peso_desp"].Value == null) ? 0 : Convert.ToDecimal(dRow.Cells["qt_peso_desp"].Value.ToString()); obj.Qt_ancho = (dRow.Cells["qt_ancho"].Value == null) ? 0 : Convert.ToDecimal(dRow.Cells["qt_ancho"].Value.ToString()); obj.Qt_densidad = (dRow.Cells["qt_densidad"].Value == null) ? 0 : Convert.ToDecimal(dRow.Cells["qt_densidad"].Value.ToString()); obj.id_Vendedor = (dRow.Cells["_id_Vendedor"].Value == null) ? string.Empty : (dRow.Cells["_id_Vendedor"].Value.ToString()); obj.Ds_Vendedor = (dRow.Cells["_dsVendedor"].Value == null) ? string.Empty : (dRow.Cells["_dsVendedor"].Value.ToString()); frmProductoPopup frm = new frmProductoPopup(); frm.FormParent = this; frm.EstadoDet = 2; frm._idIngreso = txtidIngreso.Text; frm.LLenarCampos(obj); frm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmIngreso_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.N && e.Control) { nuevo(); } else if (e.KeyCode == Keys.G && e.Control) { Grabar(); } else if (e.KeyCode == Keys.C && e.Control) { } else if (e.KeyCode == Keys.P && e.Control) { } else if (e.KeyCode == Keys.B && e.Control) { FrmIngreso_qry frmoc = new FrmIngreso_qry(); frmoc.pasard += new FrmIngreso_qry.pasar(EjecutarIngreso); frmoc.ShowDialog(); } else if (e.KeyCode == Keys.E && e.Control) { } else if (e.KeyCode == Keys.Escape) { //this.Close(); } else if (e.KeyCode == Keys.I && e.Control) { frmProductoPopup frmps = new frmProductoPopup(); frmps.FormParent = this; frmps.EstadoDet = 1; frmps.ShowDialog(); } }
private void btnNuevoRow_Click(object sender, EventArgs e) { try { //********************************************************************************************** frmProductoPopup frmps = new frmProductoPopup(); frmps.FormParent = this; frmps.EstadoDet = 1; frmps.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }