public string fnGeneraTransaccionPrevia() { conexionBD cnn = new conexionBD(); transacciones trans = new transacciones(); if (trans.fnInsertaDatosTransaccion(txt_num_empleado.Text, id_entrevistador, DateTime.Now.ToString("MM/dd/yyyy"), "0", "0", "0", "0", "0", " ")) { DataTable dtl = cnn.fnConsultaSentencia("SELECT id_det FROM tbl_transaccionDet WHERE id_user= "******" AND id_encuestador = " + id_entrevistador + " AND fiebre = 0 AND tos_estornudos = 0 AND malestar_gen = 0 AND dolor_cabeza = 0 AND dificultad_resp = 0 AND path_comprobante = ' '"); foreach (DataRow item in dtl.Rows) { object[] obj = item.ItemArray; return(obj[0].ToString()); } } return(string.Empty); }
private void materialRaisedButton2_Click(object sender, EventArgs e) { switch (flag) { //formulario de fiebre case 0: //fiebreView fiebre = new fiebreView(); //if (this.panel_carga_visor.Controls.Count > 0) // this.panel_carga_visor.Controls.RemoveAt(0); //Form fh_fiebre = fiebre as Form; //fh_fiebre.TopLevel = false; //fh_fiebre.Dock = DockStyle.Fill; //this.panel_carga_visor.Controls.Add(fh_fiebre); //this.panel_carga_visor.Tag = fh_fiebre; //fh_fiebre.Show(); tosEstornudosView tos = new tosEstornudosView(); if (this.panel_carga_visor.Controls.Count > 0) { this.panel_carga_visor.Controls.RemoveAt(0); } Form fh_tos = tos as Form; fh_tos.TopLevel = false; fh_tos.Dock = DockStyle.Fill; this.panel_carga_visor.Controls.Add(fh_tos); this.panel_carga_visor.Tag = fh_tos; fh_tos.Show(); this.flag = 1; this.fiebre = 0; return; //formulario de tos o estornudos case 1: malestarView malestar = new malestarView(); if (this.panel_carga_visor.Controls.Count > 0) { this.panel_carga_visor.Controls.RemoveAt(0); } Form fh_malestar = malestar as Form; fh_malestar.TopLevel = false; fh_malestar.Dock = DockStyle.Fill; this.panel_carga_visor.Controls.Add(fh_malestar); this.panel_carga_visor.Tag = fh_malestar; fh_malestar.Show(); this.flag = 2; this.tos_estornudos = 0; return; //formulario de malestar general case 2: dolorCabezaView cabeza = new dolorCabezaView(); if (this.panel_carga_visor.Controls.Count > 0) { this.panel_carga_visor.Controls.RemoveAt(0); } Form fh_cabeza = cabeza as Form; fh_cabeza.TopLevel = false; fh_cabeza.Dock = DockStyle.Fill; this.panel_carga_visor.Controls.Add(fh_cabeza); this.panel_carga_visor.Tag = fh_cabeza; fh_cabeza.Show(); this.flag = 3; this.malestar = 0; return; //formulario de dolor de cabeza case 3: dificultadView dificultad = new dificultadView(); if (this.panel_carga_visor.Controls.Count > 0) { this.panel_carga_visor.Controls.RemoveAt(0); } Form fh_dificultad = dificultad as Form; fh_dificultad.TopLevel = false; fh_dificultad.Dock = DockStyle.Fill; this.panel_carga_visor.Controls.Add(fh_dificultad); this.panel_carga_visor.Tag = fh_dificultad; fh_dificultad.Show(); this.flag = 4; this.dolor_cabeza = 0; return; //formulario de dificultad respiratoria case 4: this.flag = 5; this.dificultad_resp = 0; break; default: break; } DateTime fecha = DateTime.Now; ok_cancel_message mensaje = new ok_cancel_message("DESEA IMPRIMIR EL FORMATO?"); transacciones transaccion = new transacciones(); if (DialogResult.OK == mensaje.ShowDialog()) { //CARGAMOS EL COMPROBANTE DEL CUESTIONARIO ComprobanteVisor visor = new ComprobanteVisor(0, Int32.Parse(this.id_empleado)); visor.fiebre = this.fiebre; visor.tos = this.tos_estornudos; visor.malestar = this.malestar; visor.dolor = this.dolor_cabeza; visor.dificultad = this.dificultad_resp; visor.ShowDialog(); //GUARDAMOS LA TRANSACCION EN LA BASE DE DATOS transaccion.fnInsertaDatosTransaccion(this.id_empleado, this.id_entrevistador, fecha.ToString("MM/dd/yyyy"), this.fiebre.ToString(), this.tos_estornudos.ToString(), this.malestar.ToString(), this.dolor_cabeza.ToString(), this.dificultad_resp.ToString(), visor.path_archivo); this.Hide(); } else { //CARGAMOS EL COMPROBANTE DEL CUESTIONARIO ComprobanteVisor visor = new ComprobanteVisor(0, Int32.Parse(this.id_empleado)); visor.fiebre = this.fiebre; visor.tos = this.tos_estornudos; visor.malestar = this.malestar; visor.dolor = this.dolor_cabeza; visor.dificultad = this.dificultad_resp; visor.fnCargaNuevoArchivo(); //GUARDAMOS LA TRANSACCION EN LA BASE DE DATOS transaccion.fnInsertaDatosTransaccion(this.id_empleado, this.id_entrevistador, fecha.ToString("MM/dd/yyyy"), this.fiebre.ToString(), this.tos_estornudos.ToString(), this.malestar.ToString(), this.dolor_cabeza.ToString(), this.dificultad_resp.ToString(), visor.path_archivo); this.Hide(); } }