public void Listar() { EspecialidadesLogic el = new EspecialidadesLogic(); this.dgvEspecialidades.DataSource = el.GetAll(); id_especialidades.DataPropertyName = "ID"; desc_especialidades.DataPropertyName = "desc_especialidad"; }
private void LoadEntity(Plan plan) { List <Especialidad> especialidades = new EspecialidadesLogic().GetAll(); plan.Descripcion = this.DescripcionTextBox.Text; foreach (var p in especialidades.Where(p => p.Descripcion == idEspDdl.Text)) { plan.IDEspecialidad = p.ID; } }
private void LoadGrid() { this.GridView1.DataSource = this.Logic.GetAll(); this.GridView1.DataBind(); List <Plan> pl = new PlanLogic().GetAll(); for (int i = 0; i < pl.Count; i++) { var esp = new EspecialidadesLogic().getOne(Convert.ToInt32(this.GridView1.Rows[i].Cells[2].Text)); this.GridView1.Rows[i].Cells[3].Text = esp.Descripcion; } }
private void LoadForm(int id) { List <Especialidad> especialidades = new EspecialidadesLogic().GetAll(); this.Entity = this.Logic.getOne(id); this.IdTextBox.Text = this.Entity.ID.ToString(); this.DescripcionTextBox.Text = this.Entity.Descripcion; foreach (var p in especialidades.Where(p => p.ID == this.Entity.IDEspecialidad)) { this.idEspDdl.Text = p.Descripcion; } }
void Listar() { PlanLogic ml = new PlanLogic(); this.dgvPlanes.DataSource = ml.GetAll(); List <Plan> Pl = new PlanLogic().GetAll(); for (int i = 0; i < Pl.Count; i++) { var esp = new EspecialidadesLogic().getOne(Convert.ToInt32(this.dgvPlanes.Rows[i].Cells[2].Value)); this.dgvPlanes.Rows[i].Cells[3].Value = esp.Descripcion; } }
private void tsEliminar_Click(object sender, EventArgs e) { if (EspecialidadesLogic.isDeleteValid(Convert.ToInt32(this.dgvEspecialidades.SelectedRows[0].Cells[0].Value))) { int ID = ((Business.Entities.Especialidad) this.dgvEspecialidades.SelectedRows[0].DataBoundItem).ID; new EspecialidadesLogic().Delete(ID); this.Listar(); } else { BusinessLogic.Notificar("Especialidad", "Esta especialidad esta vinculada a un Plan", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected void Page_Load(object sender, EventArgs e) { LoadGrid(); if (!IsPostBack) { List <Especialidad> especialidades = new EspecialidadesLogic().GetAll(); LoadGrid(); this.FormMode = FormModes.Baja; this.IdTextBox.Enabled = false; foreach (var p in especialidades) { idEspDdl.Items.Add(p.Descripcion); } } }
public void Listar() { try { EspecialidadesLogic el = new EspecialidadesLogic(); dgvSelectespecialidades.DataSource = el.GetAll(); } catch (Exception Error) { var msError = "Error message: " + Error.Message; if (Error.InnerException != null) { msError = msError + "\nInner exception: " + Error.InnerException.Message; } msError = msError + "\nStack trace: " + Error.StackTrace; MessageBox.Show(msError, "Error ", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); } id_especialidad.DataPropertyName = "ID"; desc_especialidad.DataPropertyName = "desc_especialidad"; }
public Especialidades() { EspecialidadesNegocio = new EspecialidadesLogic(); }
void Listar() { EspecialidadesLogic el = new EspecialidadesLogic(); this.dgvEspecialidades.DataSource = el.GetAll(); }