public C_establecer_crud(Vo_rol rol = null) { frm = new Capa_Vista.frm_establish_crud(); c_message = C_message.getInstancia(); message_box = c_message.formulario(); InitializeEvents(); }
public bool UPDATE(Vo_rol rol) { try { MySqlCommand cmd = new MySqlCommand("sp_updateRole", cnSql); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", rol.Clave); cmd.Parameters.AddWithValue("@nombre", rol.Nombre); if (cnSql.State == ConnectionState.Open) { cnSql.Close(); } cnSql.Open(); if (cmd.ExecuteNonQuery() > 0) { return(true); } else { return(false); } } catch (Exception ex) { MessageBox.Show("Ocurrio un error", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Error); cnSql.Close(); return(false); } finally { cnSql.Close(); } }
public DataTable SEARCH(Vo_rol rol) { MySqlCommand cmd = new MySqlCommand("sp_searchRole", cnSql); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@termino", rol.Expresion); MySqlDataAdapter da = new MySqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); return(dt); }
public bool UPDATE(Vo_rol rol) { if (m_rol == null) { m_rol = new M_rol(); return(m_rol.UPDATE(rol)); } else { return(m_rol.UPDATE(rol)); } }
public DataTable SEARCH(Vo_rol rol) { if (m_rol == null) { m_rol = new M_rol(); return(m_rol.SEARCH(rol)); } else { return(m_rol.SEARCH(rol)); } }
public C_rol_crud(Vo_rol rol = null) { frm = new Capa_Vista.frm_role_crud(); c_message = C_message.getInstancia(); message_box = c_message.formulario(); vo_rol.Operacion = "insert"; InitializeEvents(); if (rol != null) { vo_rol.Clave = rol.Clave; vo_rol.Operacion = rol.Operacion; frm.txtName.Text = rol.Nombre; } }