private void tsbEliminar_Click(object sender, EventArgs e) { int ID = ((Entidades.Materia)this.dgvMaterias.SelectedRows[0].DataBoundItem).IdMateria; MateriaLogic md = new MateriaLogic(); md.Delete(ID); this.Listar(); }
public MateriaDesktop(int ID, ModoForm modo) : this() { this.Modo = modo; MateriaLogic materia = new MateriaLogic(); MateriaActual = materia.GetOne(ID); MapearDeDatos(); }
protected void btnAceptar_Click(object sender, EventArgs e) { MateriaLogic ml = new MateriaLogic(); listmateria = ml.GetAll(listplan[ddlPlan.SelectedIndex].ID); this.gvPlan.DataSource = listmateria; this.gvPlan.DataBind(); this.gridPanel.Visible = true; }
public void Listar() { MateriaLogic ml = new MateriaLogic(); try { this.dgvMaterias.DataSource = ml.GetAll(); } catch (Exception Ex) { MessageBox.Show(Ex.Message); } }
public MateriaDesktop(int ID, ModoForm modo): this() { this.Modo = modo; MateriaLogic ml = new MateriaLogic(); try { MateriaActual = ml.GetOne(ID); } catch (Exception Ex) { this.Notificar(Ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); } this.MapearDeDatos(); }
public MateriaDesktop(ModoForm modo,int ID): this() { _modo=modo; MateriaLogic ml = new MateriaLogic(); MateriaActual = ml.GetOne(ID); this.MapearDeDatos(); switch(_modo) {case ModoForm.Modificacion: btnAceptar.Text = "Guardar"; break; case ModoForm.Baja: btnAceptar.Text = "Eliminar"; break; case ModoForm.Consulta: btnAceptar.Text = "Aceptar"; break; } }
public override void GuardarCambios() { MapearADatos(); MateriaLogic materia = new MateriaLogic(); materia.Save(MateriaActual); }
private void btnAceptar_Click(object sender, EventArgs e) { if (btnAceptar.Text == "Guardar") { if (Validar()) { GuardarCambios(); Plan planSeleccionado = listplan[cmbIDPlan.SelectedIndex]; MateriaActual.State = Entidad.States.Modificado; this.Close(); } } if (btnAceptar.Text == "Eliminar") { MateriaLogic mat = new MateriaLogic(); mat.Delete(MateriaActual.ID); MateriaActual.State = Entidad.States.Eliminado; this.Close(); } }
public void GuardarCambios() { this.MapearADatos(); MateriaLogic Materia = new MateriaLogic(); try { Materia.Save(MateriaActual); } catch (Exception Ex) { this.Notificar(Ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public override void GuardarCambios() { this.MapearADatos(); MateriaLogic ml = new MateriaLogic(); ml.Save(MateriaActual); }
public void Listar() { MateriaLogic ml = new MateriaLogic(); this.dgvMaterias.DataSource = ml.GetAll(); }
private void CargarMaterias(int IDPlan) { MateriaLogic ml = new MateriaLogic(); ml.GetAll(IDPlan); DropDownListMateria.DataSource=listmat; DropDownListMateria.DataTextField= "Descripcion"; DropDownListMateria.DataBind(); }