protected void Page_Load(object sender, EventArgs e) { Dao dao = new Dao(); string cmd = ("select * from users"); MySqlDataReader reader = dao.consultarLer(cmd); while (reader.Read()) { lblId.Text = reader[0].ToString(); lblNome.Text = reader[1].ToString(); lblEmail.Text = reader[2].ToString(); lblEmpresa.Text = reader[3].ToString(); lblSenha.Text = reader[4].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { Dao dao = new Dao(); string cmd = ("select * from companies"); MySqlDataReader reader = dao.consultarLer(cmd); Response.Write("<table border=" + "1>"); while (reader.Read()) { Response.Write("<tr>" + "<td>" + "id: " + "<strong>" + reader[0].ToString() + "</strong>" + " </td>"); Response.Write("<td>" + "empresa: " + "<strong>" + reader[1].ToString() + "</strong>" + " <br/>" + "</td>" + "</tr>"); // lblNome.Text = reader[1].ToString(); // lblCnpj.Text = reader[2].ToString(); } Response.Write("</table>"); reader.Close(); }
protected void Page_Load(object sender, EventArgs e) { Dao dao = new Dao(); string cmd = ("select * from companies"); MySqlDataReader reader = dao.consultarLer(cmd); string aux; string aux2; while (reader.Read()) { lblId.Text = reader[0].ToString(); lblNome.Text = reader[1].ToString(); lblCnpj.Text = reader[2].ToString(); } aux = reader[3].ToString(); aux2 = reader[4].ToString(); reader.Close(); cmd = ("select * from addresses where address_id=" + aux); MySqlDataReader reader2 = dao.consultarLer2(cmd); while (reader2.Read()) { lblLogra.Text = reader2[1].ToString(); lblNum.Text = reader2[2].ToString(); lblCep.Text = reader2[3].ToString(); lblBairro.Text = reader2[4].ToString(); lblCidade.Text = reader2[5].ToString(); lblEstado.Text = reader2[6].ToString(); lblPais.Text = reader2[7].ToString(); } reader2.Close(); cmd = ("select * from phones where phone_id=" + aux2); MySqlDataReader reader3 = dao.consultarLer2(cmd); while (reader3.Read()) { lblTel.Text = reader3[1].ToString(); lblRamal.Text = reader3[2].ToString(); } reader3.Close(); }
protected void Page_Load(object sender, EventArgs e) { Dao dao = new Dao(); string cmd = ("select * From users Where (email LIKE '" + User.Identity.Name + "')"); MySqlDataReader reader = dao.consultarLer(cmd); //Response.Write(cmd); //Response.Write(dao.consultar(cmd)); string empresa = null; //string nome = null; while (reader.Read()) { empresa = reader[3].ToString(); //senha = reader[4].ToString(); } lblInfo.Text = empresa; }
protected void Page_Load(object sender, EventArgs e) { Dao dao = new Dao(); string cmd = ("select * From users Where (email LIKE '" + User.Identity.Name + "')"); MySqlDataReader reader = dao.consultarLer(cmd); //Response.Write(cmd); //Response.Write(dao.consultar(cmd)); string empresa = null; string nome = null; while (reader.Read()) { empresa = reader[3].ToString(); nome = reader[1].ToString(); } //Response.Write(empresa); // Response.Redirect("AcessoNegado.aspx"); lblNome.Text = nome; }
protected void btnLogin_Click(object sender, EventArgs e) { Dao dao = new Dao(); string cmd = ("select * From users Where (email LIKE '" + txtEmail.Text + "')"); MySqlDataReader reader = dao.consultarLer(cmd); //Response.Write(cmd); //Response.Write(dao.consultar(cmd)); string senha = null; string nome = null; while (reader.Read()) { nome = reader[2].ToString(); senha = reader[4].ToString(); } if (senha == txtSenha.Text) { FormsAuthentication.RedirectFromLoginPage(nome, false); } }
protected void Button1_Click(object sender, EventArgs e) { Dao dao = new Dao(); string cmd = ("select * From estimates Where (estimate_id LIKE '" + txtIdOr.Text + "')"); MySqlDataReader reader = dao.consultarLer(cmd); string empresa = null; string cod_us = null; string descricao = null; string data = null; while (reader.Read()) { empresa = reader[1].ToString(); cod_us = reader[2].ToString(); descricao = reader[3].ToString(); data = reader[4].ToString(); } lblUser_id.Text = cod_us; lblEmpresa.Text = empresa; lblTimeNow.Text = data; lblDesc.Text = descricao; }
protected void Page_Load(object sender, EventArgs e) { Dao dao = new Dao(); string cmd = ("select * From users Where (email LIKE '" + User.Identity.Name + "')"); MySqlDataReader reader = dao.consultarLer(cmd); //Response.Write(cmd); //Response.Write(dao.consultar(cmd)); string empresa = null; string nome = null; string user = null; while (reader.Read()) { empresa = reader[3].ToString(); nome = reader[1].ToString(); user = reader[0].ToString(); } //Response.Write(empresa); lblNome.Text = nome; lblEmpresa.Text = empresa; lblTimeNow.Text = DateTime.Now.ToString(); lblUser_id.Text = user; }
protected void Page_Load(object sender, EventArgs e) { string field1 = (string)(Session["field1"]); lblNumOs.Text = field1; Dao dao = new Dao(); string cmd = ("select * From estimates Where (estimate_id LIKE '" + field1 + "')"); MySqlDataReader reader = dao.consultarLer(cmd); string comp_id; string user_id; string end_id; string tel_id; while (reader.Read()) { lblDescri.Text = reader[3].ToString(); lblData.Text = reader[4].ToString(); comp_id = reader[1].ToString(); user_id = reader[2].ToString(); } comp_id = reader[1].ToString(); user_id = reader[2].ToString(); reader.Close(); cmd = ("select * From users Where (user_id LIKE '" + user_id + "')"); MySqlDataReader reader2 = dao.consultarLer2(cmd); while (reader2.Read()) { lblUser.Text = reader2[1].ToString(); } reader2.Close(); cmd = ("select * From companies Where (company_id LIKE '" + comp_id + "')"); MySqlDataReader reader3 = dao.consultarLer2(cmd); while (reader3.Read()) { lblEmpresa.Text = reader3[1].ToString(); end_id = reader3[3].ToString(); tel_id = reader3[4].ToString(); } end_id = reader3[3].ToString(); tel_id = reader3[4].ToString(); reader3.Close(); cmd = ("select * From addresses Where (address_id LIKE '" + end_id + "')"); MySqlDataReader reader4 = dao.consultarLer2(cmd); while (reader4.Read()) { lblRua.Text = reader4[1].ToString(); lblNum.Text = reader4[2].ToString(); lblBairro.Text = reader4[4].ToString(); lblCidade.Text = reader4[5].ToString(); lblEstado.Text = reader4[6].ToString(); lblPais.Text = reader4[7].ToString(); } reader4.Close(); cmd = ("select * From phones Where (phone_id LIKE '" + tel_id + "')"); MySqlDataReader reader5 = dao.consultarLer2(cmd); while (reader5.Read()) { lblTel.Text = reader5[1].ToString(); lblRamal.Text = reader5[2].ToString(); } reader4.Close(); }