Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DAL.DALProdutos        SelectProdutos = new DAL.DALProdutos();
            List <Modelo.Produtos> Produto        = SelectProdutos.SelectAll();

            foreach (Modelo.Produtos Produtos in Produto)
            {
                TableRow  row   = new TableRow();
                TableCell cell2 = new TableCell();
                cell2.Text = Produtos.idProduto.ToString();
                row.Cells.Add(cell2);
                cell2.Visible = false;
                cell2         = new TableCell();
                cell2.Text    = Produtos.codigo.ToString();
                row.Cells.Add(cell2);
                cell2      = new TableCell();
                cell2.Text = Produtos.descricao.ToString();
                row.Cells.Add(cell2);
                cell2 = new TableCell();
                HyperLink hl = new HyperLink();
                hl.CssClass    = "Botao3 botao3";
                hl.NavigateUrl = "./AlterarProdutos.aspx?idProduto=" + Produtos.idProduto.ToString();
                hl.Text        = "Editar";
                cell2.Controls.Add(hl);
                row.Cells.Add(cell2);
                cell2          = new TableCell();
                hl             = new HyperLink();
                hl.CssClass    = "Botao6 botao6";
                hl.NavigateUrl = "./ExcluirProdutos.aspx?idProduto=" + Produtos.idProduto.ToString();
                hl.Text        = "Excluir";
                cell2.Controls.Add(hl);
                row.Cells.Add(cell2);
                Table1.Rows.Add(row);
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DAL.DALItemVenda         dalitem   = new DAL.DALItemVenda();
            List <Modelo.ItensVenda> listItens = new List <Modelo.ItensVenda>();

            if (Request.QueryString["idVenda"] != null)
            {
                int idVenda = int.Parse(Request.QueryString["idVenda"].ToString());
                listItens = dalitem.SelectIdVenda(idVenda);
                TableRow  tr1;
                TableCell tc0, tc1, tc2, tc3;
                for (int i = 0; i < listItens.Count; i++)
                {
                    Label           l1      = new Label();
                    DAL.DALProdutos dalprod = new DAL.DALProdutos();
                    Modelo.Produtos produto = dalprod.SelectProdutos(listItens[i].idProduto)[0];
                    l1.Text      = produto.descricao;
                    l1.Font.Name = "Segoe UI Light";
                    l1.Font.Size = 16;
                    l1.Font.Bold = true;
                    tc0          = new TableCell();
                    tc0.Controls.Add(l1);
                    tc0.Width = 230;

                    Label l2 = new Label();
                    l2.Text      = listItens[i].peso.ToString();
                    l2.Font.Name = "Segoe UI Light";
                    l2.Font.Size = 16;
                    l2.Font.Bold = true;
                    tc1          = new TableCell();
                    tc1.Controls.Add(l2);
                    tc1.Width = 200;

                    Label l3 = new Label();
                    l3.Text      = listItens[i].precokg.ToString();
                    l3.Font.Name = "Segoe UI Light";
                    l3.Font.Size = 16;
                    l3.Font.Bold = true;
                    tc2          = new TableCell();
                    tc2.Controls.Add(l3);
                    tc2.Width = 200;

                    Label l4 = new Label();
                    l4.Text      = "&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;" + listItens[i].valorTotal.ToString();
                    l4.Font.Name = "Segoe UI Light";
                    l4.Font.Size = 16;
                    l4.Font.Bold = true;
                    tc3          = new TableCell();
                    tc3.Controls.Add(l4);
                    tc3.Width = 220;

                    tr1 = new TableRow();
                    tr1.Cells.Add(tc0);
                    tr1.Cells.Add(tc1);
                    tr1.Cells.Add(tc2);
                    tr1.Cells.Add(tc3);
                    Table3.Rows.Add(tr1);
                }
            }
        }
Example #3
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     DAL.DALProdutos insertProdutos = new DAL.DALProdutos();
     Modelo.Produtos Produtos       = new Modelo.Produtos(TextBox1.Text, TextBox2.Text);
     insertProdutos.InserirProdutos(Produtos);
     Response.Redirect("./Produtos.aspx");
 }
