private void btnELIMINAR_Click(object sender, EventArgs e) { if (dgvMATERIALES.CurrentRow == null) { MessageBox.Show("Debe seleccionar un material"); return; } MODELO.Materiales oMATERIAL = (MODELO.Materiales)dgvMATERIALES.CurrentRow.DataBoundItem; DialogResult dr = MessageBox.Show("¿Confirma que desea eliminar " + oMATERIAL.DESCRIPCION_LARGA + "?", "CONFIRMA", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { MODELO.AuditoriaMateriales oAuditoria = new MODELO.AuditoriaMateriales(); oAuditoria.FechayHora = System.DateTime.Now; oAuditoria.Movimiento = "Baja"; oAuditoria.Username = "******"; oAuditoria.COD_MATERIAL = oMATERIAL.COD_MATERIAL; oAuditoria.DESCRIPCION_CORTA = oMATERIAL.DESCRIPCION_CORTA; oAuditoria.DESCRIPCION_LARGA = oMATERIAL.DESCRIPCION_LARGA; oAuditoria.ULTIMA_MODIFICACION = oMATERIAL.ULTIMA_MODIFICACION; oAuditoria.PUC = oMATERIAL.PUC; oAuditoria.MAXIMO = oMATERIAL.MAXIMO; oAuditoria.MINIMO = oMATERIAL.MINIMO; //oAuditoria.CLASE = oMATERIAL.CLASE; // oAuditoria.SUBCLASE = oMATERIAL.SUBCLASE; // oAuditoria.PROVEEDOR = oMATERIAL.PROVEEDOR; oAuditoria.GANANCIA = oMATERIAL.GANANCIA; //// oAuditoria.IVA = oMATERIAL.IVA; oAuditoria.STOCK = oMATERIAL.STOCK; cAuditoria.AGREGAR_AUDITORIA(oAuditoria); cMateriales.eliminarMateriales(oMATERIAL); ARMO_GRILLA(); } }
public void AGREGAR_AUDITORIA(string movimiento, MODELO.Materiales oMATERIAL) { MODELO.AuditoriaMateriales oAuditoria = new MODELO.AuditoriaMateriales(); oAuditoria.FechayHora = System.DateTime.Now; oAuditoria.Movimiento = movimiento; oAuditoria.Username = "******"; oAuditoria.COD_MATERIAL = oMATERIAL.COD_MATERIAL; oAuditoria.DESCRIPCION_CORTA = oMATERIAL.DESCRIPCION_CORTA; oAuditoria.DESCRIPCION_LARGA = oMATERIAL.DESCRIPCION_LARGA; oAuditoria.ULTIMA_MODIFICACION = oMATERIAL.ULTIMA_MODIFICACION; oAuditoria.PUC = oMATERIAL.PUC; oAuditoria.MAXIMO = oMATERIAL.MAXIMO; oAuditoria.MINIMO = oMATERIAL.MINIMO; // oAuditoria.CLASE = oMATERIAL.CLASE; // oAuditoria.SUBCLASE = oMATERIAL.SUBCLASE; // oAuditoria.PROVEEDOR = oMATERIAL.PROVEEDOR; oAuditoria.GANANCIA = oMATERIAL.GANANCIA; ///// oAuditoria.IVA = oMATERIAL.IVA; oAuditoria.STOCK = oMATERIAL.STOCK; cAuditoria.AGREGAR_AUDITORIA(oAuditoria); }
public void MODIFICAR_AUDITORIA(MODELO.AuditoriaMateriales oAUDITORIA) { oMODELO_SEGURIDAD.Entry(oAUDITORIA).State = System.Data.Entity.EntityState.Modified; oMODELO_SEGURIDAD.SaveChanges(); }
public void ELIMINAR_AUDITORIA(MODELO.AuditoriaMateriales oAUDITORIA) { oMODELO_SEGURIDAD.AUDITORIAMATERIALES.Remove(oAUDITORIA); oMODELO_SEGURIDAD.SaveChanges(); }
public void AGREGAR_AUDITORIA(MODELO.AuditoriaMateriales oAUDITORIA) { oMODELO_SEGURIDAD.AUDITORIAMATERIALES.Add(oAUDITORIA); oMODELO_SEGURIDAD.SaveChanges(); }