public void anular() { if (_Accion == Cl_Enumeradores.eTipo_action.Anular) { string mensajeRecurso = ""; try { if (MessageBox.Show("Esta Seguro que desea eliminar el Item", param.Nombre_sistema, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { Core.Erp.Winform.General.FrmGe_MotivoAnulacion omot = new General.FrmGe_MotivoAnulacion(); omot.ShowDialog(); MoviInveI.MotiAnula = omot.motivoAnulacion; if (moviB.AnularDB(MoviInveI)) { ucGe_Menu.Enabled_bntAnular = false; mensajeRecurso = Core.Erp.Recursos.Properties.Resources.msgConfirmaAnulacionOk; MessageBox.Show(mensajeRecurso, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No se Anulado", "Operación Fallida"); } } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
Boolean Anular() { try { if (MessageBox.Show("Esta Seguro que desea elminar el Item ", "Sistemas", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { Core.Erp.Winform.General.FrmGe_MotivoAnulacion ofrmMot = new General.FrmGe_MotivoAnulacion(); ofrmMot.ShowDialog(); Info_ProductoTipo.MotivoAnulacion = ofrmMot.motivoAnulacion; string msg = ""; string mensajeRecurso = ""; if (Bus_ProductoTipo.EliminarDB(Info_ProductoTipo, ref msg)) { mensajeRecurso = Core.Erp.Recursos.Properties.Resources.msgConfirmaAnulacionOk; MessageBox.Show(mensajeRecurso, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information); lblAnulado.Visible = true; ucGe_Menu.Enabled_bntAnular = false; return(true); } else { MessageBox.Show("Error al Anular " + msg, "Sistemas"); return(false); } } return(true); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } }
void Anular() { try { get_categoria(); infoCat.IdUsuarioUltAnu = param.IdUsuario; infoCat.Fecha_UltAnu = param.Fecha_Transac; Core.Erp.Winform.General.FrmGe_MotivoAnulacion ofrm = new General.FrmGe_MotivoAnulacion(); ofrm.ShowDialog(); infoCat.MotiAnula = ofrm.motivoAnulacion; if (BusCat.AnularDB(infoCat, ref mensaje)) { string smensaje = string.Format(Core.Erp.Recursos.Properties.Resources.msgDespues_Anular, "La Categoria", infoCat.IdCategoria); MessageBox.Show(smensaje, param.Nombre_sistema); lblAnulado.Visible = true; ucGe_Menu.Visible_bntAnular = false; } else { string smensaje = string.Format(Core.Erp.Recursos.Properties.Resources.msgError_Anular); MessageBox.Show(smensaje, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void ucGe_Menu_Mantenimiento_x_usuario_event_btnAnular_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { string mensaje = ""; moviI = gridView_tipoMovi_Inven.GetFocusedRow() as in_movi_inven_tipo_Info; // if (moviI.IdMovi_inven_tipo == 0) if (moviI == null) { MessageBox.Show("Seleccione un registro", "sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } else if (moviB.Cons_MovimientoInventario(moviI, ref mensaje)) { MessageBox.Show(mensaje); } else if (moviI.cm_interno == "S") { MessageBox.Show("No se procedió con la Anulación porque es Usado Por El Sistema", "Informativo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (moviI.Estado == "I") { MessageBox.Show("No se procedió con la Anulación porque ya está Anulado", "Informativo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (MessageBox.Show("¿Está seguro que desea anular dicho Movimiento Tipo Inventario ?", "Anulación de Movimiento Tipo Inventario", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Core.Erp.Winform.General.FrmGe_MotivoAnulacion omot = new General.FrmGe_MotivoAnulacion(); omot.ShowDialog(); FrmIn_Tipo_Movi_Inven_Mantenimiento frm = new FrmIn_Tipo_Movi_Inven_Mantenimiento(); frm.set_Accion(Cl_Enumeradores.eTipo_action.Anular); moviI = gridView_tipoMovi_Inven.GetFocusedRow() as in_movi_inven_tipo_Info; frm.MoviInveI = moviI; moviI.MotiAnula = omot.motivoAnulacion; // in_movi_inven_tipo_Bus moviB = new in_movi_inven_tipo_Bus(); if (moviB.AnularDB(moviI)) { MessageBox.Show("Anulado ok", "Operación Exitosa"); } else { MessageBox.Show("No se ha Anulado", "Operación Fallida"); } cargar_grid(); } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private bool AnularDB() { try { bool res = false; info_Cat.IdUsuarioUltAnu = param.IdUsuario; Core.Erp.Winform.General.FrmGe_MotivoAnulacion ofrm = new General.FrmGe_MotivoAnulacion(); ofrm.ShowDialog(); info_Cat.MotiAnula = ofrm.motivoAnulacion; if (Bus_Cat.AnularDB(info_Cat, ref mensaje)) { info_Cat.categoria_CG_Info.IdUsuarioUltAnu = param.IdUsuario; info_Cat.categoria_CG_Info.MotiAnula = ofrm.motivoAnulacion; res = Bus_CategoriaCG.AnularDB(info_Cat.categoria_CG_Info, ref mensaje); if (res) { MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Se_Anulo_Correctamente) + " la categoría " + info_Cat.IdCategoria, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + " " + mensaje, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + " " + mensaje, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } return(res); } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; NameMetodo = NameMetodo + " - " + ex.ToString(); MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); return(false); } }