public string VerificarUsuarioExiste(string dni) { string sql, result = ""; int cont = 0; sql = "SELECT count(*) n_count FROM co_mve_usuario where c_dni = '" + dni + "'"; SqlConnection cn = con.conexionLys(); cn.Open(); SqlDataAdapter dap = new SqlDataAdapter(sql, cn); DataTable dt = new DataTable(); dap.SelectCommand.CommandType = CommandType.Text; dap.Fill(dt); cn.Close(); if (dt != null) { cont = Convert.ToInt32(dt.Rows[0]["n_count"]); } if (cont == 0) { result = "OK"; } else if (cont > 0) { result = "NO"; } return(result); }
public void LoadReporte(string dni) { Conexion con = new Conexion(); // String BodyHtml = "", HeadHtml = "", FotHtml = ""; SqlConnection cn = con.conexionLys(); cn.Open(); SqlDataAdapter dap = new SqlDataAdapter("SP_CO_MVE_CONSULTAPUNTOS", cn); DataTable dt = new DataTable(); dap.SelectCommand.CommandType = CommandType.StoredProcedure; dap.SelectCommand.Parameters.AddWithValue("@Dni", dni); dap.Fill(dt); cn.Close(); if (dt != null) { gv_RepPuntos.DataSource = dt; gv_RepPuntos.DataBind(); } }