Пример #1
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            MyPetWS.MyPetWS ws = new MyPetWS.MyPetWS();

            if (ws.Login(txtUsername.Text, txtPassword.Text) == "true")
            {
                lblResult.Text = "<i class=\"fa fa-user mr - xs\"></i> Válido";

                DataTable dt = ws.DadosUsuario(txtUsername.Text, txtPassword.Text);
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    HttpContext.Current.Session["idPrestador"]    = dt.Rows[i][0];
                    HttpContext.Current.Session["usrLogado"]      = dt.Rows[i][1];
                    HttpContext.Current.Session["nomePrestador"]  = dt.Rows[i][9];
                    HttpContext.Current.Session["emailPrestador"] = dt.Rows[i][11];
                }

                Response.Redirect("~/View/Dashboard.aspx");
            }
            else
            {
                lblResult.Text = "<i class=\"fa fa-user mr - xs\"></i> Inválido";
                //Response.Redirect("~/View/Dashboard.aspx");
            }

            //ws.TesteConexao
            //Response.Redirect("~/View/Dashboard.aspx");
        }
Пример #2
0
        public void listarProdutos(int id)
        {
            DataTable dt;

            MyPetWS.MyPetWS ws = new MyPetWS.MyPetWS();
            dt = ws.ListarProdutos(id);

            ltrTabela.Text = "";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ltrTabela.Text += "<tr><td>" + dt.Rows[i][0] + "</td> " +
                                  "<td>" + dt.Rows[i][1] + "</td> " +
                                  "<td>" + dt.Rows[i][2] + "</td> " +
                                  "<td>R$ " + dt.Rows[i][3] + "</td> " +
                                  "<td>R$ " + dt.Rows[i][4] + "</td> " +
                                  "<td class='actions'><asp:LinkButton runat='server' class='mb-xs mt-xs mr-xs modal-with-zoom-anim btn btn-default' href='#modalEdit" + dt.Rows[i][0] + "' OnClick='editarItem(" + dt.Rows[i][0] + ")'/><i class='fa fa-pencil'></i></a></td></tr>" +
                                  "<!-- Modal Animation -->" +
                                  "<div id=\"modalEdit" + dt.Rows[i][0] + "\" class=\"zoom-anim-dialog modal-block modal-block-primary mfp-hide\">" +
                                  "<section class=\"panel\">" +
                                  "<header class=\"panel-heading\">" +
                                  "<h2 class=\"panel-title\">" + dt.Rows[i][1] + "</h2>" +
                                  "</header>" +
                                  "<div class=\"panel-body\">" +
                                  "<div class=\"modal-wrapper\">" +

                                  "</div>" +
                                  "</div>" +
                                  "<footer class=\"panel-footer\">" +
                                  "<div class=\"row\">" +
                                  "<div class=\"col-md-12 text-right\">" +
                                  "<button class=\"btn btn-primary modal-confirm\">Salvar</button>" +
                                  "<button class=\"btn btn-default modal-dismiss\">Cancelar</button>" +
                                  "</div>" +
                                  "</div>" +
                                  "</footer>" +
                                  "</section>" +
                                  "</div>";
            }
        }
Пример #3
0
 protected void salvarProduto(object sender, EventArgs e)
 {
     MyPetWS.MyPetWS ws = new MyPetWS.MyPetWS();
     ws.GravarProduto(descricao.Text, Convert.ToInt32(lstTipo.SelectedValue), Convert.ToDecimal(valor.Text), chkEntrega.Text, (int)HttpContext.Current.Session["idPrestador"]);
 }