Exemplo n.º 1
0
        private void modificarAfiliado()
        {
            String pattern;
            String query;
            ConnectorClass con = ConnectorClass.Instance;

            System.Diagnostics.Debug.WriteLine("Se modificará el afiliado..");

            pattern = "UPDATE BUGDEVELOPING.PERSONA SET PE_NOMBRE = '{0}', PE_APELLIDO = '{1}', PE_NUM_DOC = {2}, PE_DIRECCION = '{3}', PE_TELEFONO = '{4}', PE_MAIL = '{5}', PE_TIPO_DOC = {6}, PE_SEXO = {7}, PE_FECHA_NAC = '{8}' WHERE PE_ID = {9}";
            query = String.Format(pattern, maskedNombre.Text.Trim(), maskedApellido.Text.Trim(), documento.Text, maskedDireccion.Text.Trim(), maskedTelefono.Text.Trim(), mail.Text, tipoDocumento.SelectedValue, sexo.SelectedValue, fechaNacimiento.Value.Date.ToString("yyyy-dd-MM"), selected.Cells["PE_ID"].Value.ToString());
            System.Diagnostics.Debug.WriteLine(query);
            con.executeQuery(query);

            pattern = "UPDATE BUGDEVELOPING.PACIENTE SET PA_ESTADO_CIVIL = {0} WHERE PA_NAFILIADO = {1}";
            query = String.Format(pattern, estadoCivil.SelectedValue, selected.Cells["NRO_AFILIADO"].Value.ToString());
            System.Diagnostics.Debug.WriteLine(query);
            con.executeQuery(query);

            if (!selected.Cells["ID_PLAN_MEDICO"].Value.Equals(planMedico.SelectedValue))
            {
                ConfirmarCambioPlan window = new ConfirmarCambioPlan();
                DialogResult resultSeleccion = window.ShowDialog();
                if (resultSeleccion == DialogResult.OK)
                {
                    pattern = "EXECUTE BUGDEVELOPING.CAMBIO_PLAN_MEDICO_PACIENTE {0},{1},{2},'{3}'";
                    query = String.Format(pattern, planMedico.SelectedValue, selected.Cells["NRO_AFILIADO"].Value.ToString(), ConfigurationManager.AppSettings["fechaSistema"], window.motivo);
                    System.Diagnostics.Debug.WriteLine(query);
                    con.executeQuery(query);
                }
            }
        }
Exemplo n.º 2
0
        private void modificarAfiliado()
        {
            String pattern;
            String query;
            ConnectorClass con = ConnectorClass.Instance;

            System.Diagnostics.Debug.WriteLine("Se modificará el afiliado..");

            pattern = "UPDATE BUGDEVELOPING.PERSONA SET PE_NOMBRE = '{0}', PE_APELLIDO = '{1}', PE_NUM_DOC = {2}, PE_DIRECCION = '{3}', PE_TELEFONO = '{4}', PE_MAIL = '{5}', PE_TIPO_DOC = {6}, PE_SEXO = {7}, PE_FECHA_NAC = '{8}' WHERE PE_ID = {9}";
            query = String.Format(pattern, maskedNombre.Text.Trim(), maskedApellido.Text.Trim(), documento.Text, maskedDireccion.Text.Trim(), maskedTelefono.Text.Trim(), mail.Text, tipoDocumento.SelectedValue, sexo.SelectedValue, fechaNacimiento.Value.Date.ToString("yyyy-dd-MM"), selected.Cells["PE_ID"].Value.ToString());
            System.Diagnostics.Debug.WriteLine(query);
            con.executeQuery(query);

            pattern = "UPDATE BUGDEVELOPING.PACIENTE SET PA_ESTADO_CIVIL = {0} WHERE PA_NAFILIADO = {1}";
            query = String.Format(pattern, estadoCivil.SelectedValue, selected.Cells["NRO_AFILIADO"].Value.ToString());
            System.Diagnostics.Debug.WriteLine(query);
            con.executeQuery(query);

            if (!selected.Cells["ID_PLAN_MEDICO"].Value.Equals(planMedico.SelectedValue))
            {
                ConfirmarCambioPlan window = new ConfirmarCambioPlan();
                DialogResult resultSeleccion = window.ShowDialog();
                if (resultSeleccion == DialogResult.OK)
                {
                    pattern = "EXECUTE BUGDEVELOPING.CAMBIO_PLAN_MEDICO_PACIENTE {0},{1},{2},'{3}'";
                    query = String.Format(pattern, planMedico.SelectedValue, selected.Cells["NRO_AFILIADO"].Value.ToString(), ConfigurationManager.AppSettings["fechaSistema"], window.motivo);
                    System.Diagnostics.Debug.WriteLine(query);
                    con.executeQuery(query);
                }
            }
        }