public override void GuardarCambios() { this.MapearADatos(); PlanNegocio pn = new PlanNegocio(); pn.Save(PlanActual); }
public void Agregar(string nuevo, bool estado) { if (this.Existe(nuevo) == true) { MessageBox.Show("El Plan ya existe"); return; } PlanNegocio planN = new PlanNegocio(); Plan aux = new Plan(); aux.nombre = nuevo.ToUpper(); aux.estado = 1; if (planN.Agregar(aux) == false) { MessageBox.Show("Error al Agregar"); return; } this.lstPlanes.DataSource = planN.Leer_todos(); for (int i = 0; i < this.lstPlanes.Items.Count; i++) { aux = (Plan)this.lstPlanes.Items[i]; if (aux.nombre.CompareTo(nuevo.Trim()) == 0) { this.lstPlanes.SelectedIndex = i; break; } } }
public void Modificar(string nuevo, bool estado) { if (this.ExisteId(nuevo) == true) { MessageBox.Show("El Plan ya existe"); return; } PlanNegocio planN = new PlanNegocio(); this.plan.nombre = nuevo.ToUpper(); if (estado == false) { this.plan.estado = 1; } else { this.plan.estado = 0; } if (planN.Escribir(this.plan) == false) { MessageBox.Show("Error al Modificar"); return; } this.lstPlanes.DataSource = planN.Leer_todos(); for (int i = 0; i < this.lstPlanes.Items.Count; i++) { Plan aux = (Plan)this.lstPlanes.Items[i]; if (aux.nombre.CompareTo(nuevo.Trim()) == 0) { this.lstPlanes.SelectedIndex = i; break; } } }
private void cargarCbPlanes() { PlanNegocio pn = new PlanNegocio(); cbPlanes.DataSource = pn.GetAll(); cbPlanes.DisplayMember = "DescripcionPlan"; cbPlanes.ValueMember = "Id"; }
public PlanEscritorio(int ID, ModoForm modo) : this() { this.Modo = modo; PlanNegocio pn = new PlanNegocio(); PlanActual = pn.GetOne(ID); this.cargarCbEspecialidades(); this.MapearDeDatos(); }
public void CargaDropDownListPlanes() { PlanNegocio pn = new PlanNegocio(); this.PlanesDropDownList.DataSource = pn.GetAll(); this.PlanesDropDownList.DataValueField = "Id"; this.PlanesDropDownList.DataTextField = "DescripcionPlan"; // this.PlanesDropDownList.DataBind(); this.PlanesDropDownList.Items.Insert(0, new ListItem("Seleccione Plan.", "0")); }
private void frmElegirPlanObraSocial_Load(object sender, EventArgs e) { PlanNegocio planN = new PlanNegocio(); this.lstPlanes.DataSource = planN.Leer_Activos(); if (this.lstPlanes.Items.Count > 0) { this.lstPlanes.SelectedIndex = 0; } }
protected void btnLogIn_Click(object sender, EventArgs e) { logInPacienteNegocio = new LogInPacienteNegocio(); logInPaciente = logInPacienteNegocio.BuscarUsuario(this.tbxUsuario.Text.Trim()); this.tbxClave.CssClass = "campo"; this.tbxUsuario.CssClass = "campo"; this.lblMensaje.Text = ""; if (logInPaciente != null) { if (logInPaciente.clave == this.tbxClave.Text.Trim()) { pacienteNegocio = new PacienteNegocio(); paciente = new Paciente(); obraSocial = new ObraSocialNegocio(); planNegocio = new PlanNegocio(); pacienteNegocio.LeerDni(logInPaciente.id, ref paciente); lista = obraSocial.Leer_Una(paciente); if (lista != null) { paciente.obra_social = lista.ElementAt(0); } listaPlan = planNegocio.Leer_uno(paciente); if (listaPlan != null) { paciente.plan = listaPlan.ElementAt(0); } Session.Add("paciente", paciente); Response.Redirect("~/default.aspx"); } else { this.tbxClave.CssClass = "campo_erroneo"; this.lblMensaje.Text = "La clave ingresada es inválida"; } } else { this.tbxUsuario.CssClass = "campo_erroneo"; this.tbxClave.CssClass = "campo_erroneo"; this.lblMensaje.Text = "El usuario no exite"; } }
private bool Existe(string nuevo) { PlanNegocio planN = new PlanNegocio(); List <Plan> aux = planN.Leer_todos(); //////////////////////////////// for (int i = 0; i < aux.Count; i++) { Plan aux2 = (Plan)aux.ElementAt(i); if (aux2.nombre.CompareTo(nuevo.Trim()) == 0) { return(true); } } return(false); }
private void btnEliminar_Click(object sender, EventArgs e) { PlanNegocio planN = new PlanNegocio(); if (planN.Eliminar(this.plan) == false) { MessageBox.Show("Error al eliminar"); return; } MessageBox.Show("Plan dado de BAJA"); this.lstPlanes.DataSource = planN.Leer_todos(); if (this.lstPlanes.Items.Count > 0) { this.lstPlanes.SelectedIndex = 0; } }
private void frmAbmPlanes_Load(object sender, EventArgs e) { PlanNegocio planN = new PlanNegocio(); this.lstPlanes.DataSource = planN.Leer_todos(); if (this.lstPlanes.Items.Count > 0) { this.lstPlanes.SelectedIndex = 0; } int id = Convert.ToInt32(Usuario.TipoUser.osociales); if (id == 1) { this.btnAgregar.Enabled = false; this.btnModificar.Enabled = false; this.btnEliminar.Enabled = false; } }
private void Listar() { PlanNegocio pn = new PlanNegocio(); this.dgvPlanes.DataSource = pn.GetAll(); }