public static Guia_Detalle Create(Guia_Detalle p) { DatosDataContext bd = new DatosDataContext(); try { //Categoria p = new C> // p.IdProveedor = not.IdProveedor; //p.CedProveedor = not.CedProveedor;> //p.Nombre = not.Nombre;> //p.Representante = not.Representante;> //p.Direccion = not.Direccion;> //p.Ciudad = not.Ciudad;> //p.Telefono = not.Telefono;> //p.Fax = not.Fax;> bd.spInsertarGuiaDetalle(p.idGuia, p.idProducto, p.precioventa, p.cantidad); bd.SubmitChanges(); } catch (DatosExcepciones ex) { throw new DatosExcepciones("Error al Insertar Proveedor.", ex); } finally { bd = null; } return(p); }
private void btnAlmacenarclick(object sender, EventArgs e) { Guia tem = new Guia(); tem.idGuia = int.Parse(txtidguia.Text); tem.idLocal = int.Parse(txtidlocal.Text); tem.fechaSalida = DateTime.Parse(lbl_DATE.Text); tem.idTransportista = int.Parse(lblidtrans.Text); tem.total = decimal.Parse(lbl_Total.Text); OPGuiaLN.InsertarGuia(tem); for (int i = 0; i < dataGridView1.RowCount - 1; i++) { Guia_Detalle guiadetalle = new Guia_Detalle(); guiadetalle.idGuia = tem.idGuia; guiadetalle.idProducto = int.Parse(dataGridView1.Rows[i].Cells[1].Value.ToString()); guiadetalle.cantidad = short.Parse(dataGridView1.Rows[i].Cells[3].Value.ToString()); guiadetalle.precioventa = decimal.Parse(dataGridView1.Rows[i].Cells[4].Value.ToString()); OPGuiaDetalleLN.InsertarGuiaDetalle(guiadetalle); } }
public bool InsertarGuiaDetalle(Guia_Detalle p) { GuiaDetalleCD.Create(p); return(true); }