public void Grabar() { try { Aca_Profesor_Info profInfo = new Aca_Profesor_Info(); string mensaje = string.Empty; decimal id = 0; profInfo = Get_Profesor(ref mensaje); Aca_Profesor_Bus neg = new Aca_Profesor_Bus(); bool resultado = neg.GrabarDB(profInfo, ref id, ref mensaje); txtIdProfesor.Text = id.ToString(); if (resultado == true) { MessageBox.Show(mensaje, " Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information); this.ucGe_Menu.Visible_bntGuardar_y_Salir = false; this.ucGe_Menu.Visible_btnGuardar = false; } else { Log_Error_bus.Log_Error(mensaje.ToString()); MessageBox.Show("Error " + mensaje, "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.Message, "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public void Actualizar() { try { Aca_Profesor_Bus neg = new Aca_Profesor_Bus(); Aca_Profesor_Info profInfo = new Aca_Profesor_Info(); string mensaje = string.Empty; profInfo = Get_Profesor(ref mensaje); if (mensaje != "") { MessageBox.Show(mensaje); return; } bool resultado = neg.ActualizarDB(profInfo, ref mensaje); if (resultado) { MessageBox.Show(mensaje, "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information); this.ucGe_Menu.Visible_bntGuardar_y_Salir = false; this.ucGe_Menu.Visible_btnGuardar = false; } else { Log_Error_bus.Log_Error(mensaje.ToString()); MessageBox.Show("Error " + mensaje, "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception) { throw; } }
private void Anular() { try { string mensaje = string.Empty; if (profesorInfo.estado != "I") { if (MessageBox.Show("¿Está seguro que desea anular el Profesor # " + txtIdProfesor.Text.Trim() + " ?", "Anulación de Mantenimiento Profesor", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { FrmGe_MotivoAnulacion fr = new FrmGe_MotivoAnulacion(); fr.ShowDialog(); string motiAnulacion = fr.motivoAnulacion; Aca_Profesor_Bus neg = new Aca_Profesor_Bus(); Aca_Profesor_Info profInfo = new Aca_Profesor_Info(); profInfo = Get_Profesor(ref mensaje); if (mensaje != "") { MessageBox.Show("Error " + mensaje, "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information); } profInfo.MotivoAnulacion = motiAnulacion; profInfo.FechaAnulacion = DateTime.Now; bool resultado = neg.DeleteDB(profInfo, ref mensaje); if (resultado) { MessageBox.Show(mensaje, "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information); this.ucGe_Menu.Visible_bntGuardar_y_Salir = false; this.ucGe_Menu.Visible_btnGuardar = false; } else { Log_Error_bus.Log_Error(mensaje.ToString()); MessageBox.Show("Error " + mensaje, "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } else { MessageBox.Show("El Profesor " + txtIdProfesor.Text.Trim() + " ya se encuentra anulado ", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show("Error " + ex.Message.ToString(), "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public void llenar_grid() { try { List <Aca_Profesor_Info> lstProfesor = new List <Aca_Profesor_Info>(); Aca_Profesor_Bus neg = new Aca_Profesor_Bus(); lstProfesor = neg.Get_list_Profesor(param.IdInstitucion); gridControlProfesor.DataSource = lstProfesor; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public bool BuscarProfesor(ref string mensaje) { bool proceder = false; try { Aca_Profesor_Bus neg = new Aca_Profesor_Bus(); profesorInfo = neg.Get_Profesor_Info(txtCedula.Text.Trim()); if (profesorInfo.Persona_Info.IdPersona != null && profesorInfo.Base == "N") { return(true); } if (profesorInfo.Base == "S") { mensaje = "La cédula " + txtCedula.Text.Trim() + " ya se encuentra ingresada como Profesor"; } } catch (Exception ex) { mensaje = ex.Message.ToString(); MessageBox.Show(mensaje, "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(proceder); }