public Dictionary <string, object> Selecionar(int id) { oTipoExpediente = new TipoExpediente(id, oDao); return(ClassFunctions.GetProperties(oTipoExpediente)); }
protected void btnaceptar_Click(object sender, EventArgs e) { try { if (this.txtdescripcion.Text.Trim() != "") { try { TipoExpediente tipoexpediente = new TipoExpediente(); tipoexpediente.descTipoExpediente = this.txtdescripcion.Text.Trim(); if (hAccion.Value == "agregar") { byte Est; if (this.cboestado.SelectedIndex == 0) { Est = 1; } else { Est = 0; } tipoexpediente.estado = Convert.ToBoolean(Est); tipoexpediente.idTipoExpediente = NegocioMantenimiento.TraerIdTipoExpediente(); this.cboestado.Enabled = true; NegocioMantenimiento.AgregarTipoExpediente(tipoexpediente); MostrarMensaje("Un nuevo Tipo de Expediente ha sido agregada satisfactoriamente"); txtdescripcion.Text = ""; cboestado.SelectedIndex = 0; txtdescripcion.Enabled = false; } else { tipoexpediente.idTipoExpediente = Convert.ToByte(int.Parse(GvTipoExpedientes.SelectedRow.Cells[1].Text)); if (cboestado.SelectedItem.Text == "Activo") { byte Est = 1; tipoexpediente.estado = Convert.ToBoolean(Est); } else { byte Est = 0; tipoexpediente.estado = Convert.ToBoolean(Est); } NegocioMantenimiento.ModificarTipoExpediente(tipoexpediente); MostrarMensaje("Usted ha modificado el tipo de expediente: " + tipoexpediente.descTipoExpediente + ", satisfactoriamente."); txtdescripcion.Text = ""; cboestado.SelectedIndex = 0; txtdescripcion.Enabled = false; } CargarGrillaTipoExpedientes(); this.txttipoexpediente.Text = ""; this.txtdescripcion.Text = ""; this.cboestado.Enabled = false; this.GvTipoExpedientes.SelectedIndex = -1; } catch (Exception ex) { Response.Redirect("Errores.aspx?error=" + ex.Message); } } else { MostrarMensaje("Por Favor, complete todos los campos antes de realizar esta función."); this.txtdescripcion.Text = ""; this.txttipoexpediente.Text = ""; this.txtdescripcion.Enabled = false; this.cboestado.Enabled = false; this.GvTipoExpedientes.SelectedIndex = -1; } } catch (Exception ex) { Response.Redirect("Errores.aspx?error=" + ex.Message); } habilitarBotones(true); }
public void PrepararInclusao() { oTipoExpediente = new TipoExpediente(oDao); }