private void dgvMATERIALES_CellClick(object sender, DataGridViewCellEventArgs e) { dgvUPDATED.Enabled = true; oPEPE = (MODELO.Occantmat)dgvMATERIALES.CurrentRow.DataBoundItem; oUpdated = new MODELO.RemitoUpdated(); oUpdated.nroOrden = oPEPE.ordercompra; oUpdated.material = oPEPE.material; oUpdated.remito = txtNROREMITO.Text; //oUpdated.material.DESCRIPCION_CORTA = oPEPE.material; //oUpdated.Material = oPEPE.cantidadmat.Material.DESCRIPCION_CORTA; txtCANTIDAD.Enabled = true; }
private void btnAGREGAR_Click(object sender, EventArgs e) { if (dgvOCM.Rows.Count == 0) { MessageBox.Show("La orden de Compra se encuentra vacia, por favor ingrese un material"); return; } if (DateTime.Now >= dtpFECHARECEPCION.Value) { MessageBox.Show("La fecha de Recepcion debe ser posterior a la fecha actual"); return; } if (string.IsNullOrEmpty(txtNROORDEN.Text)) { MessageBox.Show("Debe ingresar un numero de orden"); return; } if (string.IsNullOrEmpty(txtPROVEEDOR.Text)) { MessageBox.Show("Debe seleccionar un proveedor"); return; } if (string.IsNullOrEmpty(dtpFECHARECEPCION.Text)) { MessageBox.Show("Debe ingresar una fecha de recepcion"); return; } oORDEN.NroOrden = txtNROORDEN.Text; //oORDEN.Proveedor = oPROVEEDOR.razonSocial; oORDEN.Proveedor = provedoransiovich; oORDEN.Localidad = oPROVEEDOR.Localidad.ToString(); //oORDEN.Proveedor =; //oORDEN.Proveedor = (MODELO.Proveedor)ToString(); // oORDEN.Proveedor = txtPROVEEDOR.Text; ///////////////////////////////////////////////////////////////////////////////// oORDEN.Fecha = DateTime.Now; oORDEN.Fecha_Recepcion = dtpFECHARECEPCION.Value; oORDEN.Importe = Convert.ToDecimal(totalivadesc); // oORDEN.CantidadesMat.Add(oCANTMAT); //foreach (MODELO.CantidadMat item in listaCantMateriales.ToList()) //{ // MODELO.CantidadMat mat = new MODELO.CantidadMat(); // mat.Material = item.Material; // mat.Cantidad_mat = item.Cantidad_mat; // cCantMat.agregarCantMat(mat); // listaCantMateriales.Add(mat); // //oORDEN.CantidadesMat.Add(mat); // // item.OrdenCompra.Add(oORDEN); // // cCantMat.modificarCantMat(item); // //oORDEN.CantidadesMat.Add(item); // // cOrden.modificarOrden(oORDEN); //} oORDEN.visibily = true; cOrden.agregarOrden(oORDEN); MODELO.Occantmat Occantmat = new MODELO.Occantmat(); foreach (MODELO.CantidadMat item in listaCantMateriales) { Occantmat.cantidadmat = item; Occantmat.cantidadmat.cantidad_base = item.cantidad_base; Occantmat.ordercompra = oORDEN; Occantmat.material = item.Material.DESCRIPCION_CORTA; cOccantmat.agregarOccantmat(Occantmat); } AGREGAR_AUDITORIA("Alta", oORDEN); this.DialogResult = DialogResult.OK; }
public void modificarOcanmat(MODELO.Occantmat oOccantmat) { oMODELO_SEGURIDAD.Entry(oOccantmat).State = System.Data.Entity.EntityState.Modified; oMODELO_SEGURIDAD.SaveChanges(); }
public void agregarOccantmat(MODELO.Occantmat oOccantmat) { oMODELO_SEGURIDAD.OccantmatS.Add(oOccantmat); oMODELO_SEGURIDAD.SaveChanges(); }