protected void Button2_Click(object sender, EventArgs e) { Dao dao = new Dao(); string costs = ("INSERT INTO costs(description,value,estimated_id) VALUES('" + txtDescServ.Text + "','" + txtValor.Text + "','" + txtIdOr.Text + "')"); // string address = ("INSERT INTO addresses(street,number,postal_code,district,city,state,country) VALUES('" + txtRua.Text + "','" + txtNumero.Text + "','" + txtCep.Text + "','" + txtBairro.Text + "','" + txtCidade.Text + "','" + txtEstado.Text + "','" + txtPais.Text + "')"); // int idPhone = dao.insereERetornaIdInsercao(phones); // int idAddress = dao.insereERetornaIdInsercao(address); // string company = ("INSERT INTO companies(name,cnpj,address_id,phone_id) VALUES('" + txtNome.Text + "','" + txtCnpj.Text + "','" + idAddress + "','" + idPhone + "')"); //string phoneid = ("SELECT MAX(id) as phone_id FROM phones"); //graças ao Jether dao.inserir(costs); //Response.Redirect("EmpresaCadastradaComSucesso.aspx"); // dao.inserir(phones); //dao.inserir(address); //dao.inserir(company); txtDescServ.Text = ""; txtValor.Text = ""; lblMsg.Text = "Custo Adicionado com sucesso!"; }
protected void Button1_Click(object sender, EventArgs e) { Dao dao = new Dao(); string user = ("INSERT INTO users(name,email,company_id,password) VALUES('" + txtNome.Text + "','" + txtEmail.Text + "','" + txtEmpresa.Text + "','" + txtSenha.Text + "')"); dao.inserir(user); Response.Redirect("UsuarioCadastradoComSucesso.aspx"); }
protected void btnEnviar_Click(object sender, EventArgs e) { Dao dao = new Dao(); string orcamento = ("INSERT INTO estimates(company_id,user_id,description,begin_date) VALUES('" + lblEmpresa.Text + "','" + lblUser_id.Text + "','" + txtDescricao.Text + "','" + lblTimeNow.Text + "')"); //int idPhone = dao.insereERetornaIdInsercao(phones); //int idAddress = dao.insereERetornaIdInsercao(address); //string company = ("INSERT INTO companies(name,cnpj,address_id,phone_id) VALUES('" + txtNome.Text + "','" + txtCnpj.Text + "','" + idAddress + "','" + idPhone + "')"); //string phoneid = ("SELECT MAX(id) as phone_id FROM phones"); //graças ao Jether dao.inserir(orcamento); Response.Redirect("OrcamentoEnviadoComSucesso.aspx"); // dao.inserir(phones); //dao.inserir(address); //dao.inserir(company); }