Example #4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DAL.DALProdutos        DelectProdutos = new DAL.DALProdutos();
            List <Modelo.Produtos> Produtos       = DelectProdutos.SelectProdutos(int.Parse(Request.QueryString["idProduto"]));

            DelectProdutos.Delete(Produtos[0].idProduto);
            Response.Redirect("./Produtos.aspx");
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DAL.DALProdutos        SelectProdutos = new DAL.DALProdutos();
            List <Modelo.Produtos> Produtos       = SelectProdutos.SelectProdutos(int.Parse(Request.QueryString["idProduto"]));

            Label3.Text = Produtos[0].codigo;
            Label4.Text = Produtos[0].descricao;
        }
Example #6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DAL.DALProdutos        AtualizarProdutos = new DAL.DALProdutos();
            List <Modelo.Produtos> Produtos          = AtualizarProdutos.SelectProdutos(int.Parse(Request.QueryString["idProduto"]));

            Produtos[0].codigo    = TextBox1.Text;
            Produtos[0].descricao = TextBox2.Text;
            AtualizarProdutos.AtualizarProdutos(Produtos[0]);
            Response.Redirect("./Produtos.aspx");
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DAL.DALItemCompra         dalitem   = new DAL.DALItemCompra();
                List <Modelo.ItensCompra> listItens = new List <Modelo.ItensCompra>();
                if (Request.QueryString["idCompra"] != null)
                {
                    DAL.DALCompras dalcompra = new DAL.DALCompras();
                    Modelo.Compra  compra    = dalcompra.SelectCompras(int.Parse(Request.QueryString["idCompra"]))[0];
                    TextBox3.Text          = compra.desconto.ToString();
                    Label6.Text            = compra.valorTotal.ToString();
                    Calendar1.SelectedDate = compra.datas;
                    int idCompra = int.Parse(Request.QueryString["idCompra"].ToString());
                    listItens = dalitem.SelectIdCompra(idCompra);
                    TableRow  tr1;
                    TableCell tc0, tc1, tc2, tc3, tc4;
                    for (int i = 0; i < listItens.Count; i++)
                    {
                        Label           l1      = new Label();
                        DAL.DALProdutos dalprod = new DAL.DALProdutos();
                        Modelo.Produtos produto = dalprod.SelectProdutos(listItens[i].idProduto)[0];
                        l1.Text      = produto.descricao;
                        l1.Font.Name = "Segoe UI Light";
                        l1.Font.Size = 16;
                        l1.Font.Bold = true;
                        tc0          = new TableCell();
                        tc0.Controls.Add(l1);
                        tc0.Width = 230;

                        Label l2 = new Label();
                        l2.Text      = listItens[i].unidade;
                        l2.Font.Name = "Segoe UI Light";
                        l2.Font.Size = 16;
                        l2.Font.Bold = true;
                        tc1          = new TableCell();
                        tc1.Controls.Add(l2);
                        tc1.Width = 200;

                        Label l3 = new Label();
                        l3.Text      = listItens[i].quantidade.ToString();
                        l3.Font.Name = "Segoe UI Light";
                        l3.Font.Size = 16;
                        l3.Font.Bold = true;
                        tc2          = new TableCell();
                        tc2.Controls.Add(l3);
                        tc2.Width = 200;

                        Label l4 = new Label();
                        l4.Text      = "&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;" + listItens[i].precoUnitario.ToString();
                        l4.Font.Name = "Segoe UI Light";
                        l4.Font.Size = 16;
                        l4.Font.Bold = true;
                        tc3          = new TableCell();
                        tc3.Controls.Add(l4);
                        tc3.Width = 220;

                        Label l5 = new Label();
                        l5.Text      = "&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;" + listItens[i].precoTotal.ToString();
                        l5.Font.Name = "Segoe UI Light";
                        l5.Font.Size = 16;
                        l5.Font.Bold = true;
                        tc4          = new TableCell();
                        tc4.Controls.Add(l5);
                        tc4.Width = 400;

                        tr1 = new TableRow();
                        tr1.Cells.Add(tc0);
                        tr1.Cells.Add(tc1);
                        tr1.Cells.Add(tc2);
                        tr1.Cells.Add(tc3);
                        tr1.Cells.Add(tc4);
                        Table1.Rows.Add(tr1);
                    }
                }
            }
        }