protected void btnConfirmar_Click(object sender, EventArgs e) { if (Page.IsValid) { var personaPaciente = new PacienteDto(); ObtenerDatosPantalla(personaPaciente); string varEstado = Request.QueryString["e"]; if (varEstado == "N") { ManagerPacientes.GrabarPacienteInsert(ref personaPaciente); } else if (varEstado == "B") { ManagerPacientes.GrabarPacienteUpdate(ref personaPaciente); } } }
protected void btnConfirmar_Click(object sender, EventArgs e) { if (Page.IsValid) { string error = null; string msj = null; int errorNro = 0; var paciente = new PacienteDto(); ObtenerDatosPantalla(paciente); var varEstado = Request.QueryString["e"]; if (varEstado == "N") { ManagerPacientes.GrabarPacienteInsert(ref paciente, ref error, ref errorNro); msj = "Paciente Guardado."; } else if (varEstado == "B") { ManagerPacientes.GrabarPacienteUpdate(ref paciente, ref error, ref errorNro); msj = "Paciente Actualizado."; } if (error == null) { var script = "showAlert('" + msj + "','1');"; ScriptManager.RegisterStartupScript(this, typeof(Page), "showAlert", script, true); Limpiar(); var script2 = "ocultarFormPaciente();"; ScriptManager.RegisterStartupScript(this, typeof(Page), "ocultarFormPaciente", script2, true); } else { if (errorNro == -2) { var script = "showAlert('" + error + "','3');"; ScriptManager.RegisterStartupScript(this, typeof(Page), "showAlert", script, true); } if (errorNro == -1) { var script = "showAlert('" + error + "','2');"; ScriptManager.RegisterStartupScript(this, typeof(Page), "showAlert", script, true); } } } }